Sfoglia il codice sorgente

Refresh the growth chart daily on an orphan metrics branch (#295)

* Refresh the growth chart daily on an orphan metrics branch (#294)

A scheduled workflow redraws the chart from live per-day counts and
publishes it to an orphan `metrics` branch, so the stars line no longer
waits for a hand-refreshed snapshot and main's branch protection is
untouched.

- growth-chart.yml: render job (contents: read) fetches counts with the
  default token, draws with hash-pinned matplotlib, validates and uploads
  a one-day artifact; publish job (contents: write, no other secrets)
  re-validates and pushes with an explicit force-with-lease. Main-only
  guard, SHA-pinned actions, no expressions in run scripts.
- gen_repo_metrics.py: --verify-bundle treats the artifact as untrusted
  (exact file set, regular files, size caps, PNG checks, hashes, repo,
  freshness, count bounds, duplicate keys, nesting bombs).
- publish_metrics_branch.sh: builds a one-commit orphan history, skips an
  unchanged picture, creates the branch on first run.
- README and wiki pages point at the metrics-branch image; the committed
  PNG and snapshot stay as the offline fallback that --check hashes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Harden the growth chart publish step (#294 review)

- Refuse any ref but refs/heads/metrics in the publish script, with an
  explicit refspec; document that GITHUB_TOKEN cannot be scoped to one
  branch and recommend a repository ruleset (workflow header and the
  Repository-Growth page).
- Skip the push only when the remote branch holds exactly the three files,
  each byte-identical, so changed snapshot or as-of data is published even
  when the picture is the same.
- Hand the credential header to the three remote git commands only, scoped
  to the remote URL through per-command GIT_CONFIG_* env; the token is
  removed from the environment first, never written to disk, and never
  seen by the validator.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Test that the validator never sees the token (#294)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
ChiefGyk3D 1 mese fa
parent
commit
7fbfdbbfbd

+ 102 - 0
.github/workflows/growth-chart.yml

@@ -0,0 +1,102 @@
+# Redraws the repository growth chart every day and publishes it to an orphan
+# branch named `metrics` (issue #294). The README and the wiki show
+# https://raw.githubusercontent.com/ChiefGyk3D/Clouds-Against-Humanity/metrics/repo-growth.png,
+# so the stars line never waits for a person to refresh a snapshot by hand.
+#
+# Two jobs, split by what they may do:
+#   render   contents: read. Runs scripts/gen_repo_metrics.py --refresh with the
+#            default GITHUB_TOKEN. It asks GitHub for time stamps and counts only,
+#            never a user name (the script validates that on every run). It draws
+#            the picture with hash-pinned matplotlib, re-validates the two files and
+#            uploads them as a one-day artifact. It cannot push.
+#   publish  contents: write, no other secrets. Downloads the artifact, validates it
+#            again (it crossed an artifact boundary), builds a fresh one-commit
+#            orphan history and pushes it to `metrics` under a lease on the value it read (never a bare
+#            force). The push is skipped when the picture did not change.
+#            The first run creates the branch. main is never written, so its branch
+#            protection is untouched.
+#
+# Residual risk: GITHUB_TOKEN cannot be scoped to one branch, so the publish job's
+# token is repository-wide contents: write. What limits it: the job runs only
+# checkout, the artifact download and scripts/publish_metrics_branch.sh from main,
+# holds no other secret, hands the token to the three git commands that talk to the
+# remote (scoped to the remote URL, never written to disk, never seen by the
+# validator), and the script refuses any ref but refs/heads/metrics. The real
+# control is a repository ruleset; see docs/wiki/Repository-Growth.md.
+#
+# The committed docs/wiki/images/repo-growth.png and .metrics-snapshot.json stay in
+# main as the offline, hash-checked fallback that CI's --check compares; the daily
+# picture does not replace them. Only runs on main in this repository.
+name: Growth chart
+
+on:
+  schedule:
+    - cron: "23 6 * * *" # daily, off the hour (UTC)
+  workflow_dispatch:
+
+permissions: {}
+
+concurrency:
+  group: growth-chart
+  cancel-in-progress: false
+
+jobs:
+  render:
+    if: github.repository == 'ChiefGyk3D/Clouds-Against-Humanity' && github.ref == 'refs/heads/main'
+    runs-on: ubuntu-24.04
+    timeout-minutes: 15
+    permissions:
+      contents: read
+    steps:
+      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+        with:
+          persist-credentials: false
+
+      - name: Install the plotting libraries (every wheel pinned by hash)
+        run: |
+          python3 -m venv "$RUNNER_TEMP/venv"
+          "$RUNNER_TEMP/venv/bin/pip" install --require-hashes --no-deps -r scripts/growth-chart-requirements.txt
+
+      - name: Fetch per-day counts and draw the chart
+        env:
+          GH_TOKEN: ${{ github.token }}
+        run: |
+          mkdir bundle
+          "$RUNNER_TEMP/venv/bin/python" -I scripts/gen_repo_metrics.py --refresh --no-page \
+            --repo "$GITHUB_REPOSITORY" \
+            --snapshot bundle/metrics-snapshot.json --out bundle/repo-growth.png
+
+      - name: Validate the bundle
+        run: |
+          python3 -I scripts/gen_repo_metrics.py --verify-bundle bundle \
+            --expect-repo "$GITHUB_REPOSITORY" --max-age-hours 1
+
+      - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
+        with:
+          name: growth-chart-bundle
+          path: bundle
+          if-no-files-found: error
+          retention-days: 1
+
+  publish:
+    needs: render
+    if: github.repository == 'ChiefGyk3D/Clouds-Against-Humanity' && github.ref == 'refs/heads/main'
+    runs-on: ubuntu-24.04
+    timeout-minutes: 10
+    permissions:
+      contents: write # the metrics branch only; the script never writes main
+    steps:
+      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+        with:
+          persist-credentials: false
+
+      - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
+        with:
+          name: growth-chart-bundle
+          path: bundle
+
+      - name: Validate again and push to the metrics branch
+        env:
+          GH_TOKEN: ${{ github.token }}
+          METRICS_MAX_AGE_HOURS: "3"
+        run: bash scripts/publish_metrics_branch.sh bundle

+ 5 - 3
README.md

@@ -96,9 +96,9 @@ Working ceiling: $30 per month in the current phase (stage 1), shared by every c
 
 ### Growth
 
-Stars measure attention, not use, but the project is young enough that the curve is worth a look. The chart is drawn locally from GitHub data, and the as-of date is printed in the picture; the [Repository growth](https://github.com/ChiefGyk3D/Clouds-Against-Humanity/wiki/Repository-Growth) page has the numbers as a table.
+Stars measure attention, not use, but the project is young enough that the curve is worth a look. The chart is drawn by a daily workflow from GitHub data (no chart service), and the as-of date is printed in the picture; the [Repository growth](https://github.com/ChiefGyk3D/Clouds-Against-Humanity/wiki/Repository-Growth) page has the numbers as a table.
 
-![Hand-drawn style chart: cumulative stars and forks since the repository was created, and weekly merged pull requests and closed issues](docs/wiki/images/repo-growth.png)
+![Hand-drawn style chart: cumulative stars and forks since the repository was created, and weekly merged pull requests and closed issues](https://raw.githubusercontent.com/ChiefGyk3D/Clouds-Against-Humanity/metrics/repo-growth.png)
 
 ## Layout
 
@@ -120,7 +120,9 @@ Clouds-Against-Humanity/
   scripts/identifier_check.py              fails on cloud account ids in tracked files (never prints them)
   scripts/gen_settings_doc.py              writes docs/wiki/Settings-Reference.md from docs/settings.json (--check fails when stale)
   scripts/gen_project_status.py            writes docs/wiki/Project-Status.md from docs/wiki/.status-snapshot.json (--check fails when stale; --refresh fetches live data with the maintainer login)
-  scripts/gen_repo_metrics.py              draws docs/wiki/images/repo-growth.png and writes docs/wiki/Repository-Growth.md from docs/wiki/.metrics-snapshot.json (--check is offline and needs no plotting library; --refresh fetches per-day counts with gh and needs matplotlib; --repo, --snapshot, --out and --page reuse it for another repository)
+  scripts/gen_repo_metrics.py              draws docs/wiki/images/repo-growth.png and writes docs/wiki/Repository-Growth.md from docs/wiki/.metrics-snapshot.json (--check is offline and needs no plotting library; --refresh fetches per-day counts with gh and needs matplotlib; --verify-bundle checks what the daily workflow publishes; --repo, --snapshot, --out and --page reuse it for another repository)
+  scripts/publish_metrics_branch.sh        the publish half of the daily growth chart: re-verifies the bundle, then force-with-lease pushes it to the orphan `metrics` branch (never to main)
+  scripts/growth-chart-requirements.txt    hash-pinned matplotlib and Pillow for the daily growth chart (pip install --require-hashes)
   scripts/gen_wiki_nav.py                  writes docs/wiki/Contents.md and docs/wiki/_Sidebar.md from docs/wiki/_nav.yaml (--check fails when stale or when a page is missing from the manifest)
   scripts/gen_example_tests.py             writes each live stack's example.tftest.hcl from its terraform.tfvars.example
   scripts/gen_timezones.py                 regenerates modules/twingate-bootstrap/timezones.txt from the local tz database

+ 2 - 2
docs/wiki/Home.md

@@ -122,9 +122,9 @@ Working ceiling: $30 per month in the current phase; every phase has its own cei
 
 ### Growth
 
-![Hand-drawn style chart: cumulative stars and forks since the repository was created, and weekly merged pull requests and closed issues](images/repo-growth.png)
+![Hand-drawn style chart: cumulative stars and forks since the repository was created, and weekly merged pull requests and closed issues](https://raw.githubusercontent.com/ChiefGyk3D/Clouds-Against-Humanity/metrics/repo-growth.png)
 
-*As of 2026-10-23 (UTC), drawn from GitHub data, which drifts. Stars measure attention, not use. The numbers and how to reproduce them are on [Repository growth](Repository-Growth.md).*
+*Redrawn every day from GitHub data, which drifts; the as-of date is printed in the picture. Stars measure attention, not use. The numbers and how to reproduce them are on [Repository growth](Repository-Growth.md).*
 
 ## Where this wiki comes from
 

+ 9 - 1
docs/wiki/Repository-Growth.md

@@ -11,7 +11,9 @@ picture disagree. -->
 
 **Generated at:** 2026-10-23T00:14:32Z (UTC), from `ChiefGyk3D/Clouds-Against-Humanity`, which was created on 2026-10-10 (day 0 on the chart). The numbers come from GitHub and drift: this is a snapshot, not a live counter.
 
-![Hand-drawn style chart: cumulative stars and forks since the repository was created, and weekly merged pull requests and closed issues](images/repo-growth.png)
+![Hand-drawn style chart: cumulative stars and forks since the repository was created, and weekly merged pull requests and closed issues](https://raw.githubusercontent.com/ChiefGyk3D/Clouds-Against-Humanity/metrics/repo-growth.png)
+
+*The picture is redrawn every day by a workflow and shows its own as-of date. The table and totals below are the last committed snapshot, taken 2026-10-23.*
 
 *As of 2026-10-23, 13 days after the repository was created: 465 stars, 21 forks, 165 pull requests merged and 35 issues closed.*
 
@@ -35,6 +37,12 @@ This table is the text version of the picture, one row per week (UTC, Monday to
 
 Totals: 465 stars, 21 forks, 165 merged pull requests, 35 closed issues.
 
+## How the daily picture is published, and the risk that remains
+
+A workflow draws the picture every day and pushes it to an orphan branch named `metrics`, never to `main`. One job (read-only) fetches counts and draws; a second job validates the result again and pushes it. The second job needs `contents: write`, and GitHub cannot limit the built-in token to one branch, so that token is **repository-wide**. The workflow narrows what it does with it: the job holds no other secret and runs only the checked-in publish script, which refuses to write any ref but `refs/heads/metrics`, passes the token to the git commands that talk to GitHub and nowhere else, and never writes it to disk. That is a limit on this script, not access control.
+
+The control that holds is a repository ruleset: restrict creation and updates of the `metrics` branch to the GitHub Actions app, block deletion and keep `main` protected as it is (pull request, status checks, no force push). Without that ruleset, anything that can run code in the publish job could write any branch.
+
 ## Reproduce it
 
 Run these from a login that can read the repository. They show the same data without the script:

+ 134 - 4
scripts/gen_repo_metrics.py

@@ -3,8 +3,9 @@
 
 The chart is a hand-drawn-style PNG (matplotlib's xkcd mode): cumulative stars
 and forks since the repository was created, and weekly merged pull requests and
-closed issues underneath. It is made locally and committed as a local picture,
-never hotlinked from a chart service, so a reader's address is not sent anywhere.
+closed issues underneath. It is drawn by this script and served from this
+repository's own `metrics` branch (refreshed daily by .github/workflows/growth-chart.yml),
+never hotlinked from a chart service, so a reader's address goes to GitHub only.
 
 Parts, kept apart on purpose (the same shape as gen_project_status.py):
 
@@ -29,7 +30,14 @@ edit of the numbers is caught) and `png_sha256` of the picture drawn from them (
 a missing, stale or hand-edited picture is caught). --check recomputes both
 offline, the way docs/diagrams.json records a source hash next to each picture.
 
+The daily workflow runs --refresh into a bundle (snapshot + picture, nothing else),
+then --verify-bundle DIR re-checks it offline before anything is published: exact file
+set, regular files only, size caps, a real PNG, matching hashes, only per-day counts,
+the expected repository, and a time stamp that is neither stale nor from the future.
+
 Usage (from anywhere inside a clone):
+  python3 -I scripts/gen_repo_metrics.py --verify-bundle DIR --expect-repo OWNER/NAME
+                                                      [--max-age-hours N] [--print-as-of]
   python3 -I scripts/gen_repo_metrics.py --check      offline; exit 1 when stale
   python3 -I scripts/gen_repo_metrics.py              re-draw from the snapshot
                                                       (needs matplotlib)
@@ -80,6 +88,18 @@ SNAPSHOT = Path("docs") / "wiki" / ".metrics-snapshot.json"
 PNG = Path("docs") / "wiki" / "images" / "repo-growth.png"
 PAGE = Path("docs") / "wiki" / "Repository-Growth.md"
 
+# The daily workflow (.github/workflows/growth-chart.yml) publishes a fresh picture to
+# an orphan branch; the pages show that one. The committed picture stays as the
+# hash-checked fallback that --check compares against the committed snapshot.
+DEFAULT_IMAGE_URL = f"https://raw.githubusercontent.com/{DEFAULT_REPO}/metrics/repo-growth.png"
+
+# A bundle is what the render job hands to the publish job: exactly these two files.
+BUNDLE_SNAPSHOT = "metrics-snapshot.json"
+BUNDLE_PNG = "repo-growth.png"
+MAX_SNAPSHOT_BYTES = 256 * 1024
+MAX_PNG_BYTES = 1024 * 1024
+MAX_DAY_COUNT = 1_000_000  # one day of stars, forks, pull requests or issues
+
 SERIES = ("stars", "forks", "merged_prs", "closed_issues")
 TRAFFIC_KINDS = ("views", "clones")
 DATA_KEYS = ("schema", "repo", "created_on", "fetched_at", *SERIES, "traffic")
@@ -185,7 +205,7 @@ def md_table(headers: list[str], rows: list[list[str]]) -> list[str]:
     return ["| " + " | ".join(headers) + " |", "|" + "---|" * len(headers), *("| " + " | ".join(r) + " |" for r in rows), ""]
 
 
-def render_page(snapshot: dict, image: str = "images/repo-growth.png") -> str:
+def render_page(snapshot: dict, image: str = DEFAULT_IMAGE_URL) -> str:
     """The Markdown page for a snapshot. Pure: the same snapshot always gives the same page."""
     repo, created, fetched = snapshot["repo"], snapshot["created_on"], snapshot["fetched_at"]
     start, end = span(snapshot)
@@ -207,6 +227,8 @@ def render_page(snapshot: dict, image: str = "images/repo-growth.png") -> str:
         "",
         f"![{ALT_TEXT}]({image})",
         "",
+        f"*The picture is redrawn every day by a workflow and shows its own as-of date. The table and totals below are the last committed snapshot, taken {fetched[:10]}.*",
+        "",
         f"*As of {fetched[:10]}, {age} days after the repository was created: {t['stars']} stars, {t['forks']} forks, {t['merged_prs']} pull requests merged and {t['closed_issues']} issues closed.*",
         "",
         "## How to read it honestly",
@@ -235,6 +257,12 @@ def render_page(snapshot: dict, image: str = "images/repo-growth.png") -> str:
                 rows.append([kind, str(len(days)), min(days), max(days), str(sum(d["count"] for d in days.values()))])
         out += md_table(["Kind", "Days kept", "First day", "Last day", "Sum of daily counts"], rows)
     out += [
+        "## How the daily picture is published, and the risk that remains",
+        "",
+        "A workflow draws the picture every day and pushes it to an orphan branch named `metrics`, never to `main`. One job (read-only) fetches counts and draws; a second job validates the result again and pushes it. The second job needs `contents: write`, and GitHub cannot limit the built-in token to one branch, so that token is **repository-wide**. The workflow narrows what it does with it: the job holds no other secret and runs only the checked-in publish script, which refuses to write any ref but `refs/heads/metrics`, passes the token to the git commands that talk to GitHub and nowhere else, and never writes it to disk. That is a limit on this script, not access control.",
+        "",
+        "The control that holds is a repository ruleset: restrict creation and updates of the `metrics` branch to the GitHub Actions app, block deletion and keep `main` protected as it is (pull request, status checks, no force push). Without that ruleset, anything that can run code in the publish job could write any branch.",
+        "",
         "## Reproduce it",
         "",
         "Run these from a login that can read the repository. They show the same data without the script:",
@@ -520,6 +548,80 @@ def check_files(snapshot_path: Path, png_path: Path, page_path: Path | None, ima
     return []
 
 
+def _no_duplicate_keys(pairs: list[tuple[str, object]]) -> dict:
+    out: dict = {}
+    for key, value in pairs:
+        if key in out:
+            raise ValueError(f"duplicate key {key!r}")
+        out[key] = value
+    return out
+
+
+def _refuse_constant(name: str) -> object:
+    raise ValueError(f"{name} is not valid JSON")
+
+
+def verify_bundle(
+    bundle: Path,
+    expect_repo: str | None = None,
+    max_age_hours: float | None = None,
+    now: datetime.datetime | None = None,
+) -> list[str]:
+    """Problems with a render-job bundle, offline. Treats every byte of it as untrusted.
+
+    The bundle is a directory holding exactly the snapshot and the picture, both
+    regular files under a size cap. The snapshot goes through the same validation as
+    the committed one, plus bounds on counts, the expected repository and a fresh
+    time stamp. Needs neither a token nor matplotlib.
+    """
+    now = now or datetime.datetime.now(datetime.UTC)
+    if bundle.is_symlink() or not bundle.is_dir():
+        return [f"{bundle} is not a directory"]
+    expected = {BUNDLE_SNAPSHOT: MAX_SNAPSHOT_BYTES, BUNDLE_PNG: MAX_PNG_BYTES}
+    names = sorted(entry.name for entry in bundle.iterdir())
+    extra = [n for n in names if n not in expected]
+    if extra:
+        return [f"unexpected entries in the bundle: {extra}"]
+    problems = []
+    for name, cap in expected.items():
+        path = bundle / name
+        try:
+            info = path.lstat()
+        except OSError:
+            problems.append(f"{name} is missing")
+            continue
+        if not stat.S_ISREG(info.st_mode):
+            problems.append(f"{name} is not a regular file")
+        elif info.st_size > cap:
+            problems.append(f"{name} is larger than {cap} bytes")
+        elif info.st_size == 0:
+            problems.append(f"{name} is empty")
+    if problems:
+        return problems
+    try:
+        snap = json.loads((bundle / BUNDLE_SNAPSHOT).read_bytes().decode("utf-8"), object_pairs_hook=_no_duplicate_keys, parse_constant=_refuse_constant)
+    except RecursionError:
+        return [f"{BUNDLE_SNAPSHOT} is nested too deeply"]
+    except (ValueError, OSError) as exc:  # includes UnicodeDecodeError and JSONDecodeError
+        return [f"{BUNDLE_SNAPSHOT} is not valid JSON: {exc}"]
+    problems = validate_snapshot(snap)
+    if problems:
+        return [f"{BUNDLE_SNAPSHOT}: {p}" for p in problems]
+    if expect_repo is not None and snap["repo"] != expect_repo:
+        return [f"{BUNDLE_SNAPSHOT}: repo is {snap['repo']}, expected {expect_repo}"]
+    for key in SERIES:
+        if any(v > MAX_DAY_COUNT for v in snap[key].values()):
+            problems.append(f"{key} has a count that is too large for one day")
+    if problems:
+        return problems
+    stamp = datetime.datetime.strptime(snap["fetched_at"], "%Y-%m-%dT%H:%M:%SZ").replace(tzinfo=datetime.UTC)
+    if stamp > now + datetime.timedelta(minutes=10):
+        return [f"{BUNDLE_SNAPSHOT}: fetched_at is in the future"]
+    if max_age_hours is not None and now - stamp > datetime.timedelta(hours=max_age_hours):
+        return [f"{BUNDLE_SNAPSHOT}: fetched_at is more than {max_age_hours:g} hours old"]
+    return check_files(bundle / BUNDLE_SNAPSHOT, bundle / BUNDLE_PNG, None, "")
+
+
 def write_all(snap: dict, snapshot_path: Path, png_path: Path, page_path: Path | None, image_ref: str) -> None:
     """Write picture, snapshot and page as one unit: all of them change, or none does.
 
@@ -578,13 +680,41 @@ def main(argv: list[str] | None = None) -> int:
     parser.add_argument("--out", default=str(PNG), help="picture path, relative to --root")
     parser.add_argument("--page", default=str(PAGE), help="Markdown page path, relative to --root")
     parser.add_argument("--no-page", action="store_true", help="write and check no Markdown page")
+    parser.add_argument("--image-url", default=None, help="image reference written into the page (default: the metrics branch URL for this repository's own page, else a relative path)")
+    mode.add_argument("--verify-bundle", metavar="DIR", help="offline: validate a render-job bundle (snapshot + picture) before publishing it")
+    parser.add_argument("--expect-repo", default=None, help="with --verify-bundle: the owner/name the snapshot must be for")
+    parser.add_argument("--max-age-hours", type=float, default=None, help="with --verify-bundle: fail when fetched_at is older than this (0 or less: no limit)")
+    parser.add_argument("--print-as-of", action="store_true", help="with --verify-bundle: print fetched_at when the bundle is valid")
     args = parser.parse_args(argv)
     if args.traffic and not args.refresh:
         parser.error("--traffic needs --refresh")
+    if (args.expect_repo or args.print_as_of or args.max_age_hours is not None) and not args.verify_bundle:
+        parser.error("--expect-repo, --max-age-hours and --print-as-of need --verify-bundle")
+    if args.verify_bundle:
+        bundle = Path(args.verify_bundle)
+        limit = args.max_age_hours if args.max_age_hours and args.max_age_hours > 0 else None
+        problems = verify_bundle(bundle, args.expect_repo, limit)
+        for p in problems:
+            print(f"gen_repo_metrics: {p}", file=sys.stderr)
+        if problems:
+            return 1
+        if args.print_as_of:
+            print(json.loads((bundle / BUNDLE_SNAPSHOT).read_text(encoding="utf-8"))["fetched_at"])
+        else:
+            print(f"gen_repo_metrics: bundle {bundle} is valid")
+        return 0
     root = Path(args.root)
     snapshot_path, png_path = root / args.snapshot, root / args.out
     page_path = None if args.no_page else root / args.page
-    image_ref = Path(os.path.relpath(png_path, page_path.parent)).as_posix() if page_path else ""
+    own_page = args.repo == DEFAULT_REPO and args.page == str(PAGE) and args.out == str(PNG)
+    if not page_path:
+        image_ref = ""
+    elif args.image_url:
+        image_ref = args.image_url
+    elif own_page:
+        image_ref = DEFAULT_IMAGE_URL
+    else:
+        image_ref = Path(os.path.relpath(png_path, page_path.parent)).as_posix()
 
     if args.check:
         problems = check_files(snapshot_path, png_path, page_path, image_ref)

+ 519 - 0
scripts/growth-chart-requirements.txt

@@ -0,0 +1,519 @@
+# Plotting dependencies for the daily growth chart (.github/workflows/growth-chart.yml).
+# Installed with: pip install --require-hashes --no-deps -r scripts/growth-chart-requirements.txt
+# Every package and every wheel is pinned by SHA-256, so a changed or hijacked release fails the install.
+# Regenerate (then review the diff) with pip-tools:
+#   printf 'matplotlib\npillow\n' > req.in
+#   pip-compile --generate-hashes --allow-unsafe --strip-extras -o scripts/growth-chart-requirements.txt req.in
+# The hashes cover every published wheel of each pinned version, including CPython 3.12 on Linux x86-64
+# (the runner's python3); that was checked with pip download --require-hashes --python-version 3.12.
+contourpy==1.4.0 \
+    --hash=sha256:018227e134b73090b06f911e773a526c77c9af426be29065500ce096a5accd4c \
+    --hash=sha256:072a702e2e178f4fcf96f04775d0c059e4c917925abf0d3208ebb6865df3c23d \
+    --hash=sha256:0c7a4c2716a4e98342221954416a836cca77c996c14ddbf22b5f01d5d93ca09c \
+    --hash=sha256:107ec46f7aa1664266d69b1181aadc953d58d39f7d8d648fa5b795d4a060b0de \
+    --hash=sha256:181bea01bc742734ae672fa00c717d855dd35e1f029536406538c52e7b0cd73d \
+    --hash=sha256:186ba929df36d61b6127da2e89cd1357e4cb79aca647381ab1a6feb0b152877b \
+    --hash=sha256:196759a3e4db60e1546167e361090ebb6d199aa3aafc9e34ea17a5ac3b23e814 \
+    --hash=sha256:20156f5a1ac4f8ce02656e39a61e82164a3d359796dc8026f75b062783d500e1 \
+    --hash=sha256:20da2f86bfaed60dbba729fe738c8241b1dd22b6cf7e8cbbf30df290bd04ba28 \
+    --hash=sha256:2deb580178ca19437a84bd77e4bc2cd91a8ccad212413a83c273900868b5978c \
+    --hash=sha256:2e741a39dfc96babe1722561e81351aeec104526c57dbe91c167c1db606c2d55 \
+    --hash=sha256:3863ef2e2b13fe93f8c0ebb08ee400cb07153b8b0e91c5acb26e4537f283634f \
+    --hash=sha256:3e0a2392533e5e2abdf277c951047516acc8d2f3c42b2dd9dc34c907c9ebabf2 \
+    --hash=sha256:404dbcd9233513dfd1323b66ea593fef90e899f658f6b8a9ed8e93bd0ca669db \
+    --hash=sha256:417be048f7e122cefbe2a34c51a1f2b0410f8eb35796f794d45475ddb7872d9d \
+    --hash=sha256:423bd5f4b3f11d54a8c597234e513382e3454bb106b8ec7ae32ba4ed63f8d99b \
+    --hash=sha256:432e89f835cf01f8d2123a130a3126b17ee6e0348e4d62c0973872b30aa873bf \
+    --hash=sha256:43c3ccbb32c6294b183dcc8e8c46dacf5ecef809497e3d48a5be298eef185ad0 \
+    --hash=sha256:43d80072a32299bf945de0a6dd4e034ea0162e832261de2e07a274a5adbba9c9 \
+    --hash=sha256:4bffcb2e8cc5c0e837631acab59dd04265fdac376550e7c3e310523877c68cb7 \
+    --hash=sha256:510f7d93d94cf6ebf4e2cd0640bea16ab8affac7547230175b6745b596ce0599 \
+    --hash=sha256:5450f091ac1be0be3ad3a2a3b3f23b5e443e78c670ced4fd347d626f92a28fd2 \
+    --hash=sha256:5545ff38229c15d11d822fc6f7415b932da9f4975f53e305b7b96ebfb01f889c \
+    --hash=sha256:5a4c89c7f38a0d7a94356d74e3391073c4325c4d47ad2fd065c3fe7dbae16c0c \
+    --hash=sha256:61624f6722480aa7e168fd746164e7bfdf48f8ccb6542f1613741200dc37e2b1 \
+    --hash=sha256:618137ec5778fb76d494c9ec854b104a377fddba0d128bef7136cce2c3bf0df8 \
+    --hash=sha256:630d32f06cedf37b7f1dd2b6a12e4492826bd477a4c9c7b2e2fee6ce3a2cea76 \
+    --hash=sha256:64039341e2d8804f1a13bda8c69083eab935167bbd7e856cf096241f17d5bd45 \
+    --hash=sha256:6507a016976a75a15aee47809a34605de6244ccc056e6164bf9fb14b27eecad4 \
+    --hash=sha256:6ced1670fafee703b8277ab1645072a226e74f167166eae146fb743916119b67 \
+    --hash=sha256:6e697d94e69f499ff6bebb899cae97a58d5d14f0e1fe9568b43a0248d2f9af8c \
+    --hash=sha256:6f963ea9f0d68d2b6a02d861e3c0aae09ae25ba21f243fcf281e9fed468b078d \
+    --hash=sha256:738c44fa71735a617f36da58e32810512407d283d5d1bb5b1cecb00d7eeba7cf \
+    --hash=sha256:758e7496cec3195fc28a28945eab3ceef348c47fb95c7afc2eca2f3901209c8c \
+    --hash=sha256:78ed5c5f962b3e156109f0531b174a65ba80d13cc681a70227b12524c162e184 \
+    --hash=sha256:79b06c60d5e569ce12c5da8f0c51217cdc484386e2349fa717c30fafb56d2871 \
+    --hash=sha256:7f861af508fca2384eef392bc1d8377cfa349b2b854cb11b45d89c75780e2561 \
+    --hash=sha256:80c7fc8e7ac217777ce7ba2db3cf8478652b5a4b335283111012ff9eaac9d842 \
+    --hash=sha256:86d05cec773c9507a3950122e0e40ce77c23c75ceeb2fc189514e71893cbb34b \
+    --hash=sha256:875f42444c9cf48d56f724f2637e60d0f73b3b12c9041e1484580a233edf9591 \
+    --hash=sha256:90feb8da006803a95ba573fddc9536357d0c3faddc3a4c9e22816ca49af52878 \
+    --hash=sha256:912c6afaa106e2f74ba22b30416b77ef7eb94e3bdc5a4df51ab147845dba9b6d \
+    --hash=sha256:96019f059bcb3774acc0104be3360a57b36d33eaaa2e1d7f77c800ca8e07618b \
+    --hash=sha256:9c0e07c691f3b3321913ed9b8161c50ea5f77fadd006f52f5e755359b0dcbfc5 \
+    --hash=sha256:a03b32c2e7eda8b17757c022162c13c86f5c3d6f937dddf9ba3c3ff7b513953b \
+    --hash=sha256:a1c8a74744fa746eeaa12f0f9ed7f8b4add9d8f1b14d95e3b5e133675eac888f \
+    --hash=sha256:a3e67bc1a6a4618a1dac7c3053a9ffece5ddfa2046b2670b342cf430bb0b87d1 \
+    --hash=sha256:a58b5f130afec61a093d743cdda435cc4047748b6791627e34a68f41ec3a9b07 \
+    --hash=sha256:a5e2bb871b90cd7a52bdee63bf80ef7acb46398d27efc66d7679240016efc5aa \
+    --hash=sha256:abd0f7e51ecc52bf8c95713bd80b1c17c516a71fa391c54475308a4377903c2b \
+    --hash=sha256:b7794ea07cab575633daad8d6e963b662053391022294d3aacc1d9ba9ef54114 \
+    --hash=sha256:b9dc493e7924e5aa32d89d0b8e50986280f3d4b284968a792787bd7bcffd3cad \
+    --hash=sha256:be85d160e7c795113c2a93254dde2fc7e86b375322570eee78b420969426973c \
+    --hash=sha256:bee6ff96653e0807cd0f8eaef00174a031e3a2effa5c20f49a5a8d574b05af23 \
+    --hash=sha256:c76f3a5318164db7d9401132fc1b5364b784c613c93fa506e3b5e6d1bf353ec8 \
+    --hash=sha256:c8be3392b84cf43373a488874dc1ebf46f60784a70977f92586e18019d71c7ed \
+    --hash=sha256:c927ec747633e68c9920bcaad48b0bcefe648812b822f18c34e2d0e2270a3d2a \
+    --hash=sha256:cc87f2ffa84a49a77d76cb792f28a48ff3b05a222aa0b2bddbd839ba78e1d5ca \
+    --hash=sha256:dd59df9e2fb0aff8bd7fd1adb9f349b7c835245a9d0f18c2f2deeb537190f2b1 \
+    --hash=sha256:ddf5a2596d716fd3793434844caf31abc7a40b1e8718431420c89858268fb909 \
+    --hash=sha256:de503609fdb71f597634ca64fb4bd2f13d27c97f140e912b1e8ed93544840df0 \
+    --hash=sha256:e21d1d4a9db5b3a793649c7ab0ddb4697f2818929eec871a7b9c45fce7b2a1ea \
+    --hash=sha256:e439ab450c93455feb0218532ded3e946ec7a9b5f459069f122cfa44b89229f6 \
+    --hash=sha256:ea09dc704029930cbd097f75cb0cc1db9852adbcf1a151fac7e9559f7bcbfd19 \
+    --hash=sha256:ef47fef9a912c77e3d84b014f701e5a9340f25703e9ed3bcebe37f91fb69dc49 \
+    --hash=sha256:ef9440f6f8506246269a82734f5ff9e2e4c5e775b3996fc883cc491c5257eca6 \
+    --hash=sha256:f1219a8898523cba821085f2da8a1b962cc696325763f09d7f93538ba43b2d70 \
+    --hash=sha256:f863c6100bf926cf47d13f3cd75f9bb8ebd98aaab230eeb4468b91f98f39a6b3 \
+    --hash=sha256:fa1b787362a3856e63dd2b89449f6c384d55ee1beb8f94f4bcc871b40f02462c \
+    --hash=sha256:fc9feef8f1f001c5b87decadc67c4a5d1eebb62ca39c4763d1237ff62cf2b707
+    # via matplotlib
+cycler==0.12.1 \
+    --hash=sha256:85cef7cff222d8644161529808465972e51340599459b8ac3ccbac5a854e0d30 \
+    --hash=sha256:88bb128f02ba341da8ef447245a9e138fae777f6a23943da4540077d3601eb1c
+    # via matplotlib
+fonttools==4.67.0 \
+    --hash=sha256:0781fe22583529e1e98bb8a3a33040632e202a4c427ed7e65412c41a21b8ebcb \
+    --hash=sha256:07a2f36b3263faadf5b7b548f62fd3cac401e490189c82b16f7139ac0df91cd4 \
+    --hash=sha256:13d7507252c5a5d7941a5fa1be27d335c378ef07983ea2bb24988bf600eadd5e \
+    --hash=sha256:1671e5f368b0c136ed9fb62fef26c7e425b4ebb0bb669a1cb7ba453f5bba580b \
+    --hash=sha256:1be99c1f07fca59510d657ef3eae584b5273fa4e203aff2383b3520744e19536 \
+    --hash=sha256:1f200cd2cf046a5a0b03babe84ebf8bbc12187d5d57f50bc03f24be89e7c1605 \
+    --hash=sha256:2a09d33a9264a6b29efca9dc633b53969aaedb250a9c8521d60f51280cef65ca \
+    --hash=sha256:2bfab2f5d1d255dec82f4bd082a1c10e77df808e42210890f50a9c30bf91570e \
+    --hash=sha256:33ae23a531795864fcdbbab91a40c824976e22642c05efca3bd8a0b00630d0e7 \
+    --hash=sha256:36f0fee56227b909c9d1392f17b23803616f1f04efbe020c176d9945cabc0be5 \
+    --hash=sha256:38fc772182ebff3e2ebba7886460476eb65842b601ca0b9221a6a5826136396e \
+    --hash=sha256:3a19f6d5e1a373f2e4a5bdb9452c8ba212dd9f1e43df2fff042b896e28084e4a \
+    --hash=sha256:3b34324deb3e09ad648039a0a86d945b83f23a44fe3da74a84e6ada71fe0b650 \
+    --hash=sha256:3cb57e6600ca77c0b1729cf8adc23bc0652633a37f18cfa934d9c7bc3de25519 \
+    --hash=sha256:3fb95166eaebad72f9deb1d0d781f652525f47e4693e553dad3954cf68ed6e9c \
+    --hash=sha256:4304f03ed7f4ba000a8dcc941ad854bfa52e2f3b6112b8f099b6f431cf98e701 \
+    --hash=sha256:451077d2fc61a2a03f5dca54d84fbb01051ad781f48ea137eff35c775a4cb025 \
+    --hash=sha256:47dba566b4f475b0fb5f83129487c21b6a6a4edc41c0eec52524f969a68a3d45 \
+    --hash=sha256:48696b630069e29b8aa5ea8b034e4f651a2e112073938ec16bd536dadde1debf \
+    --hash=sha256:4e2c1586b5b6588a47d02e2588170eefdc996b708f2659c44dbe169bd6fcacb5 \
+    --hash=sha256:50c41e30aa2e0130b80d1a58ac0f3ea7c02a854a70dbea1ff8d88e0ce524806f \
+    --hash=sha256:5377e0e991e3e2be47fd1215414b20c2288b546e5a8c6d80b1a7cde9c72a89e1 \
+    --hash=sha256:592d8f72024dea0408739a92599e4f839b960e1e887b25adc76dc87271fdac76 \
+    --hash=sha256:59f44309ce78851c9621ee88e3f667ca3fbcc89dc0e8641336be3f12ba06bfd4 \
+    --hash=sha256:5ad690ea5bfd8913d1a6e5d5e9825ccf4ed342716e63c2b0d7f490d50235daef \
+    --hash=sha256:5ccaa87b312219d02cf72a79f1eb2f3ce028882d6fd1b79336141005db83b84e \
+    --hash=sha256:621b3152b5d0412381b792bacfe410ac1f09c2c4f28a44bd19d26fe7160cfc96 \
+    --hash=sha256:64e56d0d6a39780fee86955c758674538387b18f911ea904a4aae8f8e30fa26f \
+    --hash=sha256:690ab72d338aa9bf8e5cd9aefb86e0d3c458d8b9de4df041fb7dc2ed4703144e \
+    --hash=sha256:6c19a770a8d273371a37969003c143eaa629ab893c3db028af8b91d04c6f9a6d \
+    --hash=sha256:720bcf27727193b0fe1883c2e036dc88e37047916e977f5c3daf6ee4316e9656 \
+    --hash=sha256:72d6d316dffc92eadb771f697f289ea7b60f689580931328905a267bd170f93b \
+    --hash=sha256:7343cd0ef70edf8be7f4913cb9b55b992fb4e04055b47dcfecddcc2eb045a9d2 \
+    --hash=sha256:768a33bbe6ec5ba8f19979f938752f06d4e614cb554fd47abd7830f2007660e3 \
+    --hash=sha256:775364ac079e2ea7a2eedb5f9172c57b059d638ff79e2bf8d4257e5805713f32 \
+    --hash=sha256:77e0d4096a2ac60aebe43928b5382766df2d148577db8e8ff79b6a50879a6c06 \
+    --hash=sha256:8239e2ca24878715a19f061d065b5721e87da81d145e48b3418f771a469b5a24 \
+    --hash=sha256:846982e89b1861d6c9d7fcd6567aec3fa5a10ad313e7f2076045fcd339cfbd8e \
+    --hash=sha256:84a3aed005de106fb1794372dace82eca50859d52ae26da4bb6c602480a41250 \
+    --hash=sha256:89ad62d116f45bb45873bb92fd69c14a720ba591cba488044731954a5565e194 \
+    --hash=sha256:8c21073cfe7129aaa070d94f575c1e2a880ae4aae1dcffd5352f174b96d27d16 \
+    --hash=sha256:8c58a8a9ad447bead6f91e5f50b23c0e4988538cdbd9bf2f68952b39f5900a84 \
+    --hash=sha256:916836845e4b1c1447bb61390ffb3cb5f2940fd9f5d6de4685539a81806c7764 \
+    --hash=sha256:952eb091689545d86d16e40f719ed7bb086dd810a07dcc9ea2ca0a81004810a3 \
+    --hash=sha256:9c38fece8156cbda31b42d49c4a187858056a35932b88233b6fb31eaca5cf67f \
+    --hash=sha256:ad813967410ba6d24a52850df59b164ee17883f17b96a91b4b0ac6e9d7b5a118 \
+    --hash=sha256:ad8b4f7c754a627e91908fa1a1ccc90b489cd2810c0ba16acd26ea2ff5273db7 \
+    --hash=sha256:b274ed3106b8086f237b7dbb1529c28142ba10ae40b9d285be0ae6a44b2946d0 \
+    --hash=sha256:b3ddf350e74508102b33dc6b32984b6dd751359a7c57732bcd39f9d7cb37d71e \
+    --hash=sha256:bd3239e5709fd4c3343db67245ede46aece610d7f7ef61afb174718122479282 \
+    --hash=sha256:e0ca4c8438dd6320f5850c9bbee3b3980455ee3bac602a9a0299caf9e799a0e8 \
+    --hash=sha256:e2b5d511ea012dce7bd6df12b279b7d7a5b01b019865717d03ae679f4b944fa5 \
+    --hash=sha256:e8a8545cbd58bd29494ffe81e3cb35f8a29332a8e495c42bec334145ce8cd65b \
+    --hash=sha256:eb3c98cac93aac4b9f6e3ce2008325340b234cc9b0338ca6b513f31962a1e278 \
+    --hash=sha256:f672398385849ff79e7dd50c0a06efe110c8ba23d8890f9b45fbb922bc2f55f6 \
+    --hash=sha256:fc6b6b03aa44f504c8734e62ccc3e4dcda9f4b8213a85aa80742e4d1cc9d96ef \
+    --hash=sha256:fcb9743140419410161acfe7ec205fb0a8a703acfccb85b586becb5a97c047c9 \
+    --hash=sha256:fd79e36c2968e9fc3e1b082f2ba7dc63ae88a161a3d8ceaa0746b906455f3617
+    # via matplotlib
+kiwisolver==1.5.1 \
+    --hash=sha256:007a5553dfc4f4e8d184f588a0200e2cd4b63a59cc8796df3c39909e679dc7a0 \
+    --hash=sha256:0324cd2567259b7a095f6cf18a52b0ffc6f3de9e69528ff1bc0e7a37bd43ff1a \
+    --hash=sha256:0627b9bceb9c3cdcf12b8a18655eedfed2692b038df27423383c120d0b7dc2d6 \
+    --hash=sha256:06a6917674de9e0fe3f66f5430787f59a9f2ddb64af9b714eaec547e29ef5c19 \
+    --hash=sha256:072bdb15a3c19a5b5dbc8f8fb1f4e1884bf4f3507eeb4cc6334401274d37a5c0 \
+    --hash=sha256:0a4faea5c6db201c6a21391d2ac926ea97acf7dacdbc3c417189e1adb1a00837 \
+    --hash=sha256:0ba9527afc80ae3d7814ed98b6572d02bf85eaf48065678342c5f0c6dab7a8c7 \
+    --hash=sha256:0d8924877ce22e17326a99a418c3c82037da078df3c6a260b13eca677444e6e7 \
+    --hash=sha256:0ebdef3eae5336568147c39a55be6a2036ffde53faa9ca2d978989ae7c2da12c \
+    --hash=sha256:1209042a623ddfda5497e4066c7b77651dde8e1d3a9dd97599dc7e97f3b9b78c \
+    --hash=sha256:16895f553ee6620a827d2da56b871f835fb70b9216cca5d188e885caf6e3bd23 \
+    --hash=sha256:17851e5dad4484be0cbccbde3b15331deae036de9aebd45eed964487802b172f \
+    --hash=sha256:1798e83840c3f627246104c4d8a9639c60fa068adf9ce92b61791781fa8a68c1 \
+    --hash=sha256:18170a77ddfecf40ec60d0928268dc95880c881864e015a8f34094ed18b9b9ad \
+    --hash=sha256:186884a58486651e3c217b6acea0a53eaa9498fdd472057c46f2f0fb5c25aad5 \
+    --hash=sha256:18a0cfb124546a4c2e6087c5f3029c7f44b37c85b142e0ced71f73a7599ac208 \
+    --hash=sha256:1983f0974a750a6f6556f368ba11105d1d8369c735b944747c9f12ae5aea7aae \
+    --hash=sha256:1a7587dc335f2c0f5bd577fd0540bd16c66006bdb60f759a1059f025e6c4f071 \
+    --hash=sha256:1acc7e5b7ef05e9da8bb70cd6c7c4513090213d2e1ad9720f599f0bf6c52aec5 \
+    --hash=sha256:1d852545c4d0e35a72728d072cbaa59e2fa7dd84bdf01e068d670dd0ceb58eb6 \
+    --hash=sha256:1ed0f5e49d0ceff8b72190824d9e59c062fbbc02c231b853112c78474b3f5ec2 \
+    --hash=sha256:1fff05e239575b1481b6ed1a782f6fad616efbf1f0b1f44e6e85c4dfe426e483 \
+    --hash=sha256:21e46b23a2da695c364124817bc01d970effd5483147f8d66a6a7167e3f6b851 \
+    --hash=sha256:22d5e5aaad6be121f2515765e3b1c444352cb8eb4c86510801db8f2e50757316 \
+    --hash=sha256:2551cf9917af48ee7c4b29cc82320489508cf96fd26a51f6fc124de661cd44c7 \
+    --hash=sha256:255605693a483db7bd5c79f60437f7bf658f7f520d61aa42722e32257c941951 \
+    --hash=sha256:26e8268480be5061d509e29669d59103c067a26377a56491630ece11762e3858 \
+    --hash=sha256:27add358abe374ebaa3b8763ef380bc99051b5a4b18d94878366a9e4f59efef0 \
+    --hash=sha256:2ae70bc59790d2af72a3f76f24b272403e135070340281108b447cb77ea70819 \
+    --hash=sha256:2e10ae1bba1899188b33557c10d73affcc12033edd18adddb57d209039976a4c \
+    --hash=sha256:3221f78211074f561c44ca42eac0619828171bec15a2c4cf6f7747d07df76e8e \
+    --hash=sha256:34633ecf50d16187ab8e5528b7a2530f2feb4e23f300db4672538b51cfc5cd38 \
+    --hash=sha256:34ec467940442c9943016fb2d4c81d1ba84351eeca2f1a78f8bc87f1ba0d414c \
+    --hash=sha256:37f801b5d7cc0e5a548921308e059fd2b057bb42972b591cfa3049f95423c4ed \
+    --hash=sha256:38f6e0deb4d0a4615efe0c4efc5990b06ae450ab50a0b321c0b078b6d238c083 \
+    --hash=sha256:3c24cd69455e1b00ddf770c13b6e2c33e07d6dc3f2d34add0bf9277c5c6bbd46 \
+    --hash=sha256:3cc210010fd2f438a3ed430b45f1b501fd13a8618bf984dc2c5ce5b69b78752e \
+    --hash=sha256:3fa5855898f6d3d01b72ccd48a2d65cbdee301251603fefe34e2025bddba219c \
+    --hash=sha256:416ba7ff9f233b7036689bb5a3783537e838ad483f63558d2a800f75afe738b1 \
+    --hash=sha256:431dc224a1a92a5c8f582d96e505196a3b5997a7271076678da2dfde67b77e9a \
+    --hash=sha256:43844c1a7ad6d723d5b5b4c4fc7f5bd399c40e288120d16257c7c9e8765c6e85 \
+    --hash=sha256:44b8faef94f1857e77fa0238f3390ff1ac51d2ea20a487e2e452a59fd2b5f5ca \
+    --hash=sha256:470d420f98d368d6f010633a20659b544c5fdfa5329e6b70219f2ef08fd4a7ef \
+    --hash=sha256:482676e5bd48d70ac99d9fc78863469845421e01184fa83f1f9366dc49f7e974 \
+    --hash=sha256:4d4ca09bf13cff792b1884f64b98ee6c2467930d632233be25c56b442d99f10e \
+    --hash=sha256:5025e36fb4fb275cef0a4e30dbb11cb4ae61d1c83deb90189cb5d7e4cafd6b55 \
+    --hash=sha256:509735237ae0d849e8a843551d423d2500d2e0a9ac1611a145658b29c0fb9f85 \
+    --hash=sha256:534f02c1abb31ed6dbd3515545285c330b2f12d00fdb1fdb71658b9ca5a13a6a \
+    --hash=sha256:5978c3340f16a35c30f8ab2fa7bcf559973c55f1a5ef6970e1f621acf3c4db13 \
+    --hash=sha256:5b973887ff782cfd6b67c9904ad8ca542e0bc5e4961503408b423b5a688b4d38 \
+    --hash=sha256:5c490db2168a508088f59140dd392556a54b8bd1048fc6383c8baff13c359673 \
+    --hash=sha256:5d142e352eb13facc7dd047489aebdff6ba78576c239f1ea04931979caaf0567 \
+    --hash=sha256:5daa1f19e097050b9c4d9a78fcc9263cb96c9dfae08037ddc1b7c4ad1889f2a2 \
+    --hash=sha256:61e9a64c7635095a6bfe483e2ff055d437c59bd45f3617a228b37277f0185d62 \
+    --hash=sha256:63fb7294b768f444eb4b068965f2662f28c2fd4161e23bd60fcf3ff27b74c046 \
+    --hash=sha256:685929988b208a911f1285e2f8ed54210b0d681a3dc0f03e00d599d291986e7e \
+    --hash=sha256:6a797a1cefc8b9c93170db580337e1fe3d011ad18b1299943231279406342048 \
+    --hash=sha256:6b92f60017dda7d877fdc546438b5e28f31c523264f49cf5a48c1d0ce1a0dfbc \
+    --hash=sha256:70ed9a45c7484d2b30cdacf60d220f494a1763b9fec1ad03285c6553fa0889f2 \
+    --hash=sha256:719a35fa1156db3640555f95ebb94f60a444e64d1c69626b0edef5df78eba225 \
+    --hash=sha256:74ad5c3dad54a4641b4c28cd15ded70899d04459c6c7aeacafea716be97cce6d \
+    --hash=sha256:74ea337e0ec3f6f342a36a4f1b5cd94dd9affddcd28ba9aae2905af932ee8c6b \
+    --hash=sha256:75d9b1cf8258462dbdc1eeda718c96ea7f079324c09067f6daabfcf37712b7fe \
+    --hash=sha256:77a4c8187a5948d7f8795adb765a3c7b553d07d86d88e43038fc32fc1fb9a3f3 \
+    --hash=sha256:7824b5e8bdbf0bccb4ccd37bbb115849a1dc45437fb4de8351385ed07c437ee0 \
+    --hash=sha256:7d38b0c279c3032e8c9cc013b405c6df8e1668dbf15465779aa7f15f61201812 \
+    --hash=sha256:7e9c01d3dd7ceba4d1d436cc021d40d592466e40b9bc7f5d83dc4e98a5c9cd8c \
+    --hash=sha256:7fd82debf43c6acd0a94359d232f6bb516ee13f269a7993736a9ac9f988bb5d9 \
+    --hash=sha256:824c3d763a05ea9e9003610145186b0e9848c7584a5575c79bac5a8e7cd80bad \
+    --hash=sha256:828f75af2b0080c8a972e75f649ab46af008e92c6104a57a759157200b835b75 \
+    --hash=sha256:83f78128fa28705fa85d01c59771c72fe81c11bd0e6155edbb9f818983a7d761 \
+    --hash=sha256:876bbfd276473d3daffe30e8c975df4ed9429967b41a6cb362dbb5155b6f13ad \
+    --hash=sha256:886fc26012f0e8b5f69d1cfe6d711f6b11f194621539bf8e6bb1c25c5dc82724 \
+    --hash=sha256:8a34616dc2521cc8dc1d7d081734da63539f021ac0450ce950908340c6e7aa2f \
+    --hash=sha256:8a708a47ade1fe19e8371d5da076bac0dd4b0a5a7985ad6c637f7f7e361b6baa \
+    --hash=sha256:8af9b142ad719ae3a911ebf616bc4b78b32bbab84d6a40d3ad2f129670509957 \
+    --hash=sha256:8bf4df63592c2a66b4f8edc5df2544998c288aa02f96ce0acd880cd1de8c8127 \
+    --hash=sha256:8de6f2a4ce7e7bd27d23dd94abf0ccafe0e0e5cc9c764b0577191f2c25f08f26 \
+    --hash=sha256:8f8fddb8e323bd6eee4e54e69a39243beab22689070f4c66b472c4cc88bb89d8 \
+    --hash=sha256:8fca690b00c4c48f6c2a547b0160ed511357093a4e4c9b47e0fadf3128066d89 \
+    --hash=sha256:9506e892bcc3b409831d363c6f53e5985e1c8d1f6f6b0256d00358684ff85378 \
+    --hash=sha256:958254518717542d02d0688d0d20cbf771da5e415e6f49543f92481c850a4540 \
+    --hash=sha256:95a02752aa032eef4aed01cda6d9b687c669bd0396bf4519eef8bba22a286720 \
+    --hash=sha256:96c30002424670b5e1e46495c2b8cbffef39cf77c1d79e76462029d50339785b \
+    --hash=sha256:98b208a7cc42c803445ef551d6753cc42a5ea13e9cab1ee66cd8b9cb70195330 \
+    --hash=sha256:9b3092d8992a1d69b7a59c3e39f35e1b9be327a17f68a7c35fc17329e337d6f2 \
+    --hash=sha256:9e51c119992ea8820706871c30a4642ec76de20ae82f9b50b9a45517d8e9f810 \
+    --hash=sha256:a5716a33bfabb2c6ce27b6cf03253467b3804f83e215f4d202685cf93c6c9874 \
+    --hash=sha256:a5a00665d1a0e26763a7338d7e911d4598fbc1d50dd0d6b7919b7dc6c5d6569f \
+    --hash=sha256:a5ca5aebae78a0bc13c1943af4af615d4966c5b650b05d5aa83b50e427196fee \
+    --hash=sha256:a7b85b2cc6ea45e5f7e8c9a30bc9fabd47cda09106cbb4b967335c3e6c43b69d \
+    --hash=sha256:a83ee7107df13abe42a54a6654670eef9bb39425cf2e27f65e0007465e1286ab \
+    --hash=sha256:aa7d00b1700966d2917e54d278aba86897890ca9276dd8b76cf6446b6c181b92 \
+    --hash=sha256:ab620eb663952455271ac37f9aaad86b73c969c02f11f53cea405b38e96a4300 \
+    --hash=sha256:ad8b9671348d7c8716715652ae11f85ed0eb99e265a2df2ca490577d69860b2c \
+    --hash=sha256:aefe930d113798330e9462f7874542977869c0613cba3262e2de3a8d5dee8f3a \
+    --hash=sha256:b03af77d77e50edba2030fd5f7c352ff209314b09030a3cba7c14edf9a09a444 \
+    --hash=sha256:b390aec180a7c054919c04898835e1c77bced23ea8383eb2c570213bf25d1a86 \
+    --hash=sha256:b3d78f7bb2b9d9a30345be1474b9aaa8685430b54afb51ba3639b5c6c11e9ed6 \
+    --hash=sha256:b5664603a253efd3a75716d793d1d3a6a82723b61dc6db767b2460bbbeec4c0f \
+    --hash=sha256:b69602970994a2ed8bbfa78c2f0394a7435226c6040489702d9f0a0ad0c07052 \
+    --hash=sha256:b6ae6a0328f0bc035741820fdeecdcd67bf4694eee03972e843663107122f450 \
+    --hash=sha256:bad20d4c69c851c982a1e3606f4c293edfd5a87885786c50082412240c4b1ffd \
+    --hash=sha256:bb7c99f0673c03017a3ee01e54a5c2617a05468b11eabe513b0080e063ed95b1 \
+    --hash=sha256:bebb89489b279b2f5661bbbb2abcc87bcd4a46607bb4a5c966f04f1db6b8df9a \
+    --hash=sha256:bfd1de989b3330420e29de39352f5c049905c9e3ee67233a50d550e3d652c148 \
+    --hash=sha256:c2306e8bb53601979fcb3fa09cc65e031876d9ae01eff2fcbcd7a84ef94d5bc1 \
+    --hash=sha256:c3a4e41e3096bf1f0f1b76e2ffd6d828d6547f574f702d59bdbef7acfa59db9c \
+    --hash=sha256:c6834b92dd2428e2dd85ef3d85f723d3c12f20aaf43a2ddd4f944ca25d833408 \
+    --hash=sha256:c90d3022d8a94778939cda8638c6c8da8fa757b8958dad7ec868ce29c87681b8 \
+    --hash=sha256:ca307d6c259e5c98d3cb9ade55342b47a6839762caf2536f3d7b46ee660cc82e \
+    --hash=sha256:ca7f6fe0f37ca978a1e5eb7a3a68e6413f417e78e838324947ffd420202b198b \
+    --hash=sha256:cb6fae641357ed2f6e533c0d3c6504a4a5703621a50c89459e46051d56b61140 \
+    --hash=sha256:cdaeeb6c350106df6bf9d873395973e5f066a9713200b72cd64f55d0a3eafab6 \
+    --hash=sha256:cea20da04494e662b83c872683bf4ff2345206043d036315ed0e924b652e7294 \
+    --hash=sha256:cea90547bfd93807e0013a004dc76552be44fad3bc1cc2b38610a9e889ed098f \
+    --hash=sha256:d09037ca068d784ebc4aec290ef952ca27ac15dd9c0b5801a88c6e1096b83e6b \
+    --hash=sha256:d27c2123977cb9269c30a49ba45f03a4323017ef693e19db4ec9dbe1299a3002 \
+    --hash=sha256:d50de98e8d807dc31822fff96f50293163a62418eb65487a21b42713d72ed0b7 \
+    --hash=sha256:d66a64dd5dec136040ec2ae94aa026a912ee60fdd45bc28d3db30037fd809e88 \
+    --hash=sha256:d79308fa689fac89cbcfbd4dbfc80b5f95c54c5a7fd4d194be221f9d33d026e6 \
+    --hash=sha256:da3275833be0edbaf4830fae08bae3dc7219f40ce0c37eaa6c25825957e06612 \
+    --hash=sha256:dc1a26b8e53395a01c2c611e58602fa47461f136fba7cd5542e6db6d64be1839 \
+    --hash=sha256:dc23390afe9f4ef9ac3bcc72a03a56eebbde03f4c571a32cb38f859cff9a6524 \
+    --hash=sha256:e05c2f7925f1d88778e53cb44f14e0223204a3bdd09a41664750363acfb1f2ef \
+    --hash=sha256:e12dfea7f5fc2a34a9080efbf79c4c44eb380ec5b9c6fea09407e08f0d1e941d \
+    --hash=sha256:e4e4523d6f336708d732516e6cfca7796cf3d96c9474eb5aecf6165f2f1fefc3 \
+    --hash=sha256:e4e49f7e1a4e7191bdf9dc67a974db714501b1fc52c24324103d06a86abd5c08 \
+    --hash=sha256:e68e151428b5384f766cd25739bf77c7e4a3dc93b5ded7a12118d9fbfdf78ab6 \
+    --hash=sha256:e8e4d953faaded9ec7ede36824e9814082d22d4c7b1eafbfa079ecba8cd0d076 \
+    --hash=sha256:ee9df1f0d77b9c6e94f4ac0fec533fbddd5ea3a327807f18d7b069ae019ded80 \
+    --hash=sha256:f0a887b6565bbfe80efde2b7f6e8890d7d9bbdb11bdb17028a3690c32fe0621f \
+    --hash=sha256:f0f4a42db92d6ec7677ab9d12830a2a8ec145a9c6d15db2b593466bc875c78d7 \
+    --hash=sha256:f1303ef2eec81262a4b708c3e858afe58d7c75ad91c1c05266eda7673369859a \
+    --hash=sha256:f1d56ec54d257d05e0b50f5780d967540cd07beeaf9e5f645b26d50cce79f4d8 \
+    --hash=sha256:f4167e87b397f273dc2356fcf1eaf50a6bac51e6105f45103ef7129c8efb0255 \
+    --hash=sha256:f76fc85bd054c806960f917ec0f329e24e436f1712267d90588e4c39890caa63 \
+    --hash=sha256:f942903fde7363d1d879057ec5de01310efda2597161784d752fa9953a01a71a \
+    --hash=sha256:f9b1c4900736e489a812c529100de4b8fb617d4db075e931e213c57424b83d9b \
+    --hash=sha256:fc271a6f0a2126958f4090e5507b9da5848927dae331f8f763bd4aa642b3d2cd \
+    --hash=sha256:febcce10f2bcdbb80b4ea919238a6a4ac13dbc4c7cadbe8d5d75c3682f8b5404
+    # via matplotlib
+matplotlib==3.11.2 \
+    --hash=sha256:01dc8eaaab5a9fce9ff615eca82345728f289e4715b186ee10c6d85272fc26bb \
+    --hash=sha256:02329432ae5c6af87cf208ee575b701d698bdf0b1a3bb28cc6d53c36e967e575 \
+    --hash=sha256:07d9b9fa60cd4c393692f50d0bb03123242ddf61c99bb0e95e75feb354e7c1a8 \
+    --hash=sha256:116cdb0eb0eb5644fc98eb2975d4b4dd4ad35e5c8e6b851c22e6976f371f7ab5 \
+    --hash=sha256:1944895967f87c84c9b4bad29a707b31f5b36df4a3a2339ea1f8ea3ce5105539 \
+    --hash=sha256:1a3040b209f3968b4e84161df7b174f07a9fad33b0f2d7e48ea3bbd3075e2863 \
+    --hash=sha256:1b9a7ad579856284135e401ecc918c5f8a017ee30539298862a109f51b971710 \
+    --hash=sha256:254d4ddb2fa8df3b4c689c0c306063aee10521df82cfb438185e499c75fe37c1 \
+    --hash=sha256:2a8285cea8ef4d92aa041d1c33788bcae82248503300f93f1ca2136b9049452f \
+    --hash=sha256:30ec15d7eefee71de16b7c689b42ba49715a4644650b76a6c7c70d79daf24e91 \
+    --hash=sha256:399fef672f7046ef7d6a57572b2a6f9845f3f5afcff04e7b2df7a363a9f42190 \
+    --hash=sha256:3aa4b8516fd26659e4363abbf317c703d9116496c5db2e9d0609a2866dd39dd2 \
+    --hash=sha256:3da3bc0cbf7245e7db72cc6d29d12c5abef72cb73059c73b945f14e3545f3eb2 \
+    --hash=sha256:3e8576f7c47e02fd4f21f44171302d2d1d58d4471d46da3d71fe8899d19539d9 \
+    --hash=sha256:57b9ea60a835937c2012861923cbb91f47db8565775d326d1c42fc926aa10351 \
+    --hash=sha256:5e1e923a3fc3326b99ec0a6ff1ab1338ac6c6cc62ad9d8a9c944197c7f8c6221 \
+    --hash=sha256:643ff850d8e0f5b8319337f87ed3cb59506afb3df3cc48de777d85871233be7b \
+    --hash=sha256:75b6d88402770e181b5d06a67dda4129c31da7d05004d63a21c310ec78d1b83c \
+    --hash=sha256:79a258f58253dfa025af80a9e9bb228d75fced007f0e93ae7423fefbde81a74d \
+    --hash=sha256:7d43ff8cebb50840648cb6429b2228621dbd709010f3117b3740abb20abf21c0 \
+    --hash=sha256:7e5a90f8a707ebb6004a713b1cff091a40cc5df4c7c1cb165e5a505ebc11c292 \
+    --hash=sha256:7ef7a53b66780e5d942923724f08577fbc5be1f7322da0f0f3f9dcaa45dd803d \
+    --hash=sha256:854df8d7dfe9fdffcbaa6f39e44a6c24b409cb4d7561fbc09213b157d833f6a6 \
+    --hash=sha256:894a9cbbecbe30ae6787d464df2e8fc7a8d475cfc68f87c3029f7c11152899b3 \
+    --hash=sha256:8c8255de28f986d935a64c9ca71c0ec2d2f41d355691f5ea684725dc91413f71 \
+    --hash=sha256:930efb28f59fda124e39265d177bab302625297bb147d2910de725a2fc2aef54 \
+    --hash=sha256:a24d5fd36e4f0e742c3851dcd20810e56a95633a342e4bf6cb591c678e8fe61f \
+    --hash=sha256:a6939df7567114b6bac7f4c5e06c84a67f197c1b2f2e4b234d4eecb3bfec9482 \
+    --hash=sha256:a8756cc73d9af9a7fe0deb54ea2e75ef73b01d9e575877e72acad5458e660943 \
+    --hash=sha256:af2661f6ac6bbd1d081996f54fdd9385715c625ace8cec0869055c0cfbf38981 \
+    --hash=sha256:bbf1062991d826ed27e2144f3afa4461afbb8ff56e8f703043e191a8163b1ee9 \
+    --hash=sha256:bc067c462a86f0e57bf52fc6e058d90171a5420007dac00c46e90153050c69a7 \
+    --hash=sha256:bf3fe71fbfb8ec0e310e0bc8537c3405a01f38f25f9394ed2135e6202fed542b \
+    --hash=sha256:c0b83f044ce10a98027b105b3931548719a6e8c7ef986b4362651e0b5367c8dc \
+    --hash=sha256:c27e577ece613ea12a0790e00b4eb80d901c59a3e16cad474f31d8b1529690b9 \
+    --hash=sha256:c5c1c68ee401fc98271263410f0e5ce88285abacf7627132914e8adf3d70ff43 \
+    --hash=sha256:c9721f81275499da1feeb36a2cf8192ea086283b3bd16b7dc4c9d7aedb7396d6 \
+    --hash=sha256:cc82dde2a0d3e3ad472edce04897ad7146b8d8bfd1df8a32992eebb81af18fdc \
+    --hash=sha256:cec596316640f2b394b8f0daa0ea61a8eae82d017b620b9f202befb972a59ea4 \
+    --hash=sha256:cf41ecd1b0c0b6f7177ed965a54c2afbe888715c7cf6054dc12d53bc1494002c \
+    --hash=sha256:d3304eb5a59442a8867f6920d484591c0fa09ffc29e9260be2feec3351e25869 \
+    --hash=sha256:d480038c83691532ed52ff3147db51fa902fc78cb2d8349993a1cdb684435bff \
+    --hash=sha256:df4f7784aca81a94f254c0a2767d592ee25f407e488f5fa7203e51093fb6ca27 \
+    --hash=sha256:e43b188f0a5b75447bcc197728258166aa64365770ed1caa36595a5e1ca4bbba \
+    --hash=sha256:e60cf3047a51edecdc4535a9196bbd6a732936b8e9f8184aabf4d16165884aaf \
+    --hash=sha256:eac4b07d4e3743b172451e122ea964f72f152879d4f9adcf3f3d33e518f12ead \
+    --hash=sha256:eb3712dc9b464793de0a4e42a7313d50293c751f94bddaf7332a1bc71bccdda9 \
+    --hash=sha256:ecea603dd2fbf8242fd31a305a8b12a4ece2de28096870c65fdd0d1e35b8d9a6 \
+    --hash=sha256:ef31985c4dedb5f1424e1aec6849a47dd37689cb7fa3c20b1b82187f26806261 \
+    --hash=sha256:ef752769cd962f39ea0b6ffc82d1ea43a0012c5a6157c7a075212fa509cfcff2 \
+    --hash=sha256:f25446b2981717dca9786bac841cb3fd7efb568e3e3c755dd980481c5cb9228d \
+    --hash=sha256:f2ac30cf5eb5dff1b584627ae0b0e1186551a4f69ae3c75073911da497a29170 \
+    --hash=sha256:fea03cf56568cc1cba08b470be6a0559e71c3a5b688d54b7179bb35ba23d0821
+    # via -r req.in
+numpy==2.5.4 \
+    --hash=sha256:067374eb538c34c745436365cf7b0112595c1d326f21ce4ff340f61230239fbb \
+    --hash=sha256:0b4724a19de67bea8cfc4970798efa78bcbbe2ac2613cfac16721a42d44de2a5 \
+    --hash=sha256:0f02a46e49cfb6c73bdb7aea1c0d3461dbae9aba613542b65f657cd3d17b9fab \
+    --hash=sha256:1c2e71b04c6cad90026e544501bbe0ab9290fa8a4d845e7e8c0d124fb429c988 \
+    --hash=sha256:1ef3aa6d7e29bb13677323114280b05acc57607fa2300e66432d665d5418a162 \
+    --hash=sha256:2132418bf8dd124a427ca9e6a1daf9ee1a87185344c95119ceae868b99466da1 \
+    --hash=sha256:2199ed071f460487c8db2c0e5c0b564494190edb4772fe80f9aad88b2604def5 \
+    --hash=sha256:2377da2dd3ba2c1200956acbab2a358c83b8e1f8531191672d1cd6ad83250d53 \
+    --hash=sha256:298eca75243f2cbbfdb460560b9fb2a1792a33cf2ab4286efd43d92e8d3df508 \
+    --hash=sha256:2c2c4afffdeb7920e445028dd71eb932cac3e704792e964bc2a232426d4f1255 \
+    --hash=sha256:2ca144f15135b6212a5c47b1e2aeca6e412f102f95a2d5d88d8aec77eb255de3 \
+    --hash=sha256:2fa3328f784fc8277fc48026f6cad516f5c561c5d8e2e39b3c9e0c8f23223b34 \
+    --hash=sha256:325518d4245b9e331387702aa58c2ce1dc4cdcbb41dfb4ccd5dcbc7e08db1266 \
+    --hash=sha256:332f3378fe077dd850e677ec01bdcc4f22368fb5d50ef10b2c79230b1bf5a592 \
+    --hash=sha256:3573cd22564692a5b899ec344e5d5b9cc4576f2985b96f22af3564ed54f2710f \
+    --hash=sha256:381a7a3d2e65e64c0ec302795ab9dc12bb1e73f150904699c153716177eebdaf \
+    --hash=sha256:38f47be9f74ab870d2633b5456ae519c43758a8d1fd05342f0ce4ecc034396ee \
+    --hash=sha256:4054173604cd8658796053f1f3bc0befb68ec1c0762c57fdad61e199256a8617 \
+    --hash=sha256:468397ba3c64427474706e5c9123fe266395496714dc684294eac75cd4930d1e \
+    --hash=sha256:4e263278bfb5ee6409db8aedbc4cc32973b1b82bc1e8d3c668551d04d83a7e37 \
+    --hash=sha256:5258bc06526964be5face2fc6f756857a3f24f21ec3e72ca131337a75b165d6c \
+    --hash=sha256:56733449d2544178beaa4545cee357370440cf056c197f9c7bfb19dbfdd0e86d \
+    --hash=sha256:5ec3753760c1a6d8bb91200666e545c3a9728e6269dfb5d6ce02340996698aa3 \
+    --hash=sha256:5fbf7141bbfd63aea22f435c9062a032b9ea0082fe9845dad7f021d3f1234e71 \
+    --hash=sha256:64d1c8ac28a4077cf987e0a71a7a0ef7e2df70722f07f0baa42dbb7eb6938647 \
+    --hash=sha256:64f9c9878c1938476365e11ccfb6b770f3b9e5f045ccddc514235041e6959365 \
+    --hash=sha256:6c109eac9cd439193678f69d70733c1108487546ca8eafc107b510ae10c1aecd \
+    --hash=sha256:6d6a71b9d9a97c03633aa12565ef2825ffa036cc1d99cfd50dacf0f128af4fe2 \
+    --hash=sha256:6ffa07666f8da0eef81d149934a626d0d95fbd6838432a33e66245423a9062c0 \
+    --hash=sha256:7415db95818b39ec475a5eea54d9e3b6bc83e3912158e46da3438cdce399804d \
+    --hash=sha256:77045a4b175bbf5316ec08003880804336c78f92281a1b72222b274ea85ec5ac \
+    --hash=sha256:7a14a461d9340f1b46b8648578aed9cdb8b3b018a8fac6c1dde2c9192a01a87f \
+    --hash=sha256:80d6ef6e8620eb2c2b4c4caad50b5935d6db3cde2d51581b55dcc79e14016d1d \
+    --hash=sha256:81e3420b27048b65eb14c3acf0c174a8cb0e023277716110347d2dcb26026dad \
+    --hash=sha256:823874a507a84af050493b622affde94b6f7c3a0dc22cb2801381bc03b871c00 \
+    --hash=sha256:8b4d2fd2d34e5f8c9235ee787de5631a37a28402b15cb80814df973d2be54129 \
+    --hash=sha256:8dddfbee2e68d26d0d7d7d9cb247b1fd4409241cce32d815a11d97ec2cfde179 \
+    --hash=sha256:950ea81d57ef070665581b6e1b5f6a029306423cd1739c5b95fe78aa30db6b9d \
+    --hash=sha256:956555e0603a4d38019ae6925711cb9dc43195c076a928accf7ea5d50bddfe53 \
+    --hash=sha256:98b053943e5a0474ec0da309d2cb9d3f18ea57f8a2067c2ab7b5f763d1068380 \
+    --hash=sha256:9968ab7e49b93ac6e1c3b2239732183152c9150f16308d30b66a372cffe3483c \
+    --hash=sha256:9a94cf751c9ad8ebaa835bcd3d40dacf8534ad086b88c38029b65123c7999d2a \
+    --hash=sha256:9cb18a327b49c5c337f972b03682f6a49855525faaf3c0d3e9c96cd0fd8880a8 \
+    --hash=sha256:a7b1b6353e36a7e50de2973a38d705c88ee93adcf120673cee7f45a4a3fa223a \
+    --hash=sha256:a813ed7719bf45463c51779e6a98d0385fe905e48447526938a4b8337333d551 \
+    --hash=sha256:aa1cce2ff3f8d953de38b76bf44602caeb69f101430208f64a10067f7cb4b1d3 \
+    --hash=sha256:ad62a416ddcf863bf44bba76fbf6b53366ab0692e294f51cae4b5fbe0d246788 \
+    --hash=sha256:aec3fc4b32ff82421274f5d205c559c51c840c8df66a78efd7f3612dd005a26a \
+    --hash=sha256:b1185012870173de7ae33d370bd45b1cf5baee747ea4b97036b65f4e93016877 \
+    --hash=sha256:b11e8fda06a7d69f15ebf542660b74466c2e51094800c1fb794f47ad4faeef17 \
+    --hash=sha256:b64a85f40e154983960a4167d4c1d57a50c7f109b3d3264a3a984154e90a8454 \
+    --hash=sha256:b86966fbe4ad7de710422175572bcdc75fdedadfb54bc6fab7deabccddd7780b \
+    --hash=sha256:b89d0aaae2fe498c648f4c4795c084db535af5bd98ef942b2a3681fb74ce8645 \
+    --hash=sha256:bc39ac66a7a9a3fbd6134fda43136b60ffde99c8f4501e64e0d2b24da137babf \
+    --hash=sha256:c05ede731b03fb1b7591faca9389ade3267d2bddf1ad8882bb3f2cc5e101694f \
+    --hash=sha256:c6342f54c67093cae5c0227eb0eb772fdb79f2a2c37a6eb278b9909ee06aa356 \
+    --hash=sha256:c668b2f0d651605b58892644b0e302c7157f7159544227758c896982ef384b18 \
+    --hash=sha256:c9b80cdf5cedba0e90d93fa5f9a333c4d65bd545cd669b71bb97ce2b703c9d73 \
+    --hash=sha256:cfd73180400042a7c532d30c5e287bdd03c59ff9ee1b4c0316af0539e29dfe23 \
+    --hash=sha256:d4cccbbc78717966f764cd3af4fb70276fa01fc7a2688af11c78901fa5c04f05 \
+    --hash=sha256:d549420b8858885cea8838a727842249218b9c1da24dd517e25c9c7a948310a3 \
+    --hash=sha256:d8200f16437b289a5bb927c6e184eccc3e8389bc0070fea4cd5b9e13c1757959 \
+    --hash=sha256:e94aef2c639da4a960ad0db8e06471208d8589974953d78b61d345b4eb99e394 \
+    --hash=sha256:fbde6962867ee75b48b0ee29b2b9372ec5d617799dbaf38e82dc0596f2f7738a \
+    --hash=sha256:fe4d21ab149f15e4e6043dfb0de87e6e5f34ac176cde83060e9802981fca2ac2 \
+    --hash=sha256:ffa6ce09a1c6a08e9667dd9c97aa0b14184e8d18f2a14b78b2a2328c9147f076
+    # via
+    #   contourpy
+    #   matplotlib
+packaging==26.3 \
+    --hash=sha256:94edc256424af38762eb31306eed28beb9f0efc50a8837492c9d6fd6004aed79 \
+    --hash=sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c
+    # via matplotlib
+pillow==13.0.0 \
+    --hash=sha256:02464da86f561f410e13b061ec37c3068a9cb557a095494157742d07b3c24a27 \
+    --hash=sha256:04a63720f79e22fd54d897c233a68314c50ca0603360f54ce2bd5db8f0f43782 \
+    --hash=sha256:05cd2cd39055d0b9650060e4513ef4a9a0aea870083950bd046a0d6490f93a22 \
+    --hash=sha256:06903aac074d00c988e77a1fc435286dc498506d4ca8d6f69df9babddf4ecc15 \
+    --hash=sha256:08b826a9bf1265c76de04a42061d61ea6b109418b7826f28ff1ecdfaa26c5502 \
+    --hash=sha256:0d1a9cf7bc6917538b20f8d06b9ab2147e542f68849e96fc58eb66bdf6acc692 \
+    --hash=sha256:10b5019883c98f1dd819ca48ffc6f33a91cee04948fe637c605f4345c7cafd6f \
+    --hash=sha256:12b0fa15879fe5a9d9eebe66e4e2d74128a773b1a4448010c9c714f45e04b9d8 \
+    --hash=sha256:12fbb851cf323cc19aac3eea1df5ad17b57e91e9fe3cfd06100dba7bb8208c13 \
+    --hash=sha256:149a1c323ba366f90b48e6f1a6db6582eb50512df374588de56fc909abc0f0f3 \
+    --hash=sha256:19b66ca0a4d25cc0200b381ce824c7ea090db61427315e73cfb05dbf1b35c369 \
+    --hash=sha256:1c774b9c0ba0d0b356f71530677b39028878a2cae5a93e0a13779cfd17120f88 \
+    --hash=sha256:20722cd5375533ad754053363a80b8fb30c79d37930a6f7228030e237ce3bd5d \
+    --hash=sha256:20822140c9a2ba9c5e42df342b0a892ab2e102fc0e3db967a133bb9ce3f898bb \
+    --hash=sha256:21c32061a5512dc13f87cc7303e120e4d77c2f70df89a35af0e3ce246e5ac57f \
+    --hash=sha256:2310e2adfc13c6d457d7d0f2ffdd5c56a74a317650cf765887df8d515a647ac0 \
+    --hash=sha256:23edf4ec4b6f4f240e8df6e4985e9ee2ced86474632433e55fb1e2548744bf40 \
+    --hash=sha256:2d50500a4a3bc6469adcdb319cf05d688b08ca3bf0f22a05339f3b25b433a599 \
+    --hash=sha256:2e31c4e68cffd7b1f116127626813b82fcba19edf6b940a7b0c266d6484d0055 \
+    --hash=sha256:34fb3db1149c879343861831728c243c432d4a5afc8f1878ca7612ef8de2a033 \
+    --hash=sha256:37290fbef0c73e2d51d594eb78fded7dc7170d1c3ad0a890269e6fd8c8c4e061 \
+    --hash=sha256:405be6058e206a86fedce2f715ecc2343f94072d7925251632dffa2c05f70dca \
+    --hash=sha256:40a266371ece581e5de13b6635ef78d7487824af80561b6ca27694a88c19bc0f \
+    --hash=sha256:42d63be3af4f9b951b199b0a9d23365d37ab14687e6d77b74940432c8515c4ca \
+    --hash=sha256:44629d4498c9cb6b2051806155f22141df0d8a929c56134b166655232dfb2f8c \
+    --hash=sha256:49c12af515073e9bf511e4ef736743bf70d531a643668722279314b937742ba4 \
+    --hash=sha256:4a25756244bdcce3b50580baadf320fa48297f0eeb8e114ba64139a40d4d0fc8 \
+    --hash=sha256:4bd024d567eca931b668978d672dba914d4b8e2628e2c3073a2ad178de8a2620 \
+    --hash=sha256:4f8db54177035a2b5f717f94475b74907e12a96dc74f6d487f3966b0a4694071 \
+    --hash=sha256:51ebb529fc5e8abdd55302f6c3f8943037348ec2384329a3e55677f69ae2fdfc \
+    --hash=sha256:567f20f1c75897d7663830da6ea8af719e03d712b1d9ee7f813319f9ece42e5a \
+    --hash=sha256:5933fcea5a5ba64c686f55c886a115cbfd92f2900460784a1e79909fdbafd7b6 \
+    --hash=sha256:5bdb38ba220b61b4ec31dd1046dea6b016d3c6850a23f43ed8b58332b2fc668e \
+    --hash=sha256:5f56499c1a74d2b862beb0c33b8016f99d095858455df9d21583bbbc1c15b582 \
+    --hash=sha256:67871a13cf47275201553b536c025da777f997fa562a19eb798af4ad4b97c18f \
+    --hash=sha256:67c8d44ad89fa7eb88de5d6ef6199b1e03dd24974f85a67639fc8badb801fe79 \
+    --hash=sha256:6a0920cb55df5a4d3f6862964908078c0bd59332bdd1bcd20d14e8c70ef27cc5 \
+    --hash=sha256:6bce6a29c3898191f4c9998e4d4e8f69790caeabde46e54da4bc235ce5bde683 \
+    --hash=sha256:6f38f3f885a09cafc93fd667b1173a92f379e43785d635e7983c893f0da319fb \
+    --hash=sha256:73ee25cf8cf8b75d5a5aeed7cb6588f5e5dbfbb0fde51707b630bbb23897645c \
+    --hash=sha256:7b999816b5850a35ada08443e6e03945f1f6488144a83afe2d37b240a552aafa \
+    --hash=sha256:7c88c10dd432f3b39ccdafc9ed81d0c21b8fd634502574da76d1bfa4fe2c76d0 \
+    --hash=sha256:7d5e097eabd5d4915c27ac9f6e9325bb1e01a7c94d7348b5c4451d3fc30e8521 \
+    --hash=sha256:7e91e97a929232cdb828889ee6ad0e48d7f40f4ec38818f4e4a8968b2b1af22e \
+    --hash=sha256:7f6299e494e46253d40c34653cac369412f44ca53b5f85d848d3f95b1ed0546c \
+    --hash=sha256:816752a5ef76a80484c8c441c85593b7ea9304f6231fc5776ad1fbff7e773058 \
+    --hash=sha256:83b37abd87b590acd8f47ca8a61f70893322b11834d36e07c2298dacad4d14d2 \
+    --hash=sha256:8619685cad8efc4c38c66d3b36aad854523297c43d748b3b6f0cc03c90ba3463 \
+    --hash=sha256:8bf295fe459343bc6093c8e5e0df60bfa189e0fcb775a22e2c2488fdeccc6c0d \
+    --hash=sha256:8e459b613cf31f8980f584387b4fe47bf08e076e288d61aa8eba1f7fd4ddbb81 \
+    --hash=sha256:8f36aa77f74b14a2103622b196402c71330e4e7cf4122ee45c854e9a01e0eecf \
+    --hash=sha256:93ff9c9c3663ce23aaa5d0b6b6abac55359e2a0c06c7e30f3771829af816be63 \
+    --hash=sha256:9a635068d9793c7f0d929f39f18b58f1bd86c236e8e7b64167b86af9232ebca0 \
+    --hash=sha256:9dda0788a9932776a75d8bcc020076edc308ce2508b51f6739a45e3158b3fc42 \
+    --hash=sha256:a192360d512305fe92d3053e4f7627bbad1f7708f1f4ad38cccd9336acabe9ad \
+    --hash=sha256:a2a14cd73d5e6c927f644b0110ee81f59c4ef506259ec9183904747f2caacc81 \
+    --hash=sha256:a625df9a2a5597fa5e5266e01aefc82604bb85d291e3547981e863560d75da6c \
+    --hash=sha256:a6aaa7871aebca081eb5c45f83e845bbd9712ae99fa9286dbfdcee835e63f4b4 \
+    --hash=sha256:aa694c49787040943570d61c9b8fc01271bd2a2cfdd55f0d896f8aecdce1a981 \
+    --hash=sha256:adb3c2124c68e480f4632d06cb7caa3b48a51678475f483b4edb1c6dee29ea43 \
+    --hash=sha256:b84be41387fc00db28c13c02e30d42b02d8d8f6a4a741a1aee6012ca7f1f6039 \
+    --hash=sha256:bf97ba1b5542050e9b0c74e632323b6d8136cc99d64e193abebee22fe6013c76 \
+    --hash=sha256:c3bc8ee0271387e0b1e3ad0ff893645990a656e79bf9c42f4f734a3642b11d51 \
+    --hash=sha256:c50c80e3591e5cf9a8dfa6007d4f10732f02e32263850999286e56ccd650cfb2 \
+    --hash=sha256:c6fd031333dedcad7ce3e03d244093f43504f209e86925ebdb2b868fa4037630 \
+    --hash=sha256:c87a04e7f152ee4db5dbe15f0bfa3fe628a1aeedbe66b81c43b87f52c813f9ac \
+    --hash=sha256:cdcd1ba258178f7356d74170c9a81ba4eab6a5d55748bc402a5a2a6fe6be3510 \
+    --hash=sha256:d4737f50d23ddd11d6685faacbb9252887dde0bc7997127757247983d74399d6 \
+    --hash=sha256:d7710eb676e9bb68965cb045be0d333b4c0d7f9dfbaa7fbf121385b1588683d3 \
+    --hash=sha256:d9b0a2bee3f3e03e9f29057aedb807dbf1e1d96ee1b9d0f422d9db6c8583271d \
+    --hash=sha256:e65dd6e75de67b2362a4fa3e16aa627595f65054dc4ec73d64680c84d592fa61 \
+    --hash=sha256:e892354a424b1e82a78ba16785822bdd40de06f19446a3d4a28047df1a4f8932 \
+    --hash=sha256:e8ca8f69b7c77fa96dad99f8638c1fc4f1c0bed4acaa1baf7a3c31bdb80a0ab1 \
+    --hash=sha256:e91c2b1cbeae768c98752e67e717e283d68dae45717b41f2d91eaee648e37b7d \
+    --hash=sha256:e98b4f91f99b24b1da72e10621ba181f7281922384a7403094debb4199de6c00 \
+    --hash=sha256:ef5fe6b7db3f501c56000ba8fe7c7e1a35ca1d45824fbeb95a67daa85cff4dbe \
+    --hash=sha256:f11a3c1358bb3c68012a7b1f41b223c3db9f7bfde90b481df028cfe1c3363313 \
+    --hash=sha256:f391dc92a015c478745192fe4f2e120c2af2aba18d9fe0616341cbf537599806 \
+    --hash=sha256:f7cbb7a64e7ec664775195e4f81923bc8a93d9451b963f844e59118f63147a7a \
+    --hash=sha256:f9bd7d260d986f3553518c5d723544346fa48031f8aef3265d786aeb59845bc0 \
+    --hash=sha256:fc481f742ccda20e9ed760b8f978dff50f2a4e9bc253ac167fb0a05b0783ef52 \
+    --hash=sha256:ff3fe9eb621fbb9db4c4be33ab946f6bac5f98ab50ca8d3260503653656c961b \
+    --hash=sha256:ffea6b2986a797c84b6d1d27d4f43e0b83c73fc16281a930891cd237cf0d08fe
+    # via
+    #   -r req.in
+    #   matplotlib
+pyparsing==3.3.3 \
+    --hash=sha256:928ae7e20211f3b6f3915a72f06a0cfd29ab9d24279dd6346b6b1a7146397d36 \
+    --hash=sha256:ece8c00a69cf01b45d0b1dedabb469c90d8caf996d4fda40f147627a122849a4
+    # via matplotlib
+python-dateutil==3.0.0 \
+    --hash=sha256:3c79630202e4152c6add678446984236efe4f57e84d8e892aab0637bab82e9fd \
+    --hash=sha256:7ebcb3c29a92f3ceafe79a7a48a5c45677e9e004bbeec5742ac0bbb00560b7a2
+    # via matplotlib
+six==1.17.0 \
+    --hash=sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274 \
+    --hash=sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81
+    # via python-dateutil
+tzdata==2026.5 \
+    --hash=sha256:8cc73c0a0bfca7dbfa59235d60b2eff82231dee33f53d206db1acd9173cfc0a7 \
+    --hash=sha256:b683bd1b6659ddcd810ff02ad09ba821d4bf1065072805063eb35c49617905ac
+    # via python-dateutil

+ 112 - 0
scripts/publish_metrics_branch.sh

@@ -0,0 +1,112 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: Apache-2.0
+# Publish the daily growth chart bundle to the orphan `metrics` branch (issue #294).
+#
+# The publish job of .github/workflows/growth-chart.yml runs this with
+# contents: write. It never touches main, so main's branch protection is
+# untouched. What it does:
+#   1. re-validates the bundle offline with gen_repo_metrics.py --verify-bundle
+#      (exact two files, size caps, real PNG, matching hashes, only per-day counts,
+#      the expected repository, a fresh time stamp), because the bundle crossed an
+#      artifact boundary;
+#   2. builds a fresh one-commit orphan history holding repo-growth.png,
+#      metrics-snapshot.json and as-of.txt;
+#   3. skips the push only when the remote branch holds exactly these three files,
+#      each byte-identical (a changed snapshot or as-of file is published even
+#      when the picture did not change);
+#   4. otherwise pushes with --force-with-lease=REF:SHA, naming the value it
+#      read, so a branch that moved in the meantime is not overwritten. A first run
+#      expects the branch not to exist and creates it.
+# No bare force, no merge, no history kept: the branch is a drop box for three files.
+#
+# Residual risk, stated plainly: GITHUB_TOKEN cannot be limited to one branch, so
+# the publish job's token can write the whole repository. This script limits what
+# IT does (one hard-coded refspec, refs/heads/metrics, refused for anything else;
+# the token reaches only the three git commands that talk to the remote, scoped
+# to the remote URL, and never the validator), but it is not access control. The
+# control is a repository ruleset: see docs/wiki/Repository-Growth.md.
+#
+# Usage: publish_metrics_branch.sh BUNDLE_DIR
+# Environment:
+#   METRICS_REMOTE            remote URL (default https://github.com/$GITHUB_REPOSITORY.git)
+#   METRICS_EXPECT_REPO       owner/name the snapshot must be for (default $GITHUB_REPOSITORY)
+#   METRICS_MAX_AGE_HOURS     reject a bundle older than this (default 6; 0 = no limit)
+#   GH_TOKEN                  optional; sent as an HTTP header scoped to the remote URL,
+#                             through git's environment config on the remote commands
+#                             only; never on a command line, never written to disk,
+#                             and removed from the environment before anything else runs
+#   METRICS_BRANCH            test seam; anything but "metrics" is refused
+
+set -euo pipefail
+
+die() {
+  echo "publish_metrics_branch: $*" >&2
+  exit "${2:-1}"
+}
+
+[ "$#" -eq 1 ] && [ -n "$1" ] || die "usage: $0 BUNDLE_DIR" 2
+bundle=$1
+# The only ref this script may ever write. The check is on the value, not a hope:
+# a different, empty or oddly spelled name stops here, before any network call.
+branch=${METRICS_BRANCH-metrics}
+[ "$branch" = metrics ] || die "refusing to publish to '$branch': only refs/heads/metrics is allowed" 2
+here=$(cd "$(dirname "$0")" && pwd)
+
+repo=${METRICS_EXPECT_REPO:-${GITHUB_REPOSITORY:-}}
+[[ $repo =~ ^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$ ]] || die "METRICS_EXPECT_REPO or GITHUB_REPOSITORY is not an owner/repository name" 2
+remote=${METRICS_REMOTE:-https://github.com/$repo.git}
+max_age=${METRICS_MAX_AGE_HOURS:-6}
+[[ $max_age =~ ^[0-9]+$ ]] || die "METRICS_MAX_AGE_HOURS must be a whole number" 2
+
+# Take the token out of the environment now; it is handed to git commands one at a time below.
+token=${GH_TOKEN:-}
+unset GH_TOKEN GITHUB_TOKEN
+
+as_of=$(python3 -I "$here/gen_repo_metrics.py" --verify-bundle "$bundle" --expect-repo "$repo" --max-age-hours "$max_age" --print-as-of) \
+  || die "the bundle failed validation; nothing was pushed"
+[[ $as_of =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$ ]] || die "unexpected as-of value"
+
+export GIT_TERMINAL_PROMPT=0
+[[ $remote != http://* ]] || die "refusing a plain http remote" 2
+
+# Run git against the remote with the credential header set for this one command
+# only, and scoped to the exact remote URL. Local commands never get it.
+remote_git() {
+  if [ -n "$token" ]; then
+    GIT_CONFIG_COUNT=1 \
+      GIT_CONFIG_KEY_0="http.${remote}.extraheader" \
+      GIT_CONFIG_VALUE_0="AUTHORIZATION: basic $(printf 'x-access-token:%s' "$token" | base64 -w0)" \
+      git -C "$work" "$@"
+  else
+    git -C "$work" "$@"
+  fi
+}
+
+work=$(mktemp -d)
+trap 'rm -rf "$work"' EXIT
+git -C "$work" init -q -b "$branch"
+git -C "$work" remote add origin "$remote"
+cp -- "$bundle/repo-growth.png" "$bundle/metrics-snapshot.json" "$work/"
+printf '%s\n' "$as_of" >"$work/as-of.txt"
+
+# The value the lease protects: what the remote branch is right now (empty if absent).
+remote_sha=$(remote_git ls-remote origin "refs/heads/$branch" | cut -f1)
+if [ -n "$remote_sha" ]; then
+  remote_git fetch -q origin "refs/heads/$branch"
+  # Skip only when the remote tree is exactly these three files, byte for byte.
+  same=1
+  [ "$(git -C "$work" ls-tree -r --name-only FETCH_HEAD | sort | tr '\n' ' ')" = "as-of.txt metrics-snapshot.json repo-growth.png " ] || same=0
+  for f in repo-growth.png metrics-snapshot.json as-of.txt; do
+    git -C "$work" show "FETCH_HEAD:$f" 2>/dev/null | cmp -s - "$work/$f" || same=0
+  done
+  if [ "$same" = 1 ]; then
+    echo "publish_metrics_branch: everything is unchanged (as of $as_of); nothing pushed"
+    exit 0
+  fi
+fi
+
+git -C "$work" add -- repo-growth.png metrics-snapshot.json as-of.txt
+git -C "$work" -c user.name="github-actions[bot]" -c user.email="41898282+github-actions[bot]@users.noreply.github.com" \
+  commit -q -m "Growth chart as of $as_of"
+remote_git push -q --force-with-lease="refs/heads/metrics:$remote_sha" origin HEAD:refs/heads/metrics
+echo "publish_metrics_branch: pushed refs/heads/metrics (as of $as_of)"

+ 396 - 0
tests/test_growth_bundle.py

@@ -0,0 +1,396 @@
+# SPDX-License-Identifier: Apache-2.0
+"""The daily growth chart bundle (issue #294): hostile input, and the publish script.
+
+The render job hands a bundle (snapshot JSON + PNG) to the publish job as an
+artifact. The publish job holds contents: write, so it re-validates the bundle
+offline before anything is pushed. What is proved here:
+- a good bundle passes, and every hostile variation fails with a message: extra
+  file, symlink, oversized snapshot or PNG, bad PNG signature, metadata chunk,
+  hash mismatch, wrong repository, a stale or future time stamp, a login-like
+  field, duplicate keys, nesting bombs, absurd counts;
+- the publish script creates the orphan metrics branch on a first run, pushes
+  only the three expected files, skips the push when the picture is unchanged,
+  and refuses to overwrite a branch that moved under it (force-with-lease).
+Everything is offline: the remote is a bare repository in a temporary directory.
+"""
+
+import copy
+import datetime
+import json
+import os
+import shutil
+import subprocess
+import sys
+from pathlib import Path
+
+import pytest
+from test_repo_metrics import fixture, png_bytes
+
+ROOT = Path(__file__).resolve().parent.parent
+sys.path.insert(0, str(ROOT / "scripts"))
+import gen_repo_metrics as grm
+
+PUBLISH = ROOT / "scripts" / "publish_metrics_branch.sh"
+NOW = datetime.datetime(2026, 10, 25, 6, 0, 0, tzinfo=datetime.UTC)
+REPO = "Example/Repo"
+
+
+def make_bundle(path: Path, snap=None, png=None, fetched="2026-10-25T05:30:00Z") -> Path:
+    snap = copy.deepcopy(snap or fixture())
+    snap["fetched_at"] = fetched
+    snap["stars"] = {"2026-10-10": 2, "2026-10-12": 5}
+    snap["forks"] = {"2026-10-13": 1}
+    snap["merged_prs"] = {"2026-10-11": 3}
+    snap["closed_issues"] = {"2026-10-13": 1}
+    path.mkdir(parents=True, exist_ok=True)
+    (path / grm.BUNDLE_PNG).write_bytes(png if png is not None else png_bytes())
+    snap["source_sha256"] = grm.source_digest(snap)
+    snap["png_sha256"] = grm.file_digest(path / grm.BUNDLE_PNG)
+    (path / grm.BUNDLE_SNAPSHOT).write_text(json.dumps(snap, indent=1, sort_keys=True) + "\n")
+    return path
+
+
+def problems(bundle: Path, **kw):
+    kw.setdefault("expect_repo", REPO)
+    kw.setdefault("now", NOW)
+    kw.setdefault("max_age_hours", 6)
+    return grm.verify_bundle(bundle, **kw)
+
+
+def rewrite_snapshot(bundle: Path, mutate, rehash=True):
+    p = bundle / grm.BUNDLE_SNAPSHOT
+    snap = json.loads(p.read_text())
+    mutate(snap)
+    if rehash:
+        snap["source_sha256"] = grm.source_digest(snap)
+    p.write_text(json.dumps(snap, indent=1, sort_keys=True) + "\n")
+
+
+def test_a_good_bundle_passes(tmp_path):
+    assert problems(make_bundle(tmp_path / "b")) == []
+
+
+def test_an_extra_file_fails(tmp_path):
+    b = make_bundle(tmp_path / "b")
+    (b / "payload.sh").write_text("echo hi\n")
+    assert any("unexpected" in p for p in problems(b))
+
+
+def test_a_missing_file_fails(tmp_path):
+    b = make_bundle(tmp_path / "b")
+    (b / grm.BUNDLE_PNG).unlink()
+    assert problems(b)
+
+
+def test_a_symlink_fails(tmp_path):
+    b = make_bundle(tmp_path / "b")
+    target = tmp_path / "elsewhere.png"
+    shutil.move(b / grm.BUNDLE_PNG, target)
+    os.symlink(target, b / grm.BUNDLE_PNG)
+    assert any("regular file" in p for p in problems(b))
+
+
+def test_a_subdirectory_fails(tmp_path):
+    b = make_bundle(tmp_path / "b")
+    (b / "sub").mkdir()
+    assert any("unexpected" in p for p in problems(b))
+
+
+def test_an_oversized_png_fails(tmp_path):
+    b = make_bundle(tmp_path / "b")
+    with (b / grm.BUNDLE_PNG).open("ab") as f:
+        f.write(b"\0" * (grm.MAX_PNG_BYTES + 1))
+    assert any("larger than" in p for p in problems(b))
+
+
+def test_an_oversized_snapshot_fails(tmp_path):
+    b = make_bundle(tmp_path / "b")
+    with (b / grm.BUNDLE_SNAPSHOT).open("a") as f:
+        f.write(" " * (grm.MAX_SNAPSHOT_BYTES + 1))
+    assert any("larger than" in p for p in problems(b))
+
+
+def test_a_png_with_a_bad_signature_fails(tmp_path):
+    b = make_bundle(tmp_path / "b", png=b"GIF89a" + b"\0" * 40)
+    assert any("PNG" in p for p in problems(b))
+
+
+def test_a_png_that_is_a_script_fails(tmp_path):
+    b = make_bundle(tmp_path / "b", png=b"#!/bin/sh\nrm -rf /\n")
+    assert problems(b)
+
+
+def test_a_png_that_does_not_match_its_hash_fails(tmp_path):
+    b = make_bundle(tmp_path / "b")
+    (b / grm.BUNDLE_PNG).write_bytes(png_bytes(color=9))
+    assert any("png_sha256" in p for p in problems(b))
+
+
+def test_a_hand_edited_snapshot_fails(tmp_path):
+    b = make_bundle(tmp_path / "b")
+    rewrite_snapshot(b, lambda s: s["stars"].update({"2026-10-12": 99999}), rehash=False)
+    assert any("source_sha256" in p for p in problems(b))
+
+
+def test_the_wrong_repository_fails(tmp_path):
+    b = make_bundle(tmp_path / "b")
+    assert any("repo" in p for p in problems(b, expect_repo="Other/Thing"))
+
+
+@pytest.mark.parametrize("field", ["login", "stargazers", "email"])
+def test_a_login_like_field_fails(tmp_path, field):
+    b = make_bundle(tmp_path / "b")
+    rewrite_snapshot(b, lambda s: s.update({field: ["someone"]}))
+    assert any("unknown field" in p for p in problems(b))
+
+
+def test_a_stale_bundle_fails(tmp_path):
+    b = make_bundle(tmp_path / "b")
+    later = NOW + datetime.timedelta(hours=7)
+    assert any("old" in p for p in problems(b, now=later))
+
+
+def test_a_bundle_from_the_future_fails(tmp_path):
+    b = make_bundle(tmp_path / "b")
+    earlier = NOW - datetime.timedelta(hours=3)
+    assert any("future" in p for p in problems(b, now=earlier))
+
+
+def test_no_age_limit_when_none_is_given(tmp_path):
+    b = make_bundle(tmp_path / "b")
+    assert problems(b, now=NOW + datetime.timedelta(days=400), max_age_hours=None) == []
+
+
+def test_an_absurd_count_fails(tmp_path):
+    b = make_bundle(tmp_path / "b")
+    rewrite_snapshot(b, lambda s: s["stars"].update({"2026-10-12": grm.MAX_DAY_COUNT + 1}))
+    assert any("too large" in p for p in problems(b))
+
+
+def test_duplicate_keys_fail(tmp_path):
+    b = make_bundle(tmp_path / "b")
+    p = b / grm.BUNDLE_SNAPSHOT
+    text = p.read_text().replace('"repo": "Example/Repo",', '"repo": "Example/Repo", "repo": "Other/Thing",')
+    p.write_text(text)
+    assert any("duplicate" in x for x in problems(b))
+
+
+def test_a_nesting_bomb_fails_without_crashing(tmp_path):
+    b = make_bundle(tmp_path / "b")
+    (b / grm.BUNDLE_SNAPSHOT).write_text("[" * 50000 + "]" * 50000)
+    out = problems(b)
+    assert out
+
+
+@pytest.mark.parametrize("text", ["NaN", "[1, 2", "", "null", '{"schema": 1e999}'])
+def test_garbage_snapshots_fail(tmp_path, text):
+    b = make_bundle(tmp_path / "b")
+    (b / grm.BUNDLE_SNAPSHOT).write_text(text)
+    assert problems(b)
+
+
+def test_the_cli_verifies_and_prints_the_as_of_stamp(tmp_path):
+    b = make_bundle(tmp_path / "b")
+    run = lambda *a: subprocess.run([sys.executable, "-I", str(ROOT / "scripts" / "gen_repo_metrics.py"), *a], check=False, capture_output=True, text=True)
+    ok = run("--verify-bundle", str(b), "--expect-repo", REPO, "--print-as-of")
+    assert ok.returncode == 0 and ok.stdout.strip() == "2026-10-25T05:30:00Z", ok.stderr
+    (b / "extra").write_text("x")
+    bad = run("--verify-bundle", str(b), "--expect-repo", REPO)
+    assert bad.returncode == 1 and "unexpected" in bad.stderr
+
+
+# -- the publish script ---------------------------------------------------------------
+
+
+def git(*args, cwd=None, check=True):
+    env = {**os.environ, "GIT_CONFIG_GLOBAL": "/dev/null", "GIT_CONFIG_SYSTEM": "/dev/null"}
+    return subprocess.run(["git", *args], cwd=cwd, check=check, capture_output=True, text=True, env=env)
+
+
+@pytest.fixture
+def remote(tmp_path):
+    r = tmp_path / "remote.git"
+    git("init", "-q", "--bare", "-b", "main", str(r))
+    return r
+
+
+def publish(bundle, remote, **extra):
+    env = {**os.environ, "GIT_CONFIG_GLOBAL": "/dev/null", "GIT_CONFIG_SYSTEM": "/dev/null", "METRICS_REMOTE": str(remote), "METRICS_EXPECT_REPO": REPO, "METRICS_MAX_AGE_HOURS": "0", **extra}
+    return subprocess.run(["bash", str(PUBLISH), str(bundle)], check=False, capture_output=True, text=True, env=env)
+
+
+def branch_files(remote):
+    return sorted(git("ls-tree", "-r", "--name-only", "metrics", cwd=remote).stdout.split())
+
+
+def test_first_run_creates_an_orphan_branch_with_three_files(tmp_path, remote):
+    out = publish(make_bundle(tmp_path / "b"), remote)
+    assert out.returncode == 0, out.stderr
+    assert branch_files(remote) == ["as-of.txt", "metrics-snapshot.json", "repo-growth.png"]
+    assert git("rev-list", "--count", "metrics", cwd=remote).stdout.strip() == "1"
+    assert git("rev-list", "--max-parents=0", "metrics", cwd=remote).stdout.strip() == git("rev-parse", "metrics", cwd=remote).stdout.strip()
+    assert git("show", "metrics:as-of.txt", cwd=remote).stdout == "2026-10-25T05:30:00Z\n"
+    assert "main" not in git("branch", "--list", cwd=remote).stdout
+
+
+def test_an_unchanged_picture_is_not_pushed_again(tmp_path, remote):
+    b = make_bundle(tmp_path / "b")
+    assert publish(b, remote).returncode == 0
+    first = git("rev-parse", "metrics", cwd=remote).stdout
+    again = publish(b, remote)
+    assert again.returncode == 0 and "unchanged" in again.stdout
+    assert git("rev-parse", "metrics", cwd=remote).stdout == first
+
+
+def test_a_changed_picture_replaces_the_branch(tmp_path, remote):
+    assert publish(make_bundle(tmp_path / "b"), remote).returncode == 0
+    first = git("rev-parse", "metrics", cwd=remote).stdout
+    assert publish(make_bundle(tmp_path / "c", png=png_bytes(color=7)), remote).returncode == 0
+    assert git("rev-parse", "metrics", cwd=remote).stdout != first
+    assert git("rev-list", "--count", "metrics", cwd=remote).stdout.strip() == "1"
+
+
+def test_a_hostile_bundle_is_not_pushed(tmp_path, remote):
+    b = make_bundle(tmp_path / "b")
+    (b / "extra.sh").write_text("x")
+    out = publish(b, remote)
+    assert out.returncode != 0
+    assert git("branch", "--list", "metrics", cwd=remote).stdout.strip() == ""
+
+
+def test_a_branch_that_moved_under_the_publish_is_not_overwritten(tmp_path, remote):
+    assert publish(make_bundle(tmp_path / "b"), remote).returncode == 0
+    # A second writer lands a commit on the branch after the script read the old
+    # value and before it pushes: a git shim moves the remote ref, then pushes.
+    other = tmp_path / "other"
+    git("clone", "-q", "-b", "metrics", str(remote), str(other))
+    (other / "note.txt").write_text("someone else\n")
+    git("-C", str(other), "add", "note.txt")
+    git("-C", str(other), "-c", "user.name=t", "-c", "user.email=t@example.invalid", "commit", "-q", "-m", "x")
+    git("-C", str(other), "push", "-q", "origin", "HEAD:refs/heads/side")
+    moved = git("rev-parse", "side", cwd=remote).stdout.strip()
+    real = shutil.which("git")
+    shim = tmp_path / "shim"
+    shim.mkdir()
+    (shim / "git").write_text(
+        "#!/bin/bash\n"
+        'for a in "$@"; do\n'
+        f'  if [ "$a" = push ]; then {real} --git-dir={remote} update-ref refs/heads/metrics {moved}; break; fi\n'
+        "done\n"
+        f'exec {real} "$@"\n'
+    )
+    (shim / "git").chmod(0o755)
+    out = publish(make_bundle(tmp_path / "c", png=png_bytes(color=3)), remote, PATH=f"{shim}:{os.environ['PATH']}")
+    assert out.returncode != 0
+    assert git("rev-parse", "metrics", cwd=remote).stdout.strip() == moved
+
+
+def test_the_script_never_uses_a_bare_force():
+    import re
+
+    text = PUBLISH.read_text()
+    assert "--force-with-lease=" in text
+    assert not re.search(r"--force(?!-with-lease=)", text)
+    assert not re.search(r"push\s+(-\w*f|\+)", text)
+
+
+def test_a_changed_snapshot_is_pushed_even_when_the_picture_is_identical(tmp_path, remote):
+    assert publish(make_bundle(tmp_path / "b"), remote).returncode == 0
+    first = git("rev-parse", "metrics", cwd=remote).stdout
+    newer = make_bundle(tmp_path / "c", fetched="2026-10-25T05:45:00Z")
+    assert (newer / grm.BUNDLE_PNG).read_bytes() == (tmp_path / "b" / grm.BUNDLE_PNG).read_bytes()
+    out = publish(newer, remote)
+    assert out.returncode == 0 and "pushed" in out.stdout
+    assert git("rev-parse", "metrics", cwd=remote).stdout != first
+    assert git("show", "metrics:as-of.txt", cwd=remote).stdout == "2026-10-25T05:45:00Z\n"
+    assert json.loads(git("show", "metrics:metrics-snapshot.json", cwd=remote).stdout)["fetched_at"] == "2026-10-25T05:45:00Z"
+
+
+def test_a_remote_branch_with_an_extra_file_is_replaced_not_skipped(tmp_path, remote):
+    b = make_bundle(tmp_path / "b")
+    assert publish(b, remote).returncode == 0
+    other = tmp_path / "other"
+    git("clone", "-q", "-b", "metrics", str(remote), str(other))
+    (other / "extra.txt").write_text("x\n")
+    git("-C", str(other), "add", "extra.txt")
+    git("-C", str(other), "-c", "user.name=t", "-c", "user.email=t@example.invalid", "commit", "-q", "-m", "x")
+    git("-C", str(other), "push", "-q", "origin", "metrics")
+    assert publish(b, remote).returncode == 0
+    assert branch_files(remote) == ["as-of.txt", "metrics-snapshot.json", "repo-growth.png"]
+
+
+@pytest.mark.parametrize("branch", ["main", "master", "metrics:main", "refs/heads/main", "../metrics", "metrics ", "-f", "", "metrics2", "HEAD"])
+def test_the_script_refuses_to_push_to_any_ref_but_metrics(tmp_path, remote, branch):
+    git("-C", str(remote), "symbolic-ref", "HEAD", "refs/heads/main")
+    out = publish(make_bundle(tmp_path / "b"), remote, METRICS_BRANCH=branch)
+    assert out.returncode != 0
+    assert "refs/heads/metrics" in out.stderr
+    assert git("branch", "--list", cwd=remote).stdout.strip() == ""
+
+
+def test_the_push_refspec_is_spelled_out_in_the_script():
+    text = PUBLISH.read_text()
+    assert "HEAD:refs/heads/metrics" in text
+    assert "refs/heads/metrics" in text.split("push")[-1]
+
+
+TOKEN = f"fixture-credential-{6 * 7}"  # built at run time: a fake with no literal for a secret scanner to flag
+
+
+def shimmed_publish(tmp_path, remote, bundle):
+    """Run the script with a git shim that logs, per call, the credential env and the work repo's config."""
+    import base64
+
+    real = shutil.which("git")
+    log = tmp_path / "gitcalls.log"
+    shim = tmp_path / "shim"
+    shim.mkdir()
+    (shim / "git").write_text(
+        "#!/bin/bash\n"
+        'sub=""; dir=""\n'
+        'args=("$@")\n'
+        'if [ "${args[0]}" = -C ]; then dir=${args[1]}; sub=${args[2]}; else sub=${args[0]}; fi\n'
+        f'{{ echo "CALL $sub count=${{GIT_CONFIG_COUNT:-}} key=${{GIT_CONFIG_KEY_0:-}} hasval=$([ -n "${{GIT_CONFIG_VALUE_0:-}}" ] && echo y || echo n) token=$([ -n "${{GH_TOKEN:-}}" ] && echo y || echo n)"; '
+        f'[ -n "$dir" ] && [ -f "$dir/.git/config" ] && sed "s/^/CONFIG /" "$dir/.git/config"; }} >> {log}\n'
+        f'exec {real} "$@"\n'
+    )
+    (shim / "git").chmod(0o755)
+    out = publish(bundle, remote, GH_TOKEN=TOKEN, PATH=f"{shim}:{os.environ['PATH']}")
+    return out, log.read_text(), base64.b64encode(f"x-access-token:{TOKEN}".encode()).decode()
+
+
+def test_the_token_header_is_scoped_to_the_remote_url_and_only_remote_commands(tmp_path, remote):
+    out, calls, _ = shimmed_publish(tmp_path, remote, make_bundle(tmp_path / "b"))
+    assert out.returncode == 0, out.stderr
+    remote_calls = [ln for ln in calls.splitlines() if ln.startswith("CALL ") and "hasval=y" in ln]
+    assert remote_calls, "the header was never sent"
+    for ln in remote_calls:
+        assert ln.split()[1] in {"ls-remote", "fetch", "push"}, ln
+        assert f"key=http.{remote}.extraheader" in ln, ln
+        assert "count=1" in ln
+    local = [ln for ln in calls.splitlines() if ln.startswith("CALL ") and ln.split()[1] in {"init", "remote", "add", "commit", "show"}]
+    assert local and all("hasval=n" in ln and "count= " in ln for ln in local), local
+
+
+def test_no_file_and_no_output_ever_holds_the_token(tmp_path, remote):
+    out, calls, b64 = shimmed_publish(tmp_path, remote, make_bundle(tmp_path / "b"))
+    assert out.returncode == 0
+    for secret in (TOKEN, b64):
+        assert secret not in calls  # the work repo's .git/config, as seen at every call
+        assert secret not in out.stdout + out.stderr
+        for path in tmp_path.rglob("*"):
+            if path.is_file() and not path.is_symlink() and path != tmp_path / "gitcalls.log":
+                assert secret.encode() not in path.read_bytes(), path
+
+
+def test_the_python_validator_does_not_see_the_token(tmp_path, remote):
+    real = shutil.which("python3")
+    shim = tmp_path / "pyshim"
+    shim.mkdir()
+    seen = tmp_path / "py-env.log"
+    (shim / "python3").write_text(f'#!/bin/bash\necho "GH_TOKEN=${{GH_TOKEN:-unset}} GITHUB_TOKEN=${{GITHUB_TOKEN:-unset}}" >> {seen}\nexec {real} "$@"\n')
+    (shim / "python3").chmod(0o755)
+    out = publish(make_bundle(tmp_path / "b"), remote, GH_TOKEN=TOKEN, GITHUB_TOKEN=TOKEN, PATH=f"{shim}:{os.environ['PATH']}")
+    assert out.returncode == 0, out.stderr
+    assert seen.read_text().strip() == "GH_TOKEN=unset GITHUB_TOKEN=unset"
+    assert "export GIT_CONFIG" not in PUBLISH.read_text()

+ 225 - 0
tests/test_growth_chart_workflow.py

@@ -0,0 +1,225 @@
+# SPDX-License-Identifier: Apache-2.0
+"""Structure of .github/workflows/growth-chart.yml (issue #294).
+
+The daily growth chart is rendered in one job that can only read, and published
+by a second job that can write but runs nothing it did not validate. These tests
+read the workflow as data and pin the properties that make that true: permissions
+per job, commit-pinned actions with a version comment, no expression inside a run
+script, no secrets in the publish job, no bare force push, a main-only guard, and
+hash-pinned plotting dependencies. Each rule is a function over text so a negative
+case can prove the rule bites.
+"""
+
+import re
+from pathlib import Path
+
+import pytest
+import yaml
+
+ROOT = Path(__file__).resolve().parent.parent
+WORKFLOW = ROOT / ".github" / "workflows" / "growth-chart.yml"
+REQUIREMENTS = ROOT / "scripts" / "growth-chart-requirements.txt"
+PUBLISH = ROOT / "scripts" / "publish_metrics_branch.sh"
+IMAGE_URL = "https://raw.githubusercontent.com/ChiefGyk3D/Clouds-Against-Humanity/metrics/repo-growth.png"
+
+USES_RE = re.compile(r"^\s*-?\s*uses:\s*(\S+)(.*)$")
+PINNED_RE = re.compile(r"^[\w.-]+/[\w./-]+@[0-9a-f]{40}$")
+VERSION_RE = re.compile(r"^\s*#\s*v\d+\.\d+\.\d+\b")
+
+
+def load(text: str | None = None) -> dict:
+    return yaml.safe_load(text if text is not None else WORKFLOW.read_text())
+
+
+def triggers(doc: dict) -> dict:
+    return doc.get("on", doc.get(True))
+
+
+def unpinned_uses(text: str) -> list[str]:
+    bad = []
+    for line in text.splitlines():
+        m = USES_RE.match(line)
+        if m and not (PINNED_RE.match(m.group(1)) and VERSION_RE.match(m.group(2))):
+            bad.append(line.strip())
+    return bad
+
+
+def run_scripts(doc: dict):
+    for name, job in doc["jobs"].items():
+        for step in job["steps"]:
+            if "run" in step:
+                yield name, step["run"]
+
+
+def expressions_in_run(doc: dict) -> list[str]:
+    return [f"{job}: {script}" for job, script in run_scripts(doc) if "${{" in script]
+
+
+def bare_force(text: str) -> list[str]:
+    return re.findall(r"--force(?!-with-lease=)\S*|\bpush\b[^\n]*\s-\w*f\b|\bpush\b[^\n]*\s\+\S", text)
+
+
+@pytest.fixture(scope="module")
+def doc():
+    return load()
+
+
+def test_the_workflow_exists_and_has_two_jobs(doc):
+    assert set(doc["jobs"]) == {"render", "publish"}
+
+
+def test_triggers_are_a_daily_schedule_off_the_hour_and_a_manual_run(doc):
+    on = triggers(doc)
+    assert set(on) == {"schedule", "workflow_dispatch"}
+    crons = [s["cron"] for s in on["schedule"]]
+    assert len(crons) == 1
+    minute, hour, dom, month, dow = crons[0].split()
+    assert minute.isdigit() and minute not in {"0", "00", "30", "15", "45"}
+    assert hour.isdigit() and (dom, month, dow) == ("*", "*", "*")
+
+
+def test_workflow_default_permissions_are_empty_and_jobs_name_their_own(doc):
+    assert doc["permissions"] == {}
+    assert doc["jobs"]["render"]["permissions"] == {"contents": "read"}
+    assert doc["jobs"]["publish"]["permissions"] == {"contents": "write"}
+
+
+def test_publish_waits_for_render(doc):
+    assert doc["jobs"]["publish"]["needs"] == "render" or doc["jobs"]["publish"]["needs"] == ["render"]
+
+
+def test_both_jobs_are_guarded_to_main_in_this_repository(doc):
+    for name in ("render", "publish"):
+        cond = doc["jobs"][name]["if"]
+        assert "github.ref == 'refs/heads/main'" in cond, name
+        assert "github.repository == 'ChiefGyk3D/Clouds-Against-Humanity'" in cond, name
+
+
+def test_concurrency_group_queues_runs_instead_of_cancelling(doc):
+    conc = doc["concurrency"]
+    assert conc["group"] and conc["cancel-in-progress"] is False
+
+
+def test_every_action_is_pinned_by_commit_with_a_version_comment():
+    text = WORKFLOW.read_text()
+    assert "uses:" in text  # collect loosely: something must have been collected
+    assert unpinned_uses(text) == []
+
+
+@pytest.mark.parametrize(
+    "line",
+    [
+        "      - uses: actions/checkout@main",
+        "      - uses: actions/checkout@v7",
+        "      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1",
+        "      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b # v7.0.1",
+        "      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # latest",
+    ],
+)
+def test_the_pin_rule_bites(line):
+    assert unpinned_uses(line)
+
+
+def test_every_checkout_drops_its_credentials(doc):
+    seen = 0
+    for job in doc["jobs"].values():
+        for step in job["steps"]:
+            if str(step.get("uses", "")).startswith("actions/checkout@"):
+                seen += 1
+                assert step["with"]["persist-credentials"] is False
+    assert seen == 2
+
+
+def test_no_expression_inside_a_run_script(doc):
+    assert expressions_in_run(doc) == []
+
+
+def test_the_expression_rule_bites():
+    bad = load("on: push\njobs:\n  j:\n    runs-on: x\n    steps:\n      - run: echo ${{ github.head_ref }}\n")
+    assert expressions_in_run(bad)
+
+
+def test_publish_has_no_secrets_and_only_the_default_token(doc):
+    text = WORKFLOW.read_text()
+    assert not re.search(r"\$\{\{[^}]*\bsecrets\b", text)
+    assert "secrets:" not in text and "inherit" not in text
+    publish = doc["jobs"]["publish"]
+    for step in publish["steps"]:
+        for value in (step.get("env") or {}).values():
+            if "${{" in str(value):
+                assert str(value).replace(" ", "") == "${{github.token}}"
+
+
+def test_render_never_pushes_and_publish_never_installs_packages(doc):
+    render = "\n".join(s for n, s in run_scripts(doc) if n == "render")
+    publish = "\n".join(s for n, s in run_scripts(doc) if n == "publish")
+    assert "git push" not in render and "publish_metrics_branch" not in render
+    assert "pip" not in publish and "matplotlib" not in publish
+
+
+def test_no_bare_force_push_anywhere():
+    for path in (WORKFLOW, PUBLISH):
+        assert bare_force(path.read_text()) == [], path
+    assert "--force-with-lease=" in PUBLISH.read_text()
+
+
+@pytest.mark.parametrize("text", ["git push --force origin x", "git push -f origin x", "git push origin +x:y", "git push --force-with-lease origin x"])
+def test_the_force_rule_bites(text):
+    assert bare_force(text)
+
+
+def test_the_render_job_uploads_a_short_lived_artifact_and_fails_if_empty(doc):
+    uploads = [s for s in doc["jobs"]["render"]["steps"] if str(s.get("uses", "")).startswith("actions/upload-artifact@")]
+    assert len(uploads) == 1
+    w = uploads[0]["with"]
+    assert w["if-no-files-found"] == "error" and int(w["retention-days"]) <= 3
+
+
+def test_both_jobs_validate_the_bundle(doc):
+    for name in ("render", "publish"):
+        scripts = "\n".join(s for n, s in run_scripts(doc) if n == name)
+        assert "--verify-bundle" in scripts or "publish_metrics_branch" in scripts, name
+
+
+def test_dependencies_are_installed_only_with_hashes_from_the_pinned_file(doc):
+    render = "\n".join(s for n, s in run_scripts(doc) if n == "render")
+    assert "--require-hashes" in render and "growth-chart-requirements.txt" in render
+    assert not re.search(r"pip\S*\s+install\s+(?!.*-r)", render.replace("\\\n", " "))
+
+
+def test_the_requirements_file_pins_every_package_with_hashes():
+    lines = REQUIREMENTS.read_text().replace("\\\n", " ").splitlines()
+    pins = [ln for ln in lines if ln.strip() and not ln.strip().startswith("#")]
+    assert any(ln.startswith("matplotlib==") for ln in pins)
+    for ln in pins:
+        assert re.match(r"^[A-Za-z0-9_.-]+==[\w.]+(\s+--hash=sha256:[0-9a-f]{64})+$", ln.strip()), ln
+
+
+def test_the_job_timeouts_are_set(doc):
+    for job in doc["jobs"].values():
+        assert 0 < job["timeout-minutes"] <= 15
+
+
+# -- the pages point at the metrics branch -----------------------------------------
+
+
+@pytest.mark.parametrize("page", ["README.md", "docs/wiki/Home.md", "docs/wiki/Repository-Growth.md"])
+def test_pages_reference_the_chart_from_the_metrics_branch(page):
+    text = (ROOT / page).read_text()
+    refs = re.findall(r"!\[[^\]]*\]\(([^)]*repo-growth\.png)\)", text)
+    assert refs == [IMAGE_URL], page
+
+
+def test_publish_runs_only_checkout_download_and_the_verified_script(doc):
+    steps = doc["jobs"]["publish"]["steps"]
+    kinds = [s.get("uses", "").split("@")[0] or "run" for s in steps]
+    assert kinds == ["actions/checkout", "actions/download-artifact", "run"]
+    assert steps[-1]["run"].strip() == "bash scripts/publish_metrics_branch.sh bundle"
+    assert set(steps[-1]["env"]) == {"GH_TOKEN", "METRICS_MAX_AGE_HOURS"}
+
+
+def test_the_residual_risk_is_documented_in_the_workflow_and_the_page():
+    text = WORKFLOW.read_text()
+    assert "repository-wide" in text and "ruleset" in text
+    page = (ROOT / "docs/wiki/Repository-Growth.md").read_text()
+    assert "repository-wide" in page and "ruleset" in page and "metrics" in page

+ 4 - 5
tests/test_repo_metrics.py

@@ -504,11 +504,10 @@ def test_staged_files_keep_the_mode_of_the_file_they_replace(tmp_path, monkeypat
     assert (tmp_path / grm.PAGE).stat().st_mode & 0o777 == 0o640
 
 
-def test_home_embeds_the_chart_with_alt_text_and_the_current_as_of_date():
+def test_home_embeds_the_chart_with_alt_text_from_the_metrics_branch():
     home = (ROOT / "docs" / "wiki" / "Home.md").read_text()
-    snap = json.loads((ROOT / grm.SNAPSHOT).read_text())
-    assert "![" + grm.ALT_TEXT + "](images/repo-growth.png)" in home
-    assert f"As of {snap['fetched_at'][:10]} (UTC)" in home, "refresh the as-of date on Home after a --refresh"
+    assert "![" + grm.ALT_TEXT + "](" + grm.DEFAULT_IMAGE_URL + ")" in home
+    assert "the as-of date is printed in the picture" in home
 
 
 # -- the wiki and README are wired up -----------------------------------------------
@@ -516,7 +515,7 @@ def test_home_embeds_the_chart_with_alt_text_and_the_current_as_of_date():
 
 def test_the_chart_is_linked_and_embedded_with_alt_text():
     readme = (ROOT / "README.md").read_text()
-    assert "![" + grm.ALT_TEXT + "](docs/wiki/images/repo-growth.png)" in readme
+    assert "![" + grm.ALT_TEXT + "](" + grm.DEFAULT_IMAGE_URL + ")" in readme
     assert "scripts/gen_repo_metrics.py" in readme
     for name in ("Home.md", "_Sidebar.md", "Project-Status.md"):
         assert "(Repository-Growth.md)" in (ROOT / "docs" / "wiki" / name).read_text(), name

+ 27 - 1
tests/test_wiki_images.py

@@ -33,6 +33,14 @@ STRICT_IMAGE = re.compile(r"!\[([^\]\n]*)\]\(images/([a-z0-9]+(?:-[a-z0-9]+)*\.p
 RAW_HTML_MEDIA = re.compile(r"<\s*/?\s*(img|picture|source|video|audio|iframe|object|embed|svg|image)\b", re.IGNORECASE)
 REFERENCE_IMAGE = re.compile(r"!\[[^\]\n]*\]\s?\[[^\]\n]*\]")
 WIKI_IMAGE_SYNTAX = re.compile(r"\[\[[^\]\n]*\.(png|jpe?g|gif|svg|webp)[^\]\n]*\]\]", re.IGNORECASE)
+# The one image that is not in-tree: the daily growth chart (issue #294), drawn by
+# .github/workflows/growth-chart.yml and served from this repository's orphan
+# `metrics` branch. Exactly this address is allowed, nothing else off-site.
+METRICS_IMAGE_URL = "https://raw.githubusercontent.com/ChiefGyk3D/Clouds-Against-Humanity/metrics/repo-growth.png"
+METRICS_IMAGE = re.compile(r"!\[([^\]\n]*)\]\(" + re.escape(METRICS_IMAGE_URL) + r"\)")
+# Committed only as the offline fallback that gen_repo_metrics.py --check hashes
+# against the committed snapshot; pages show the metrics-branch copy instead.
+FALLBACK_IMAGES = {"repo-growth.png"}
 NAME = re.compile(r"[a-z0-9]+(?:-[a-z0-9]+)*\.png")
 
 
@@ -52,6 +60,11 @@ def page_problems(page: str, text: str) -> list[str]:
     if WIKI_IMAGE_SYNTAX.search(body):
         problems.append(f"{page}: wiki [[image]] syntax; use Markdown image syntax")
     for m in re.finditer(r"!\[", body):
+        metrics = METRICS_IMAGE.match(body, m.start())
+        if metrics:
+            if len(metrics.group(1).strip()) < MIN_ALT:
+                problems.append(f"{page}: alt text {metrics.group(1)!r} is shorter than {MIN_ALT} characters")
+            continue
         ok = STRICT_IMAGE.match(body, m.start())
         if not ok:
             problems.append(f"{page}: image not of the form ![alt](images/lowercase-name.png): {body[m.start():m.start() + 60]!r}")
@@ -118,7 +131,7 @@ def test_every_image_file_is_referenced():
     used = set()
     for page in WIKI.glob("*.md"):
         used |= referenced(page.read_text())
-    unused = [p.name for p in image_entries() if p.name not in used]
+    unused = [p.name for p in image_entries() if p.name not in used and p.name not in FALLBACK_IMAGES]
     assert not unused, f"in docs/wiki/images/ but on no page: {unused}"
 
 
@@ -260,3 +273,16 @@ def test_png_checks_reject_symlinks_bad_names_metadata_and_wide_files(tmp_path):
     broken = tmp_path / "broken.png"
     broken.write_bytes(png()[:-5])
     assert any("IEND" in p or "truncated" in p for p in png_problems(broken))
+
+
+def test_the_metrics_branch_image_is_the_only_off_site_image_allowed():
+    alt = "Hand-drawn style chart of stars and forks"
+    assert not page_problems("X.md", f"![{alt}]({METRICS_IMAGE_URL})\n")
+    assert page_problems("X.md", f"![{alt}]({METRICS_IMAGE_URL}?x=1)\n")
+    assert page_problems("X.md", f"![{alt}](https://example.invalid/repo-growth.png)\n")
+    assert page_problems("X.md", f"![{alt}](https://raw.githubusercontent.com/Other/Repo/metrics/repo-growth.png)\n")
+    assert page_problems("X.md", f"![short]({METRICS_IMAGE_URL})\n")
+
+
+def test_only_the_growth_chart_is_exempt_from_the_every_image_is_used_rule():
+    assert FALLBACK_IMAGES == {"repo-growth.png"}