From 56cd8d4cbf531ca8cd9635491845d54bafda49c6 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 23 Nov 2026 00:13:04 -0600 Subject: [PATCH] docs(pm-console): record what was built and what checking from outside found (2026-11-23) A dated section in the edge's design record, and one line in the plan's progress: the Worker stood up from nothing and released by GitHub; the Android app built by GitHub and signed and released by the host that holds its key; the two faults no test under bun could see (a request's upload, and fetch called as a method, which kept every notification from leaving the deployed Worker); what the real push services, the accessibility rules and the live site's public surface showed; the Releases screen; one stand-up that failed and is not explained; and what was not checked. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_01YLT5K1QVuzZjfWGFhXSSNF --- ...T11-10-00Z_architecture_pm_console_edge.md | 123 ++++++++++++++++++ planning/plans/2026-11-21_results-first.md | 1 + 2 files changed, 124 insertions(+) diff --git a/doc/2026-11-22T11-10-00Z_architecture_pm_console_edge/2026-11-22T11-10-00Z_architecture_pm_console_edge.md b/doc/2026-11-22T11-10-00Z_architecture_pm_console_edge/2026-11-22T11-10-00Z_architecture_pm_console_edge.md index 719f0ff6f1..e3b1a68357 100644 --- a/doc/2026-11-22T11-10-00Z_architecture_pm_console_edge/2026-11-22T11-10-00Z_architecture_pm_console_edge.md +++ b/doc/2026-11-22T11-10-00Z_architecture_pm_console_edge/2026-11-22T11-10-00Z_architecture_pm_console_edge.md @@ -257,3 +257,126 @@ could happen before the build was put into reports. edge says it has none, hands nothing out, and asks for the build again. Pieces left by a larger build are removed whether or not its record survived. + +## 2026-11-23T06:10Z Update: released by itself, and what checking from outside found + +Asked for: the app built and released by GitHub with nobody involved, +the Worker stood up from nothing and deployed by GitHub, every page +checked, notifications shown to work, and an audit end to end. + +### The Worker is stood up and released by GitHub (#12765, #12775) + +- `edge/release.mjs` decides from Cloudflare's own answers what a + release needs: a Worker that is not there is first stood up empty + (`edge/init/`, which answers 503 so nothing is routed to it), then the + commit is uploaded as a version and promoted; one that is there is + uploaded and promoted; a change to how the object is declared is a + full deploy. A release whose health check does not come back as that + commit puts the previous version back. +- On request, and whenever the release itself changes, the same path is + first run against a throwaway Worker, from nothing to serving and + gone again. +- The deploy runs the bundle in the Worker runtime (`wrangler dev`) + against a host on the runner before anything is uploaded. That exists + because of the first fault below, and it found the second. + +- One stand-up from nothing failed tonight and is not explained. At + `dec4e883b8b6` (run 45121364544) the scratch Worker answered as + empty, took the version at 100%, and then gave no health answer for + four minutes; the run put the empty version back, removed the scratch + Worker and failed, with production untouched, as designed. The same + steps one commit later (run 45122274288, `40e0c2ac4418`) answered + within a second, and production took that commit. The run could only + say "silent"; since #12976 a wait that fails says what it heard (the + status and the start of the body, or the error), so the next one will + be explained. + +### Two faults no test under bun could see + +Both are the same lesson: the tests run the Worker's code under bun, +and bun is not the runtime it is deployed to. + +1. **A request's upload** (#12775). `request.clone()` with the first + copy never read stalls the second in the Worker runtime. The first + report from a host hung for twenty seconds. Fixed by reading the + copy that is not used. +2. **`fetch` as a method** (#12954). The runtime's `fetch` refuses to be + called as a method of another object ("Illegal invocation"). The + edge kept the global `fetch` on itself and called it as + `this.fetchImpl(url)`. From its first deploy, every notification it + tried to send failed before leaving, it never read the Android + release, and the queue half of direct mode would have failed the + moment it was switched on. The failures were caught and counted and + shown nowhere. It was found because health had just been made to say + which release the edge knows of, and on the deployed Worker it said + none. + +What is in place so that neither kind returns quietly: + +- No class keeps a `fetch` it was given; each keeps a plain caller + (`src/plain.ts`). +- The stand-in `fetch` in the tests refuses to be called as a method, as + the runtime's does. Against the code as it was, 21 tests fail on it. +- The run in the real runtime checks that the state can make a request + of its own, and that files are tagged and revalidated. +- Health says, to anyone, which release the edge knows of and, when it + could not ask, why (`androidRelease`, `androidReleaseTrouble`). + +Decision: a thing the runtime can refuse and bun cannot gets both a +stand-in that refuses in the tests and a check in the real-runtime run. +A feature whose failure is caught and counted must also be shown: the +Notifications screen now says what came of the last send. + +### The app is built by GitHub and signed where its key is (#12770, #12940) + +- GitHub builds on every change to the app; the version is the + commit's, so each build installs over the one before. +- GitHub does not hold the signing key. Moving it there was considered + and not done: nothing here holds or moves the key. Instead the host + that holds it runs `android/release-built.sh` every ten minutes + (`pm-console-android-release.timer`): it takes the newest unsigned + build this repository made on `main`, signs it there, refuses a + result that does not carry the certificate the site lists, and + releases it. What leaves the host is the signed APK, which is public. +- The first release made that way, `2026.11.23-0f311ae`, was published + five and a half minutes after its merge. Checked from outside with + `apksigner`: signed by the listed certificate (v2 and v3), and its 55 + files are byte for byte the ones GitHub built. +- If the owner one day puts the key into GitHub's environment, the + workflow signs and releases by itself and the host finds nothing to + do. That is his choice; nothing waits on it. + +### Notifications, checked against the real push services (#12934) + +- The console's own sender was run against Mozilla's service (received + over the network and opened with a decryption that shares nothing + with this code) and Google's (a real Chrome subscribed; Google took + the message). +- Found: a Chrome off the stable channel names `jmt17.google.com`, which + the sender refused; and the Notifications screen said "On" when the + sender did not hold the device. Both fixed. The service worker has + tests that run the file itself. +- The larger fault, that nothing left the deployed Worker at all, is + the second one above. + +### The audit (#12946), and one screen more (#12967) + +- Every screen through the axe rules in both themes: 24 failures in the + light theme (status colours made for the dark page, links told by + colour alone, a skipped heading level), now none. +- The app's files are tagged and revalidated, where every visit used to + download them again. +- More, Releases: what is deployed and released, and putting either out + again, which until now was done by asking in a chat. + +### Not checked + +- The signed-in pages of the live site: no browser with the owner's + sign-in was available, and none was made. Checked instead: every + screen on the test copies, the bundle in the real runtime, and the + live site's public surface. +- A notification arriving on a phone. Seen: Google and Mozilla taking + the message, Mozilla delivering it, the service worker showing it in + a real Chrome, and the deployed Worker now able to make requests. +- A deploy started from the app on the laptop (it goes through + `fleet gh` there). diff --git a/planning/plans/2026-11-21_results-first.md b/planning/plans/2026-11-21_results-first.md index 82c8f365cf..0aa4ee4219 100644 --- a/planning/plans/2026-11-21_results-first.md +++ b/planning/plans/2026-11-21_results-first.md @@ -336,3 +336,4 @@ To undo: revert the plan's PR. The skills are additive and are loaded by descrip - 2026-11-22: The laptop had stopped deploying merges for two hours: an empty rebuild marker commit on its `main` made the fast-forward-only sync stand still, 28 merges behind. Repaired by hand, then #12515 taught `pm-git-sync` to move empty markers aside (in service after the next system rebuild). A rebuild commit that changes `flake.lock` still diverges (#12520). - 2026-11-22: #12517 added More, Sign-in: the steps, the two addresses and a form that turn Google sign-in on from the app. The Google client itself still has to be made by a signed-in person (#12417). Not built: the edge acting on the queue and GitHub by itself while the laptop is away; designed in #12518. Also filed: #12519 (linked phones across an edge on/off change), #12521 (limit the report endpoint, Android build at the edge, `cf` deploy flow). - 2026-11-23: The fleet built the edge acting by itself while the laptop is away (#12579); it is deployed and off. #12712 made turning it on the owner's switch in the app (More, Laptop away) and made the script behind it need nothing installed. #12715: reports refused unread from an address that keeps sending bad ones, and `hostVersion` in the edge's health, which showed the laptop taking merges with no access to the laptop. #12719: a unit that keeps failing on its timer is reported. The signed Android build is kept at the edge. Open: turning direct mode on and its laptop-away check (#12518), rebuild commits that change `flake.lock` (#12520), the `cf` deploy flow (#12561), the Android library upgrade. +- 2026-11-23: The console releases itself, and was checked from outside. The Worker is stood up from nothing and released by GitHub Actions with a rollback (#12765); the Android app is built by Actions and signed and released by the host that holds its key, every ten minutes (#12770, #12940; first release `2026.11.23-0f311ae`, verified with `apksigner` against the listed certificate). Found by running things for real: the deployed edge could not make a request of its own, so no notification it sent had ever left and it never read the app's release (#12954; the tests' stand-in `fetch` now refuses what the Worker runtime refuses, 21 tests fail on the old code); a Chrome off the stable channel could not turn notifications on (#12934); the light theme failed 24 accessibility rules and every visit downloaded the app again (#12946). Added More, Releases (#12967). The scheduled pm-stack tests, red every night since 2026-11-20 and hiding six suites, are green (#12936). Checked by `bun test` in `pm-stack/console` (196 passed) and the deploy's run of the bundle in the Worker runtime. Not checked: the live site's signed-in pages, and a notification arriving on a phone.