Skip to content

ci(build): the wasm job: the deploy bundle's two Workers in release at pull-request time, under the bundle's cache key (Build phase, stage 2) - #356

Merged
aRustyDev merged 3 commits into
mainfrom
ci/build-stage-wasm
Nov 23, 2026
Merged

aRustyDev merged 3 commits into
mainfrom
ci/build-stage-wasm

Conversation

@aRustyDev

Copy link
Copy Markdown
Owner

Stage 2 of the Build phase (.agents/plans/ci-workflows/phases/0004-build.md): the job wasm in build.yml. It builds the two Workers the deploy bundle ships, in release for wasm32-unknown-unknown, with the bundle's own commands (the wiring test holds each command and directory equal to build-bundle's), checks that each wrote worker/shim.mjs, index.js and a non-empty index_bg.wasm, and uploads both for three days. It publishes, signs and attests nothing and has no secret, environment or id-token.

Why a job at pull-request time, and why under the bundle's cache key

  • The edge Worker's release build is proved by nothing before a release candidate. Only build-bundle builds it. The Worker as it ships is already built at pull-request time by the ten worker-cf cells (their wrangler.toml build command is the bundle's), and with its default features by the six worker-memory cells; this job builds it again on purpose, for the cache and the artifact. I first wrote that the cells build only the default features: that was wrong, I read the configs, and the comment and the runbook say what is true.
  • The bundle's build is cold every time: 297 s, of which 106 s compile worker-build from source and 73 + 17 s build the Workers. Its cache key, deploy-release, has never been saved, because the bundle runs on an rc/* branch or a tag, whose caches nothing else reads, and it saves none. This job runs on pull requests and on main, and saves the same key on main. In a warm Worker cell the same install line takes 0.4 s ("Ignored package worker-build v0.9.0 is already installed"). There is nothing else to fetch: workers-rs's releases have no assets and worker-build's manifest has no binstall metadata.
  • Whether the bundle really restores that cache is not shown yet: it needs main to have saved it. The record after the merge will measure it with a dry run of the bundle.

Also in it

  • A correction. The phase document said Build would make an action, build-web, for the web app's build, "created without asking" as an exact duplicate. It is not: the owner decided on 2026-11-17 (the record of ci: move the supply-chain check into security.yml, and make the verdict job's steps an action (migration M2) #258, phase 0002) that the copies are not exact and deferred the action to the Web and E2E phases. The document now says so, and Build does not touch it.
  • plan-ci.py: the job wasm, planned when thrust-worker or thrust-edge is affected (the edge crate alone is tested in a graph where the Worker does not depend on it); build now holds linux and wasm.

Evidence

Check Result
test_plan_ci.py 7058 checks
test_workflow_wiring.py 208 checks
mutate_gate.py 341 of 341 killed (313 before), 12 that change nothing survive
The file check's control the step's own text, taken from build.yml, fails for each of the six files missing, for each empty, for one Worker only and for none, and passes for all six: 16 cases
ci-commands.py against main PARITY: wasm appears, the verdict's jobs line changes, none is gone
The 28 commands of the deps job, deny, fmt, both clippy runs 28 of 28 pass locally
test-ci-scripts.sh (dash), the workflow lint, the index guard, actionlint with its control, the book pass

The measurements of the job on a runner (cold, then warm), whether the bundle restores the cache, and passes 5 to 7 come after the first runs and the merge; they go in the phase document.

🤖 Generated with Claude Code

aRustyDev and others added 2 commits November 22, 2026 22:19
…t pull-request time, under the bundle's cache key (Build phase, stage 2)

build.yml gets its second job. wasm builds the Worker as it ships (worker-build --release . --no-default-features, in crates/worker) and the edge Worker (worker-build --release ., in crates/edge) for wasm32-unknown-unknown, with the commands and directories build-bundle builds them with (the wiring test holds each pair equal), checks that each wrote worker/shim.mjs, index.js and a non-empty index_bg.wasm, and uploads both for three days. Nothing but build-bundle built the edge Worker in release before a release candidate; the Worker as it ships is built by the ten worker-cf cells too (wrangler.toml's command is the bundle's), and the job builds it again on purpose, for the cache and the artifact.

The cache key is build-bundle's, deploy-release, and main saves it. The bundle runs on an rc/* branch or a tag, whose caches nothing else reads, and it never saved one, so every bundle compiled worker-build from source (106 s of its 297). In a warm Worker cell the same install line takes 0.4 s ("already installed"), and worker-build has no prebuilt binary to fetch instead: workers-rs's releases have no assets and its manifest no binstall metadata. The job is planned when thrust-worker or thrust-edge is affected (the edge crate alone is tested in a graph where the Worker does not depend on it).

Tests and controls: test_plan_ci.py 7058 checks; test_workflow_wiring.py 208 (the bundle's commands equal line by line, the cache key's two users, the files checked, the upload, no secret); mutate_gate.py 341 of 341 killed (it was 313), the 12 that change nothing survive; the check's own text, taken from build.yml, fails for each of the six files missing or empty and passes for all six (16 cases); ci-commands.py against main: one job appears, the verdict's jobs line changes, none is gone. The action build-web that the phase document said would be made is not: the owner deferred it on 2026-11-17 (the record of #258), and the document is corrected.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… the Build plan on build-web

cicd.md gets the wasm job in the build.yml row, the planner rule, the examples re-run through the planner (a Worker change now plans wasm) and the counts that moved (208 wiring checks, 341 mutants). running.md gets the row of wasm and a runbook for it (a compiler error, worker-build writing no file, a slow run that is a cache not restored). The workflows index names the job.

phases/0004-build.md said that Build would create an action build-web for the web app's build without asking, as an exact duplicate in web.yml, build-bundle and contract-pass-tools. It is not: the owner decided on 2026-11-17 (the record of #258, phase 0002) that the copies are the same commands but not an exact copy, and deferred the action to the Web and E2E phases. The document now says so and that Build does not touch it.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@aRustyDev
aRustyDev temporarily deployed to preview-control-plane November 23, 2026 03:20 — with GitHub Actions Inactive
…he survey, the control, and what is not yet measured

Stage 2's section in phases/0004-build.md. The cold job is 238 s (run 45105438353): checkout 5.8, setup 13.8, cargo install worker-build 110.7 (47% of the job), wrangler 7.4, the Worker 74.1, the edge Worker 16.9, the check and the upload 2.6; the Worker's wasm is 5.2 MB, the edge's 0.68 MB. The numbers are the deploy bundle's own (106, 73, 17 and 7.5 s in run 45084816796), which is what holding the commands equal should give.

worker-build has no prebuilt binary (workers-rs's releases have no assets, its manifest no binstall metadata), so compiling it is avoided only by the cache, which in a warm Worker cell makes the same install line take 0.4 s. The survey names the candidates and why none replaces it; the one hand-written piece, the check that worker-build wrote its three files for each Worker, has a control (16 of 16 cases, taken from the file's own text). What is not yet measured is said so: the warm time and whether the bundle restores the cache follow the merge, because the cache is saved on main only.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@aRustyDev
aRustyDev temporarily deployed to preview-control-plane November 23, 2026 03:33 — with GitHub Actions Inactive
@aRustyDev
aRustyDev enabled auto-merge (squash) November 23, 2026 03:33
@aRustyDev
aRustyDev merged commit 6014d8a into main Nov 23, 2026
98 of 101 checks passed
@aRustyDev
aRustyDev deleted the ci/build-stage-wasm branch November 23, 2026 03:47
aRustyDev added a commit that referenced this pull request Nov 23, 2026
…): 238 s cold, 79 s warm, and the bundle restores the cache (#359)

After #356 merged, main's run saved the cache deploy-release (249.3 MB) and a dispatch of build.yml on main with the plan wasm measured the warm job: 79 s against 238 s cold, the worker-build install 110.7 s to 0.85 s, the Worker 74 s to 44 s, the edge Worker 17 s to 3 s.

The stage's purpose was the bundle, and a probe (#358, closed unmerged, a comment in build-bundle) made release.yml and deploy.yml run it in their dry runs: both restored the cache and found worker-build already installed. deploy.yml's build took 165 s (an rc build was 310 s and a dry run 313 s), release.yml's 176 s (the tags v0.4.0 and v0.3.0 were 328 and 341 s): about 145 to 165 s less on a path a release candidate and a tag wait for. The native migrate build is not helped (30.4 s, the cache holds wasm32 dependencies) and the web build is unchanged. What it does not show is said: a pull request's dry run stood in for a release candidate and a tag, which restore the default branch's cache by GitHub's rule, so the first real release candidate proves it; the nightly full run restores the key daily, which keeps it from the seven-day eviction.

Passes 6 and 7 change nothing, with numbers: the job is on no critical path (a full run is 711 s, set by the e2e cell), and the one waste in it, the wrangler install (7.8 s, no command calls it), would cost a change to the action every Rust job shares and to the attested bundle build, for 0.15% of a full run. The status lines say stage 2 is done and stage 3, macos, is next.

Co-authored-by: Claude Sonnet 5.5 <[email protected]>

This branch was previously deployed

1 inactive deployment
preview-control-plane — df576bba Deployed Nov 23, 2026 by aRustyDev via reconcile #649
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant