From 7c7138fb01a781b32cb02b787ee0057fe962cc68 Mon Sep 17 00:00:00 2001 From: Markus Neusinger <2921697+MarkusNeusinger@users.noreply.github.com> Date: Fri, 4 Sep 2026 20:59:37 +0200 Subject: [PATCH 1/3] docs(cloudflare): fix the Worker deploy recipe's filename and the stale callout The curl example uploaded the module under the local basename (`anyplot-api-proxy.js`), which Cloudflare's `main_module: "worker.js"` never matches, so a scripted deploy answered 400 "No such module: worker.js" (observed live 2026-09-04). Add the explicit `filename=worker.js` override and one sentence on why it's required. Also replace the stale "needs a redeploy" callout with the actual deployed state as of 2026-09-04. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01UEScQMZFvxxNNyNJYryfa3 --- .../cloudflare-worker-deploy-filename.md | 17 ++++++++++++++++ infra/cloudflare/README.md | 20 ++++++++++++------- 2 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 changelog.d/cloudflare-worker-deploy-filename.md diff --git a/changelog.d/cloudflare-worker-deploy-filename.md b/changelog.d/cloudflare-worker-deploy-filename.md new file mode 100644 index 00000000000..aef0806926a --- /dev/null +++ b/changelog.d/cloudflare-worker-deploy-filename.md @@ -0,0 +1,17 @@ +### Fixed + +- **The Worker deploy recipe now uploads a module Cloudflare can find.** + `infra/cloudflare/README.md`'s `curl` example named the multipart part + `worker.js=@infra/cloudflare/anyplot-api-proxy.js;type=application/javascript+module`, + but curl defaults the part's `filename` to the local file's basename + (`anyplot-api-proxy.js`) unless told otherwise, and Cloudflare resolves the + metadata's `main_module: "worker.js"` against that filename, not the form + field — so the API answered `400 — Uncaught Error: No such module: + worker.js` (observed live 2026-09-04). The example now sets + `filename=worker.js` explicitly, with a sentence explaining why. + +- **The README's "needs a redeploy" callout is replaced with the deployed + state.** The Worker was redeployed from the current `.js` after #11221, the + Transform Rule now covers `anyplot.ai`, `www.anyplot.ai` and + `api.anyplot.ai`, and `/api/event` measured `off-seen` — the callout named a + pending step that had already happened. diff --git a/infra/cloudflare/README.md b/infra/cloudflare/README.md index 8483456abb9..84d53fc653a 100644 --- a/infra/cloudflare/README.md +++ b/infra/cloudflare/README.md @@ -20,12 +20,11 @@ verdicts, and one rollout procedure — the API's is done, the app's is **The `.js` is the source, not a draft.** Change it here and deploy it; change it in the dashboard and pull it back here. -> **After this lands, the Worker needs a redeploy.** The -> `X-Origin-Secret` lines are newer than the running script, so the repository -> and the deployment are out of step until it is pushed. Until then the Worker -> stamps nothing, `anyplot.ai/api/health` answers `off`, and arming the gate -> would take that route down — which is exactly what the rollout order in the -> pull-request description prevents. +> **Deployed state (2026-09-04).** The Worker was redeployed from the current +> `.js` after #11221; the Transform Rule now covers `anyplot.ai`, +> `www.anyplot.ai` and `api.anyplot.ai`, and `/api/event` measured `off-seen`. +> The standing rule still holds: the `.js` here mirrors the deployed bytes, so +> the next edit to it needs its own redeploy. ## The Worker @@ -131,10 +130,17 @@ json.dump({ "https://api.cloudflare.com/client/v4/accounts/{account}/workers/scripts/anyplot-api-proxy" \ --config <(printf 'header = "Authorization: Bearer %s"\n' "$CF_API_TOKEN") \ -F 'metadata=<-;type=application/json' \ - -F 'worker.js=@infra/cloudflare/anyplot-api-proxy.js;type=application/javascript+module' + -F 'worker.js=@infra/cloudflare/anyplot-api-proxy.js;filename=worker.js;type=application/javascript+module' ) ``` +**The explicit `filename=worker.js` is required.** Cloudflare resolves the +`main_module` named in the metadata (`worker.js`) against each part's +*filename*, not its form-field name; curl otherwise defaults the filename to +the local file's basename (`anyplot-api-proxy.js`), which does not match, and +the API answers `400 — Uncaught Error: No such module: worker.js` (observed +live 2026-09-04). + `pipefail` so a failing `python3` cannot be masked by a succeeding `curl`; `--fail-with-body` so an HTTP error is a non-zero exit and still prints Cloudflare's JSON reason, which plain `-f` swallows. From cd98b4f7f97575b23c254d45b88f0664d35e5271 Mon Sep 17 00:00:00 2001 From: Markus Neusinger <2921697+MarkusNeusinger@users.noreply.github.com> Date: Fri, 4 Sep 2026 21:00:32 +0200 Subject: [PATCH 2/3] chore(changelog): PR reference on the cloudflare deploy-filename fragment Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01UEScQMZFvxxNNyNJYryfa3 --- changelog.d/cloudflare-worker-deploy-filename.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/changelog.d/cloudflare-worker-deploy-filename.md b/changelog.d/cloudflare-worker-deploy-filename.md index aef0806926a..7a1ce215260 100644 --- a/changelog.d/cloudflare-worker-deploy-filename.md +++ b/changelog.d/cloudflare-worker-deploy-filename.md @@ -8,10 +8,10 @@ metadata's `main_module: "worker.js"` against that filename, not the form field — so the API answered `400 — Uncaught Error: No such module: worker.js` (observed live 2026-09-04). The example now sets - `filename=worker.js` explicitly, with a sentence explaining why. + `filename=worker.js` explicitly, with a sentence explaining why. (#11222) - **The README's "needs a redeploy" callout is replaced with the deployed state.** The Worker was redeployed from the current `.js` after #11221, the Transform Rule now covers `anyplot.ai`, `www.anyplot.ai` and `api.anyplot.ai`, and `/api/event` measured `off-seen` — the callout named a - pending step that had already happened. + pending step that had already happened. (#11222) From ea738d01dbaef4f6eedf67b452567fae0b4dc86e Mon Sep 17 00:00:00 2001 From: Markus Neusinger <2921697+MarkusNeusinger@users.noreply.github.com> Date: Fri, 4 Sep 2026 21:03:03 +0200 Subject: [PATCH 3/3] docs(cloudflare): add the Oxford comma to the hostname list Applies the repository prose rule (write-docs skill) per Copilot review on PR #11222. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01UEScQMZFvxxNNyNJYryfa3 --- changelog.d/cloudflare-worker-deploy-filename.md | 2 +- infra/cloudflare/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/changelog.d/cloudflare-worker-deploy-filename.md b/changelog.d/cloudflare-worker-deploy-filename.md index 7a1ce215260..fc0578338a8 100644 --- a/changelog.d/cloudflare-worker-deploy-filename.md +++ b/changelog.d/cloudflare-worker-deploy-filename.md @@ -12,6 +12,6 @@ - **The README's "needs a redeploy" callout is replaced with the deployed state.** The Worker was redeployed from the current `.js` after #11221, the - Transform Rule now covers `anyplot.ai`, `www.anyplot.ai` and + Transform Rule now covers `anyplot.ai`, `www.anyplot.ai`, and `api.anyplot.ai`, and `/api/event` measured `off-seen` — the callout named a pending step that had already happened. (#11222) diff --git a/infra/cloudflare/README.md b/infra/cloudflare/README.md index 84d53fc653a..853ddf320eb 100644 --- a/infra/cloudflare/README.md +++ b/infra/cloudflare/README.md @@ -22,7 +22,7 @@ it in the dashboard and pull it back here. > **Deployed state (2026-09-04).** The Worker was redeployed from the current > `.js` after #11221; the Transform Rule now covers `anyplot.ai`, -> `www.anyplot.ai` and `api.anyplot.ai`, and `/api/event` measured `off-seen`. +> `www.anyplot.ai`, and `api.anyplot.ai`, and `/api/event` measured `off-seen`. > The standing rule still holds: the `.js` here mirrors the deployed bytes, so > the next edit to it needs its own redeploy.