The goal was direct deployment from the Windows 7 host. Wrangler could not be part of that path, and the Linux Raspberry Pi was not the deployment machine. The existing site builder still runs on Windows, writes the complete static site, and hands that directory to a publisher implemented with the Cloudflare Pages API. The publishing command sets the Pages token from a local command shim before it builds and publishes; the token itself stays in a separate file and is read into the process environment.
The dashboard ZIP is not the API contract
The Pages dashboard accepts a ZIP or a folder through its drag-and-drop flow. That convenience does not imply that the deployment API accepts one archive. The direct asset endpoint accepts records describing individual assets, and deployment creation later receives a manifest mapping each site path to its content hash. Wrangler's documented directory workflow and the API asset flow are therefore useful references, while the dashboard ZIP is a separate user interface operation.
A Pages asset upload record includes a key, metadata such as the content type, and the asset value encoded as base64. The publisher first asks which hashes are missing, uploads only those missing assets, registers the hashes, and then submits the deployment manifest. This separates immutable content storage from the path map that makes a particular site version visible.
Hashes identify the encoded content and its extension
Guessing the asset key from raw file bytes produced a valid-looking request but the wrong key. The compatible key is the first 32 lowercase hexadecimal characters of BLAKE3 over the base64 representation of the file bytes followed by the extension without its dot. That detail was confirmed against Wrangler's own source. A raw-byte digest, MD5, or a digest of the filename cannot substitute for it.
Hashing every file in a separate process was also needlessly expensive. The framework's BLAKE3 tool now accepts groups of strings, writes the inputs to temporary files, invokes one hasher process for the group, and extracts the fixed-width digest lines through TextFamily. The Pages publisher works in bounded groups of 20 for hashing and upload requests. It still computes local hashes on each run, but Cloudflare's missing-hash check avoids retransmitting assets it already has.
A deployment can succeed and still map every page incorrectly
The first published version returned a 404 even though the API had accepted the deployment. After correcting the content-hash algorithm, the site still returned a 404. The remaining defect was the manifest key: it used <code>index.html</code> instead of <code>/index.html</code>. Wrangler's upload implementation prefixes manifest paths with a slash. Cloudflare accepted the manifest without that prefix, but the requested URL did not match its entry. A deployment receipt proves that the API completed its workflow; it does not prove that the root URL resolves.
Verification therefore requests both the deployment URL and the canonical project URL, and checks the root page as well as the explicit <code>/index.html</code> path. In the successful deployment, both root requests returned HTTP 200 and the explicit file path redirected to the root. That distinction caught a protocol mismatch which a status poll alone could never reveal.
Windows 7 exposed a transport timeout
The Windows 7 secure-channel implementation could not complete the same HTTPS request path as a current Windows host, so the generic HTTP client used its PowerShell fallback. The fallback itself worked, but its old five-second timeout was too short for a batch upload. The framework now passes a configurable timeout through the generic HTTP client and PowerShell adapter; Pages asset uploads use 120 seconds. This belongs at the transport boundary so other API clients can choose an appropriate timeout without duplicating a Pages-specific HTTP implementation.
The diagnostics also had to preserve the complete cause chain. An exit code such as 216 only identified that a child process failed; stderr explained that the installed Node.js rejected the operating system. Keeping the command, stdout, stderr, and namespaced causes made it possible to distinguish an unsupported runtime from an API error or a broken site manifest.
Striped trousers made protocol assumptions executable
The publisher's striped-trouser scenarios check the asset hash fixture, batching, timeout selection, missing-asset behavior, and slash-prefixed manifest paths. The framework scenarios check the official BLAKE3 vectors and batched digest extraction. These tests make the previously implicit protocol assumptions visible: a future refactor cannot quietly revert to a raw-byte hash or omit the leading slash without failing the relevant leg.
The live result was then checked independently over HTTP. The successful deployment was <code>9b6dc817-b8e2-4947-a3e4-d2ff6653729c</code>; its root and the canonical project root both served the full site with HTTP 200. The API's own success state and the browser-facing result are separate observations, and both matter.
The phase output is ready to feed a deployment stream
The publisher already reports named phases to stderr: enumerate and hash assets, hash file batches, check existing hashes, upload missing assets, register hashes, create the deployment manifest, poll the deployment, and report its URL. Its receipt remains JSON on stdout. The bundler writes its entry, output path, search roots, and a final dependency summary. The blog builder currently writes a final article/card/month/search count rather than detailed build phases.
That is enough to make a server-sent-events deployment manager feasible, but not enough to claim that every stage already streams. A CGI process can relay publisher stderr as progress events and send the final receipt when it exits. For useful build progress, the builder should first report its own phase boundaries through a callback or a structured output channel. The event manager should own the HTTP/SSE framing; the builder and publisher should continue to own truthful phase messages. Separating those responsibilities keeps the deployment UI generic and makes failures carry their full error context instead of reducing them to an exit number.
