diff --git a/docs/reference.md b/docs/reference.md index 7f0ff9583..b271197d0 100644 --- a/docs/reference.md +++ b/docs/reference.md @@ -3441,6 +3441,15 @@ since the signature has held; the log says the file went unattested. A (`gh attestation trusted-root`, first line) when Sigstore rotates its public good keys; until then a new chain fails as "not attested". +The same bundles are kept on R2 (`site/files.js`, `keepBundles`): the five-minute +cron asks that API for each file's digest of a release from v0.1.3891 on and, +once every file has one, writes `/attestations.jsonl` (a bundle to a line), +served at `https://usemagpie.ai/files//attestations.jsonl` and checked with +`gh attestation verify -R yetone/magpie-releases --bundle +attestations.jsonl`. It is not a release asset (the release's count is +unchanged), is written only whole, and is pruned with its tag. The updater does +not read it yet; it still asks GitHub's API (ArcticLampyrid on X). + The feed hands the app that `SHA256SUMS` and signature (`signed`). The app checks the signature against its key, takes every file's SHA-256 from the signed list, and refuses the update when the signature is missing or does not diff --git a/site/files.js b/site/files.js index 536c0c305..ac643d6be 100644 --- a/site/files.js +++ b/site/files.js @@ -10,6 +10,14 @@ // R2 only for files it has with that hash, so nothing is ever only on R2. // The app checks every file against the feed's hash wherever it came from. // +// The build provenance goes the same way. Release CI attests every file +// (SLSA, Sigstore; v0.1.3891 on) and GitHub keeps the bundles behind its +// API, which can be down when the files are not. The cron copies them into +// R2 as one file per release, /attestations.jsonl, a bundle to a line, +// which `gh attestation verify -R yetone/magpie-releases --bundle +// attestations.jsonl` takes offline (ArcticLampyrid on X). It is not a +// release asset, so the release's file count is unchanged. +// // Each release is about 1 GB; the tags the feeds name and the KEEP newest // besides are kept, the rest deleted (prune), and an older tag's files go // to GitHub. @@ -19,6 +27,10 @@ const KEEP = 4; // minutes on) doesn't copy the same file beside it const BUDGET = 4 * 60e3; +// the first release whose files carry a build attestation +const ATTESTED = "0.1.3891"; +export const BUNDLES = "attestations.jsonl"; + export function githubFile(repo, tag, name) { return `https://github.com/${repo}/releases/download/${tag}/${name}`; } @@ -110,8 +122,10 @@ export function onR2(rel, have, repo, site) { // mirror copies into R2 each file of rels (the feeds' releases, with // their hashes) it doesn't hold yet, then prunes. open(name, asset, tag) // is the file's bytes from GitHub (a Response), null when GitHub won't -// give them. Returns {copied, failed}. -export async function mirror(env, rels, open, now = Date.now) { +// give them. attest(sha256) is the attestation bundles GitHub holds for a +// digest (an array of objects), null when it can't say. Returns {copied, +// failed}. +export async function mirror(env, rels, open, now = Date.now, attest = null) { const done = { copied: [], failed: [] }; if (!env.RELEASES) return done; const until = now() + BUDGET; @@ -129,11 +143,46 @@ export async function mirror(env, rels, open, now = Date.now) { if (await copy(env, tag, name, a, open)) done.copied.push(`${tag}/${name}`); else done.failed.push(`${tag}/${name}`); } + if (attest && !(BUNDLES in have) && byVersion(tag, "v" + ATTESTED) >= 0 && now() <= until) { + if (await keepBundles(env, tag, rel, attest)) done.copied.push(`${tag}/${BUNDLES}`); + else done.failed.push(`${tag}/${BUNDLES}`); + } } await prune(env, tags); return done; } +// keepBundles puts every attestation GitHub has for rel's files in R2 as +// /attestations.jsonl. It writes nothing unless every file has one, so +// the next run asks again rather than keep a list with holes in it. +async function keepBundles(env, tag, rel, attest) { + const lines = new Set(); + for (const [name, a] of Object.entries(rel.assets)) { + if (!a.sha256) continue; + let got = null; + try { + got = await attest(a.sha256); + } catch (e) { + console.log("r2 attest: github", tag, name, String(e)); + } + if (!Array.isArray(got) || !got.length) { + console.log("r2 attest: none for", tag, name); + return false; + } + for (const b of got) lines.add(JSON.stringify(b)); + } + if (!lines.size) return false; + try { + await env.RELEASES.put(`${tag}/${BUNDLES}`, [...lines].join("\n") + "\n", { + httpMetadata: { contentType: "application/jsonl", contentDisposition: `attachment; filename="${BUNDLES}"` }, + }); + return true; + } catch (e) { + console.log("r2 attest: put", tag, String(e)); + return false; + } +} + async function copy(env, tag, name, a, open) { let res = null; try { diff --git a/site/files.test.mjs b/site/files.test.mjs index e6a408c50..b9b70509a 100644 --- a/site/files.test.mjs +++ b/site/files.test.mjs @@ -151,3 +151,38 @@ test("mirror: without the bucket, or with R2 failing, nothing is copied and noth env.RELEASES.fail = true; assert.deepEqual(await mirror(env, [{ version: "1", assets: { a: { sha256: "x" } } }], async () => new Response("a")), { copied: [], failed: [] }); }); + +test("mirror: a release's attestation bundles land in R2 as attestations.jsonl, once, and only whole (ArcticLampyrid on X)", async () => { + const env = { RELEASES: bucket() }; + const rel = { version: "0.1.3891", assets: { a: { sha256: sha("A") }, b: { sha256: sha("B") } } }; + const open = async (name) => new Response(name === "a" ? "A" : "B"); + const asked = []; + let missing = sha("B"); + const attest = async (h) => { + asked.push(h); + return h === missing ? null : [{ mediaType: "bundle", for: h }]; + }; + // one file has none yet: nothing is written, the next run asks again + let done = await mirror(env, [rel], open, Date.now, attest); + assert.deepEqual(done.failed, ["v0.1.3891/attestations.jsonl"]); + assert.equal(env.RELEASES.objs.has("v0.1.3891/attestations.jsonl"), false); + missing = ""; + done = await mirror(env, [rel], open, Date.now, attest); + assert.deepEqual(done.copied, ["v0.1.3891/attestations.jsonl"]); + const res = await ask(env, "/files/v0.1.3891/attestations.jsonl"); + assert.equal(res.status, 200); + const lines = (await res.text()).trimEnd().split("\n").map((l) => JSON.parse(l)); + assert.deepEqual(lines.map((l) => l.for).sort(), [sha("A"), sha("B")].sort()); + // held: it is not asked for again + asked.length = 0; + await mirror(env, [rel], open, Date.now, attest); + assert.deepEqual(asked, []); +}); + +test("mirror: a release from before the attestations is not asked for any", async () => { + const env = { RELEASES: bucket() }; + const rel = { version: "0.1.3890", assets: { a: { sha256: sha("A") } } }; + let asked = 0; + await mirror(env, [rel], async () => new Response("A"), Date.now, async () => (asked++, [])); + assert.equal(asked, 0); +}); diff --git a/site/public/docs/ja/start.html b/site/public/docs/ja/start.html index 190027f04..31e8e6633 100644 --- a/site/public/docs/ja/start.html +++ b/site/public/docs/ja/start.html @@ -355,7 +355,7 @@ magpie claude group/opus-anywhere # これを使う

インストーラと magpie update にプロキシを渡します:curl -fsSL https://usemagpie.ai/install.sh | sh -s -- --proxy http://127.0.0.1:7890、または magpie update --proxy socks5://127.0.0.1:1080(http・https・socks5・socks5h に対応。HTTPS_PROXY と ALL_PROXY も使われます)。リリースファイルは usemagpie.ai(Cloudflare R2)から取得し、失敗したときは github.com から取得します。--mirror <prefix> を付けると、サイトからの取得に失敗したとき、指定した GitHub ダウンロードミラーから <prefix>https://github.com/… としてリリースファイルを取得します。magpie update mirror <prefix> でアプリ自身の更新を含め毎回使い、magpie update mirror off で解除します。指定しない限りミラーは使われず、ファイルの SHA-256 はミラーではなく常に usemagpie.ai から取得するので、ミラーが書き換えたファイルはインストールされません。アプリ自身の更新は Settings → Proxy を通ります。

ダウンロードしたファイルが GitHub Actions でビルドされたものか確認するには?

-

yetone/magpie-releases の各ファイルには SLSA ビルド来歴(build provenance)の証明が付いています。GitHub Actions の実行自身の ID で Sigstore を通して署名されており、こちらの鍵は使いません。GitHub CLI で確認します:gh attestation verify magpie-darwin-arm64.dmg -R yetone/magpie-releases。ビルドした workflow と実行が表示され、その実行が作っていないファイルは失敗します。yetone/magpie の Releases にあるコピーにも同じコマンドが使えます。v0.1.3891 以降が対象です。証明が指すのは magpie-releases リポジトリとそのコミットで、yetone/magpie のソースのコミットではありません。アプリ自身の更新は両方を検証します:リリースの SHA-256 一覧に付いた ed25519 署名を magpie に組み込まれた鍵で確認し(オフラインでも usemagpie.ai のミラーからでも有効)、v0.1.3891 以降はさらに GitHub からそのファイルの証明を取得して、GitHub に証明が無いファイルや、このリポジトリのリリース workflow によるものではない証明のファイルはインストールしません。GitHub に接続できないときは署名だけで更新を続け、ログに記録します。

+

yetone/magpie-releases の各ファイルには SLSA ビルド来歴(build provenance)の証明が付いています。GitHub Actions の実行自身の ID で Sigstore を通して署名されており、こちらの鍵は使いません。GitHub CLI で確認します:gh attestation verify magpie-darwin-arm64.dmg -R yetone/magpie-releases。ビルドした workflow と実行が表示され、その実行が作っていないファイルは失敗します。yetone/magpie の Releases にあるコピーにも同じコマンドが使えます。v0.1.3891 以降が対象です。証明が指すのは magpie-releases リポジトリとそのコミットで、yetone/magpie のソースのコミットではありません。アプリ自身の更新は両方を検証します:リリースの SHA-256 一覧に付いた ed25519 署名を magpie に組み込まれた鍵で確認し(オフラインでも usemagpie.ai のミラーからでも有効)、v0.1.3891 以降はさらに GitHub からそのファイルの証明を取得して、GitHub に証明が無いファイルや、このリポジトリのリリース workflow によるものではない証明のファイルはインストールしません。GitHub に接続できないときは署名だけで更新を続け、ログに記録します。 同じ証明は usemagpie.ai にも、ミラーしたファイルの隣に置かれており、GitHub が使えないときも取得できます:https://usemagpie.ai/files/v<バージョン>/attestations.jsonl には、そのリリースの全ファイル分のバンドルが 1 行に 1 つ入っています。ファイルと一緒にダウンロードすれば、証明 API を使わずに確認できます:gh attestation verify magpie-darwin-arm64.dmg -R yetone/magpie-releases --bundle attestations.jsonl(バンドルは Sigstore バンドルです。ミラーには新しいリリースだけが残るので、古いものは上のコマンドを使ってください)。

Linux ではインストーラはどのビルドを入れますか?

GTK 3 と WebKitGTK 4.1 が入っていればデスクトップアプリ(ウィンドウ、トレイアイコン、アプリメニューの項目)です。デスクトップがあってもそれらが無いときは、パッケージマネージャー(apt、dnf、pacman、zypper)で sudo を通して WebKitGTK 4.1 を入れ(sudo がパスワードを尋ねます)、それからアプリを入れます。パスワードを尋ねる前に何を入れるかを表示します。端末が無いとき(CI、Dockerfile)、sudo が無いとき、知らないディストリビューションやインストールに失敗したときはターミナル版(magpie tui、magpie web と CLI)を入れ、最後に入れるコマンドを表示します。Debian・Ubuntu なら sudo apt install libwebkit2gtk-4.1-0、Fedora なら sudo dnf install webkit2gtk4.1 です。入れたあとインストーラをもう一度実行するとアプリになります。デスクトップ上で実行しても ssh 越しでも、グラフィカルなセッション、あなたのグラフィカルなログイン、ログインできるデスクトップ環境のどれかがあればデスクトップありと判断します。デスクトップの無いサーバーにはターミナル版です。自分で選ぶには --gui(ライブラリを今入れられなくてもアプリ)か --tui(ターミナル版、パッケージは入れない)を付けます:curl -fsSL https://usemagpie.ai/install.sh | sh -s -- --tui。

diff --git a/site/public/docs/start.html b/site/public/docs/start.html index d0ff50eda..b807b24f6 100644 --- a/site/public/docs/start.html +++ b/site/public/docs/start.html @@ -355,7 +355,7 @@ magpie claude group/opus-anywhere # use it

Give the installer and magpie update a proxy: curl -fsSL https://usemagpie.ai/install.sh | sh -s -- --proxy http://127.0.0.1:7890, or magpie update --proxy socks5://127.0.0.1:1080 (http, https, socks5 and socks5h; HTTPS_PROXY and ALL_PROXY are honoured too). Release files come from usemagpie.ai (Cloudflare R2), and from github.com when that fails. --mirror <prefix> fetches the release file from a GitHub download mirror you choose, as <prefix>https://github.com/…, when the site’s copy fails; magpie update mirror <prefix> keeps it for every update, the app’s too, and magpie update mirror off removes it. No mirror is used unless you give one, and the file’s SHA-256 still comes from usemagpie.ai, never from the mirror: a file the mirror changed is refused. The app’s own updates go through Settings → Proxy.

How do I check that a download was built by GitHub Actions?

-

Every file on yetone/magpie-releases carries a SLSA build provenance attestation, signed through Sigstore with the GitHub Actions run’s own identity and no key of ours. With the GitHub CLI: gh attestation verify magpie-darwin-arm64.dmg -R yetone/magpie-releases. It shows the workflow and run that built the file, and fails for a file that run didn’t produce. The same command works on the copy in yetone/magpie’s Releases. From v0.1.3891 on. The attestation names the magpie-releases repo and its commit, not the source commit in yetone/magpie. The app’s own updates check both: the release’s SHA-256 list carries an ed25519 signature, checked against a key built into magpie (offline, and also for a file from usemagpie.ai’s mirror), and from v0.1.3891 on the app also asks GitHub for the file’s attestation and refuses a file that GitHub has none for or whose attestation is not from this repo’s release workflow. When GitHub can’t be reached, the update goes on on the signature alone and the log says so.

+

Every file on yetone/magpie-releases carries a SLSA build provenance attestation, signed through Sigstore with the GitHub Actions run’s own identity and no key of ours. With the GitHub CLI: gh attestation verify magpie-darwin-arm64.dmg -R yetone/magpie-releases. It shows the workflow and run that built the file, and fails for a file that run didn’t produce. The same command works on the copy in yetone/magpie’s Releases. From v0.1.3891 on. The attestation names the magpie-releases repo and its commit, not the source commit in yetone/magpie. The app’s own updates check both: the release’s SHA-256 list carries an ed25519 signature, checked against a key built into magpie (offline, and also for a file from usemagpie.ai’s mirror), and from v0.1.3891 on the app also asks GitHub for the file’s attestation and refuses a file that GitHub has none for or whose attestation is not from this repo’s release workflow. When GitHub can’t be reached, the update goes on on the signature alone and the log says so. The same attestations are kept on usemagpie.ai, beside the mirrored files, so they are there when GitHub is not: https://usemagpie.ai/files/v<version>/attestations.jsonl holds one bundle per line for every file of the release. Download it with the file and check offline of the attestation API: gh attestation verify magpie-darwin-arm64.dmg -R yetone/magpie-releases --bundle attestations.jsonl (the bundles are Sigstore bundles; a release that is not among the newest on the mirror falls back to the command above).

Which build does the installer put on Linux?

The desktop app (window, tray icon and a menu entry) when GTK 3 and WebKitGTK 4.1 are installed. On a computer with a desktop but without them, the installer installs WebKitGTK 4.1 with your package manager (apt, dnf, pacman or zypper), through sudo, which asks for your password, and then the app; it says what it installs before it asks. Run without a terminal (CI, a Dockerfile), without sudo, on another distribution or when that install fails, it installs the terminal build (magpie tui, magpie web and the CLI) and ends with the command that installs them, such as sudo apt install libwebkit2gtk-4.1-0 on Debian and Ubuntu or sudo dnf install webkit2gtk4.1 on Fedora; run the installer again afterwards for the app. A desktop counts whether you run it there or over ssh: a graphical session, your graphical login, or a desktop installed to log in to. A server without one gets the terminal build. To choose yourself, add --gui (the app even when its libraries can't be installed now) or --tui (the terminal build, and no package installed): curl -fsSL https://usemagpie.ai/install.sh | sh -s -- --tui.

diff --git a/site/public/docs/zh/start.html b/site/public/docs/zh/start.html index ddc9ae473..3c855c3c5 100644 --- a/site/public/docs/zh/start.html +++ b/site/public/docs/zh/start.html @@ -355,7 +355,7 @@ magpie claude group/opus-anywhere # 使用它

给安装脚本和 magpie update 加代理:curl -fsSL https://usemagpie.ai/install.sh | sh -s -- --proxy http://127.0.0.1:7890,或 magpie update --proxy socks5://127.0.0.1:1080(支持 http、https、socks5、socks5h;环境变量 HTTPS_PROXY、ALL_PROXY 同样生效)。发布文件从 usemagpie.ai(Cloudflare R2)下载,失败时改从 github.com 下载。--mirror <前缀> 在站点下载失败时从你指定的 GitHub 下载镜像取发布文件,即 <前缀>https://github.com/…;magpie update mirror <前缀> 让之后每次更新(包括应用自己的更新)都用它,magpie update mirror off 取消。不指定就不用任何镜像;文件的 SHA-256 始终来自 usemagpie.ai,而不是镜像,镜像改过的文件会被拒绝安装。应用自己的更新走 设置 → 代理。

怎么确认下载的文件是 GitHub Actions 构建的?

-

yetone/magpie-releases 上的每个文件都带有 SLSA 构建来源证明(build provenance),由 GitHub Actions 运行自身的身份通过 Sigstore 签发,不用我们自己的密钥。用 GitHub CLI 校验:gh attestation verify magpie-darwin-arm64.dmg -R yetone/magpie-releases。它会显示构建该文件的 workflow 和运行,不是这次运行产出的文件会校验失败。yetone/magpie 的 Releases 页上的副本用同一条命令。从 v0.1.3891 起提供。证明指向的是 magpie-releases 仓库及其提交,而不是 yetone/magpie 里的源码提交。应用自己的更新两层都校验:发布的 SHA-256 清单带有 ed25519 签名,用内置在 magpie 里的公钥校验(离线可用,文件来自 usemagpie.ai 的镜像时同样有效);从 v0.1.3891 起应用还会向 GitHub 取该文件的构建证明,GitHub 没有证明、或证明不是出自本仓库发布 workflow 的文件不会被安装。连不上 GitHub 时,更新仍凭签名继续,并在日志里说明。

+

yetone/magpie-releases 上的每个文件都带有 SLSA 构建来源证明(build provenance),由 GitHub Actions 运行自身的身份通过 Sigstore 签发,不用我们自己的密钥。用 GitHub CLI 校验:gh attestation verify magpie-darwin-arm64.dmg -R yetone/magpie-releases。它会显示构建该文件的 workflow 和运行,不是这次运行产出的文件会校验失败。yetone/magpie 的 Releases 页上的副本用同一条命令。从 v0.1.3891 起提供。证明指向的是 magpie-releases 仓库及其提交,而不是 yetone/magpie 里的源码提交。应用自己的更新两层都校验:发布的 SHA-256 清单带有 ed25519 签名,用内置在 magpie 里的公钥校验(离线可用,文件来自 usemagpie.ai 的镜像时同样有效);从 v0.1.3891 起应用还会向 GitHub 取该文件的构建证明,GitHub 没有证明、或证明不是出自本仓库发布 workflow 的文件不会被安装。连不上 GitHub 时,更新仍凭签名继续,并在日志里说明。 同样的证明也保存在 usemagpie.ai 上、镜像文件的旁边,GitHub 不可用时照样能取:https://usemagpie.ai/files/v<版本号>/attestations.jsonl 每行一个 bundle,覆盖该版本的所有文件。把它和文件一起下载,即可不依赖证明 API 校验:gh attestation verify magpie-darwin-arm64.dmg -R yetone/magpie-releases --bundle attestations.jsonl(bundle 是 Sigstore bundle;镜像里保留较新的几个版本,更早的版本请用上面的命令)。

Linux 上安装脚本装的是哪个版本?

装了 GTK 3 和 WebKitGTK 4.1 时装桌面版(窗口、托盘图标和应用菜单项)。有桌面但缺这两个库时,脚本会用系统的包管理器(apt、dnf、pacman 或 zypper)通过 sudo 装上 WebKitGTK 4.1(sudo 会要你的密码),再装桌面版;要密码之前会先说要装什么。没有终端(CI、Dockerfile)、没有 sudo、发行版不认识或者装库失败时,先装终端版(magpie tui、magpie web 和命令行),最后给出装库的命令,比如 Debian、Ubuntu 上是 sudo apt install libwebkit2gtk-4.1-0,Fedora 上是 sudo dnf install webkit2gtk4.1;装好后再运行一次安装脚本就换成桌面版。在桌面上运行还是 ssh 进去运行都算有桌面:有图形会话、你登录着图形界面,或者装了可登录的桌面环境。没有桌面的服务器装终端版。想自己选,加 --gui(库现在装不上也装桌面版)或 --tui(装终端版,不装任何系统包):curl -fsSL https://usemagpie.ai/install.sh | sh -s -- --tui。

diff --git a/site/public/llms-full.txt b/site/public/llms-full.txt index fdb242c55..731d79a5d 100644 --- a/site/public/llms-full.txt +++ b/site/public/llms-full.txt @@ -245,7 +245,7 @@ Give the installer and `magpie update` a proxy: `curl -fsSL https://usemagpie.ai ### How do I check that a download was built by GitHub Actions? -Every file on [yetone/magpie-releases](https://github.com/yetone/magpie-releases/releases) carries a SLSA build provenance attestation, signed through Sigstore with the GitHub Actions run’s own identity and no key of ours. With the [GitHub CLI](https://cli.github.com): `gh attestation verify magpie-darwin-arm64.dmg -R yetone/magpie-releases`. It shows the workflow and run that built the file, and fails for a file that run didn’t produce. The same command works on the copy in yetone/magpie’s Releases. From v0.1.3891 on. The attestation names the magpie-releases repo and its commit, not the source commit in yetone/magpie. The app’s own updates check both: the release’s SHA-256 list carries an ed25519 signature, checked against a key built into magpie (offline, and also for a file from usemagpie.ai’s mirror), and from v0.1.3891 on the app also asks GitHub for the file’s attestation and refuses a file that GitHub has none for or whose attestation is not from this repo’s release workflow. When GitHub can’t be reached, the update goes on on the signature alone and the log says so. +Every file on [yetone/magpie-releases](https://github.com/yetone/magpie-releases/releases) carries a SLSA build provenance attestation, signed through Sigstore with the GitHub Actions run’s own identity and no key of ours. With the [GitHub CLI](https://cli.github.com): `gh attestation verify magpie-darwin-arm64.dmg -R yetone/magpie-releases`. It shows the workflow and run that built the file, and fails for a file that run didn’t produce. The same command works on the copy in yetone/magpie’s Releases. From v0.1.3891 on. The attestation names the magpie-releases repo and its commit, not the source commit in yetone/magpie. The app’s own updates check both: the release’s SHA-256 list carries an ed25519 signature, checked against a key built into magpie (offline, and also for a file from usemagpie.ai’s mirror), and from v0.1.3891 on the app also asks GitHub for the file’s attestation and refuses a file that GitHub has none for or whose attestation is not from this repo’s release workflow. When GitHub can’t be reached, the update goes on on the signature alone and the log says so. The same attestations are kept on usemagpie.ai, beside the mirrored files, so they are there when GitHub is not: `https://usemagpie.ai/files/v/attestations.jsonl` holds one bundle per line for every file of the release. Download it with the file and check offline of the attestation API: `gh attestation verify magpie-darwin-arm64.dmg -R yetone/magpie-releases --bundle attestations.jsonl` (the bundles are Sigstore bundles; a release that is not among the newest on the mirror falls back to the command above). ### Which build does the installer put on Linux? diff --git a/site/worker.js b/site/worker.js index 6e72acd0e..b6fde7300 100644 --- a/site/worker.js +++ b/site/worker.js @@ -519,7 +519,14 @@ async function keepFiles(ctx, env) { const to = a.api && (await located(a.api, env)); return to ? fetch(to, { headers: UA }) : res; }; - const done = await mirror(env, rels, open); + // the attestation bundles GitHub holds for a digest, in R2 beside the files + const attest = async (sha256) => { + const res = await api(`attestations/sha256:${sha256}`, env); + if (!res.ok) return null; + const j = await res.json(); + return (j.attestations || []).map((x) => x.bundle).filter(Boolean); + }; + const done = await mirror(env, rels, open, Date.now, attest); if (done.copied.length || done.failed.length) console.log("r2", JSON.stringify(done)); }