From 88dd58b51bf1666da9d1e426b55c734d109dbc9c Mon Sep 17 00:00:00 2001
From: Luis <42945842+ldiaz94@users.noreply.github.com>
Date: Mon, 19 Oct 2026 07:35:08 +0000
Subject: [PATCH] Build and publish the source browser and release archives under /source/
---
diff --git a/.gitignore b/.gitignore
index 0408080..db3cd1b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,7 @@
build/
+.wrangler/
+/site/public/source/
+/site/__pycache__/
/raz
# Programs make check builds next to their sources
/examples/*
diff --git a/CLAUDE.md b/CLAUDE.md
index 3be2efa..71c8724 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -80,6 +80,14 @@
## Where things stand
+The website's `/source/` browser and releases are built by ladle,
+pinned with its checksum under `site/tools/`. `make site` builds the
+main pages and then the source site. Wrangler runs `make site-source`
+before uploading, so the generated Git store stays out of this
+repository. `site/README.md` gives the build, release records and
+checks. `site/releases` preserves the existing untagged website
+distributions; it does not create their tags.
+
v0.20.0, report 2026-10.34, is made and not yet tagged: v0.19.0 builds
`src/` (`BOOT`) and the Pascal seed is gone; `Buf.bytes`,
`Sys.entryKind` and `src/`'s `Item`s only read take `const`; and the
diff --git a/HANDOVER.md b/HANDOVER.md
index 5390fa9..0d70c8a 100644
--- a/HANDOVER.md
+++ b/HANDOVER.md
@@ -1,4 +1,37 @@
-# Handover, 2026-10-17
+# Handover
+
+## Website source integration, 2026-10-19
+
+`make site` now adds ladle's source browser, history, release pages
+and a dumb-HTTP clone store under `/source/`. The existing Cloudflare
+deploy command stays `npx wrangler deploy`; its custom build hook runs
+`make site-source` before uploading. The source output is ignored,
+avoiding a Git store that contains copies of its own earlier builds.
+The compressed static ladle executable is pinned at 509b9d3 with its
+checksum and build instructions in `site/tools/`.
+
+`site/releases` records the existing v0.18.1, v0.19.0 and v0.20.0
+website distributions at the commits below. Both site builders read
+it, so a plain build keeps v0.20.0 as the latest download. All
+original compiler archives and their published checksums keep their
+bytes. Each supported version also has a source archive; the three
+untagged versions have notes under `site/release-notes/` explaining
+their status. No compiler release or tag was created here.
+
+The root `_headers` carries scoped `/source/` rules, including the
+canonical release-page URLs Cloudflare serves. Other pages keep their
+existing policy; `/download/latest` keeps its redirect. `site/README.md`
+gives the full build and verification procedure. The bundled builder
+needs only Python 3 and git on x86-64 Linux. A shallow deployment
+checkout fetches the full history and tags from its own origin.
+
+Checks before pushing: `make check` (1,012 checks), `make site`, six
+Git and checksum checks in `site/check.py`, and Wrangler's actual
+custom build in a deploy dry run. The existing report PDFs were
+reused; Pandoc 3.8 rebuilds the HTML report as before. Live deployment
+and HTTP download/clone verification follow the push to main.
+
+## Compiler handover, 2026-10-17
v0.20.0 is done on `main`; nothing is tagged. This says what to tag
where, how, and what to check. Delete this file once the three tags
diff --git a/Makefile b/Makefile
index 04de106..b380516 100644
--- a/Makefile
+++ b/Makefile
@@ -175,8 +175,19 @@
# "Raz, Set, Go" (whose programs are run here, so the output shown is
# real), the report and the latest release's tarball. site/build.py
# says how; it needs ./raz and pandoc. RELEASES, "vX.Y.Z=COMMIT ...",
-# names releases whose tags aren't pushed yet.
+# adds release records to those kept in site/releases. site-source runs
+# ladle after the pages: its Git store and releases live under /source/,
+# with their headers merged at the upload's root. The pinned ladle is
+# bundled for Cloudflare; LADLE may name a locally built one instead.
+LADLE ?=
site: raz pdf
python3 site/build.py $(RELEASES)
+ $(MAKE) site-source
-.PHONY: prev-bench fixpoint check gdb bench kernels stress alpine fmt loc man pdf dist site clean install uninstall
+# Wrangler runs this before deploying the committed pages. The generated
+# Git store must never be committed: otherwise later stores contain copies
+# of earlier ones. See site/README.md for the release and upload procedure.
+site-source:
+ python3 site/source.py $(if $(LADLE),--ladle $(LADLE)) $(RELEASES)
+
+.PHONY: prev-bench fixpoint check gdb bench kernels stress alpine fmt loc man pdf dist site site-source clean install uninstall
diff --git a/README.md b/README.md
index 94bb70f..c1acfea 100644
--- a/README.md
+++ b/README.md
@@ -86,6 +86,7 @@
make pdf # build/raz.pdf and build/raz-lib.pdf, the two volumes, by pandoc and Chromium
make dist # build/raz-V-linux-x86_64.tar.gz, the release's tarball
make site # site/public/, the website, by pandoc and python3
+ make site-source # /source/, its releases and HTTP clone store, by git and Python 3
## Using it
@@ -237,6 +238,24 @@
wherever it runs, so GitHub's and the website's agree. Once a release
is out, `BOOT` may name it, and the next one is built by it: then
`src/` may use what it brought.
+
+The website's [source browser](https://raz.lucelad.workers.dev/source/)
+has the files, history and [release pages](https://raz.lucelad.workers.dev/source/releases/).
+Each supported version has its compiler archive, a separate source
+archive and SHA-256s. The same address is a git remote:
+
+ git clone https://raz.lucelad.workers.dev/source/
+
+`site/releases` records existing website distributions whose tags
+are not pushed yet, so a plain `make site` keeps offering them. Both
+the home page and ladle's release pages use this list. Existing
+`download/` URLs and compiler archives keep their exact bytes.
+[Building the site](site/README.md) gives the complete procedure.
+`make site` runs ladle after building the normal pages and merges its
+headers under `/source/`. The source output stays ignored; Wrangler's
+build hook regenerates it before `npx wrangler deploy` uploads the
+site. Commit the main pages, scripts and pinned builder, then push
+`main` for the existing Cloudflare deployment.
A version of the report is named by its month and a count; the report's
last section says what each version changed.
diff --git a/site/README.md b/site/README.md
new file mode 100644
index 0000000..b3ab1ba
--- /dev/null
+++ b/site/README.md
@@ -0,0 +1,109 @@
+# Building raz's website
+
+`make site` builds the pages, tours, reports and downloads with
+`build.py`, then the source browser and release pages with `source.py`.
+The latter needs git and Python 3 on x86-64 Linux. Its pinned static
+ladle executable is kept compressed under `tools/`, with a checksum
+and build instructions. The helper verifies the compressed bytes,
+unpacks it into `build/site/ladle` and runs it. No compiler or network
+connection is needed with a full checkout. If a deployment service
+clones shallowly, the helper first fetches the full history and tags
+from that checkout's origin, using its existing repository access.
+
+The existing `/download/` URLs and archives stay as they are. Before
+attaching an archive to a release, `source.py` checks its bytes against
+the published checksum beside it. It fails if either is missing or
+the sum differs; it never replaces that checksum to fit new bytes.
+
+## The source browser
+
+`source.py` makes a fresh bare clone of `main`, with its reachable
+tags, using `--single-branch --no-local`. Other branches, reflogs and
+unreachable tags are not published. The store is repacked with a
+20 MiB target, and `git update-server-info` prepares it for cloning
+over plain HTTP. The exported files are only `HEAD`, `info/refs`,
+`objects/info/packs` and `objects/pack/`: no git configuration, hooks
+or local paths. ladle writes the pages beside these files.
+
+The clone's committed tree is the source of every page. A detached
+deployment checkout is supported too: the publishing service chooses
+main, and the helper names its commit `main` only in the temporary
+store. Uncommitted
+files and the generated source site do not enter it. In particular,
+`public/source/` must stay ignored: committing a source browser's own
+output would publish a copy of the previous output on the next build.
+
+The result lives at `public/source/`, browsed and cloned at
+. To build just this part,
+after the normal downloads exist:
+
+```sh
+make site-source
+```
+
+Or run `python3 site/source.py` directly. `--ladle /path/to/ladle`
+overrides the bundled executable for development. `--url` may give
+another absolute address ending in `/source/`, for
+previewing the feeds and clone line. `source.theme` starts from
+ladle's paper theme, with raz's page and link colours; ladle checks
+its light and dark contrast when it runs.
+
+## Releases and downloads
+
+Each supported tag from `v0.7.1` onward gets its existing Linux
+x86-64 compiler archive and a separate source archive of the tagged
+commit. Source archives use `git archive` and gzip without a timestamp;
+their names include the version, and they do not include submodules.
+ladle writes each artifact's size and SHA-256 on its release page,
+with a downloadable `.sha256` beside it.
+
+`releases` lists distributions whose tags have not yet been pushed:
+one `vX.Y.Z FULL_COMMIT_HASH` per line, with `#` comments. The commit
+must be on `main`'s first-parent line. A tag added later must name the
+same commit; otherwise the build fails. Remove a manifest row only
+after that tag exists. This records existing distributions; the site
+build never creates tags or compiler releases.
+
+`release-notes/vX.Y.Z.md`, when present, supplies that version's notes.
+Otherwise an annotated tag supplies them. The three untagged website
+distributions have notes here that identify their pending tags.
+
+Both builders read this list through `releases.py`, so the home page
+and source browser offer the same versions. An existing distribution
+can also be given as `vX.Y.Z=COMMIT` on either helper's command line;
+`make site RELEASES='vX.Y.Z=COMMIT'` passes it to both. Permanent
+distributions belong in the manifest rather than a remembered command.
+
+## Headers and hosting
+
+ladle's header rules are prefixed with `/source` and merged into the
+root `public/_headers` between marked comments. Rebuilding replaces
+that block, preserving other root rules. Its general security policy
+therefore applies only to `/source/*`, including raw files and git
+objects. `source.py` never changes `_redirects`, so `/download/latest`
+continues to work. Cloudflare reads the root header file; the nested
+one is not enough.
+
+The new source tree is built in a temporary directory before replacing
+the old one. The complete output is counted before it is installed:
+at most 20,000 files, each at most 25 MiB. A 20 MiB pack target is not
+a guarantee, since git may place a larger object in its own pack.
+The final file check catches that too. No total-byte limit is assumed;
+the build prints total bytes for review against the hosting plan.
+
+Before deploying, serve `public/` locally, clone `/source/` and run
+`git fsck` in the clone. Download a compiler and its checksum from a
+release page, check it, then unpack it and compile Hello. Repeat the
+clone and download checks against the live address after deployment;
+a local file server does not test Cloudflare's headers.
+
+`python3 site/check.py` checks release identity and ordering against
+small real Git repositories, including shallow deployment checkouts,
+and rejects a damaged bundled builder. `make check` remains the
+compiler's required check before committing.
+
+The Wrangler configuration runs `make site-source` before deployment.
+The usual `npx wrangler deploy` therefore generates the ignored source
+browser from the committed repository before uploading the assets.
+It uses the already generated main pages and distributions; it does
+not run the compiler, pandoc or the tours on the deployment machine.
diff --git a/site/build.py b/site/build.py
index 785f691..15663ae 100644
--- a/site/build.py
+++ b/site/build.py
@@ -3,7 +3,8 @@
python3 site/build.py [vX.Y.Z=COMMIT ...]
-Each vX.Y.Z=COMMIT is a release whose tag isn't pushed yet: it is
+site/releases records website distributions whose tags are not pushed
+yet. Each additional vX.Y.Z=COMMIT is another such distribution: it is
offered as if the tag were at COMMIT, its tarball made by make dist
with VERSION, the same tarball the tag will give.
@@ -37,6 +38,7 @@
with raz on the path, and shown with what it printed.
"""
import hashlib, html, os, re, shutil, subprocess, sys, tempfile
+from releases import refs
HERE = os.path.dirname(os.path.abspath(__file__))
ROOT = os.path.dirname(HERE)
@@ -237,6 +239,7 @@
("tour", "tour/index.html", "Raz, Set, Go"),
("advanced", "advanced/index.html", "More Raz"),
("spec", "spec.html", "Report"),
+ ("source", "source/index.html", "Source"),
("get", "index.html#download", "Download")])
return """
@@ -260,10 +263,10 @@
%s
-
+