From 4d4c6dd147dd431a07cf9bdef272a6438f46e8d6 Mon Sep 17 00:00:00 2001 From: Transaction Science Date: Tue, 20 Oct 2026 22:40:03 -0400 Subject: [PATCH] wai-quantum-cli release: read the SHA-256 files over the private network The formulae job of the first full release run (wai-quantum-cli-v0.1.0) failed with a 403: it read each archive's .sha256 through its public download URL, and the public address refuses the Python library's default user agent. formulae.py now reads them at the forge's own address, the API's (over the private network, as the uploads go), with a user agent of its own. The formula and the manifest still point users at the public URLs. Run by hand against that release, it wrote both, which are attached there. Co-Authored-By: Claude Opus 5.5 --- wai/wai-quantum-cli/release/formulae.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/wai/wai-quantum-cli/release/formulae.py b/wai/wai-quantum-cli/release/formulae.py index e8ebaca7a..46e4f6573 100644 --- a/wai/wai-quantum-cli/release/formulae.py +++ b/wai/wai-quantum-cli/release/formulae.py @@ -16,7 +16,13 @@ import urllib.request version, tag, api, repo, public, out = sys.argv[1:7] token = os.environ.get("FORGE_TOKEN", "") -headers = {"Authorization": f"token {token}"} if token else {} +# A user agent of our own: the public address refuses the library's default one. +headers = {"User-Agent": "wai-quantum-release"} +if token: + headers["Authorization"] = f"token {token}" +# The forge's own address, as the API's: the SHA-256 files are read there, over the +# private network, not through the public address the formula points users to. +web = api.rsplit("/api/v1", 1)[0] def get(url): @@ -33,7 +39,7 @@ def digest(archive): if archive not in assets or archive + ".sha256" not in assets: print(f"note: {archive} is not attached; left out", file=sys.stderr) return None - return get(assets[archive + ".sha256"]["browser_download_url"]).decode().split()[0] + return get(f"{web}/{repo}/releases/download/{tag}/{archive}.sha256").decode().split()[0] def url(archive): -- 2.54.0 (Apple Git-157)