Repository navigation
ci(nightly-next): build the tip at once and install its tree's attested client when the tree publishes - #27531
teamleaderleo wants to merge 6 commits into
Conversation
… when the tree publishes A tree-changing landing waited about 27 minutes for its cmux-tui tree (build, R2 upload, tree publish, marker) before its NEXT nightly could start. Main's promote guard now accepts such a commit when its nightly.yml carries NIGHTLY_NEXT_TREE_AT_INSTALL: v1 (#27498). This is that nightly: - resolve-nightly-cmux-tui-client: a tip whose tree is a clean 404 is built as it is (tree_pending, with its same-key first-parent candidates); - build-nightly-app compiles at once. Bundle acpmux gets a stand-in input (the phase only aliases bin/acpmux to bin/cmux), and "Bundle the cmux-tui client" waits for the tree's attested manifest (await-tree-client.sh), then installs it with the same install-cmux-tui-client.sh command; - await-nightly-tree-marker gates publish-nightly on the build commit's tree-commit marker naming the installed client's commit (G5, in the run); - request-nightly-next.sh requests such a tip while an artifacts run builds its tree. nightly.yml stays under its size limit: two steps live in scripts/ci/nightly-steps/ and some comments in the touched jobs are shorter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-a7306ef145c005ad24ab
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
web and size checks: green |
|
Found 9 test failures on Blacksmith runners: Failures
|
|
Bead |
|
Review (codex gpt-6-astra high, next-review): BLOCK at 18c51bd
Tests could not run in this read-only, partial review snapshot. |
|
Owned by an agent session · session |
…own, resumed or recovered Review findings on 18c51bd: - publish-nightly's source selection takes this run's own build only when await-nightly-tree-marker passed (or the build never waited for its tree), so a recovered build can no longer stand in while the own build is used; - the marker check also runs for an unsigned resume, against the commit the resumed app installed; - recovery refuses a run whose marker check failed, was cancelled or has not finished (recover-tree-marker-ok.sh); - await-tree-client.sh reads each candidate's own artifacts runs before the newest-50 listing, so a crowded listing never reads as no publisher. publish-nightly's own if clause is left as it is (#27508 changes it). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-a7306ef145c005ad24ab
…ightly-tree-at-install
…s size limit Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-a7306ef145c005ad24ab
…t (no gh api paginate) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-a7306ef145c005ad24ab
|
Stage measurements for the NEXT nightly, for this lane's freshness work. Source: first attempts of the last 16 nightly.yml nightly-next push runs, 2026-10-29 21:42Z to 00:04Z.
So land → publish is about 60-75 min even with no queue: about 27 min before promotion plus about 37 min in the run. Since 23:43Z the base Release compile has also been red (00d6d54, #26517 × #27223). Fix: #27722. Side effect: in every run, Agent session: agent session |
…dled The sign variant now reads build-nightly-app.outputs.cmux_tui_commit first (the commit await-tree-client.sh found while the tip tree publishes), so the universal-build guard accepts that expression instead of the resolver output alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Superseded by #28197, a backlog-drain carry that keeps this PR's commits and their authorship, merges current base and keeps the marker-eligible source selection. Closing this one in its favour. |
* ci(nightly-next): build the tip at once and install its tree's client when the tree publishes A tree-changing landing waited about 27 minutes for its cmux-tui tree (build, R2 upload, tree publish, marker) before its NEXT nightly could start. Main's promote guard now accepts such a commit when its nightly.yml carries NIGHTLY_NEXT_TREE_AT_INSTALL: v1 (#27498). This is that nightly: - resolve-nightly-cmux-tui-client: a tip whose tree is a clean 404 is built as it is (tree_pending, with its same-key first-parent candidates); - build-nightly-app compiles at once. Bundle acpmux gets a stand-in input (the phase only aliases bin/acpmux to bin/cmux), and "Bundle the cmux-tui client" waits for the tree's attested manifest (await-tree-client.sh), then installs it with the same install-cmux-tui-client.sh command; - await-nightly-tree-marker gates publish-nightly on the build commit's tree-commit marker naming the installed client's commit (G5, in the run); - request-nightly-next.sh requests such a tip while an artifacts run builds its tree. nightly.yml stays under its size limit: two steps live in scripts/ci/nightly-steps/ and some comments in the touched jobs are shorter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-a7306ef145c005ad24ab * ci(nightly-next): the tree marker gates the build the run publishes, own, resumed or recovered Review findings on 18c51bd: - publish-nightly's source selection takes this run's own build only when await-nightly-tree-marker passed (or the build never waited for its tree), so a recovered build can no longer stand in while the own build is used; - the marker check also runs for an unsigned resume, against the commit the resumed app installed; - recovery refuses a run whose marker check failed, was cancelled or has not finished (recover-tree-marker-ok.sh); - await-tree-client.sh reads each candidate's own artifacts runs before the newest-50 listing, so a crowded listing never reads as no publisher. publish-nightly's own if clause is left as it is (#27508 changes it). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-a7306ef145c005ad24ab * ci(nightly): shorter warm-checkout comment keeps nightly.yml under its size limit Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-a7306ef145c005ad24ab * ci(nightly-next): the recovery marker check reads one bounded job list (no gh api paginate) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-a7306ef145c005ad24ab * test(nightly): sign variants require the client build-nightly-app bundled The sign variant now reads build-nightly-app.outputs.cmux_tui_commit first (the commit await-tree-client.sh found while the tip tree publishes), so the universal-build guard accepts that expression instead of the resolver output alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-d35d25d288d130b0c84c * fix(nightly-next): gate resume with bundled tree client Agent-Session: https://cmux.com/deeplink/agent?id=aid-d35d25d288d130b0c84c * fix(nightly-next): gate resume with bundled tree client Agent-Session: https://cmux.com/deeplink/agent?id=aid-d35d25d288d130b0c84c * fix(nightly-next): carry bundled client through resume receipt Agent-Session: https://cmux.com/deeplink/agent?id=aid-d35d25d288d130b0c84c * fix(nightly-next): publish when marker wait is skipped Agent-Session: https://cmux.com/deeplink/agent?id=aid-d35d25d288d130b0c84c * fix(nightly-next): use synthetic tree key for resumed build Agent-Session: https://cmux.com/deeplink/agent?id=aid-d35d25d288d130b0c84c * fix(nightly-next): read resumed client from app archive Agent-Session: https://cmux.com/deeplink/agent?id=aid-d35d25d288d130b0c84c --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
Leo: "it is unacceptable to have nightlies >30min out of date."
What is slow
When a landing changes the cmux-tui tree key, its NEXT nightly could not start until that tree was compiled, published and marked. Measured on today's feat-cmux-next pushes (cmux-tui artifacts runs 40913738554, 40918933039 and 40921878495):
build / build <target>legsThe nightly itself then takes 24-40 min (median about 30; nightly.yml runs 40868602625 to 40920248555). So these landings published 52-58 min after they landed. About a quarter of landings change the key.
The app does not need the tree to compile. In a Release build, "Bundle cmux-tui" is in pin mode, and "Bundle acpmux" only makes
bin/acpmuxan alias ofbin/cmux. The tree's client is installed afterxcodebuild, in "Bundle the cmux-tui client". On the dedicated builder that compile takes a median 2.1 min.What changes
Main's promote guard already accepts such a commit when its nightly.yml carries
NIGHTLY_NEXT_TREE_AT_INSTALL: v1(#27498, merged). This PR adds that line and the nightly that honours it. The client is fetched by tree, never rebuilt: the same attested manifest, through the sameinstall-cmux-tui-client.shcommand.scripts/ci/nightly-steps/resolve-tree-pending.sh, handles the nightly-next tip:verify-keyexit 1), the tip is built as it is:tree_pending=true, plus its same-key first-parent candidates, oldest first.$CMUX_NEXT_ACPMUX_BIN.ref, which is absent in both paths.scripts/cmux-next/await-tree-client.sh. Once the tree is published, it takes the commit thatverify-keynames, exactly as today. Before that, it takes the first candidate whose commit-addressed manifest has been uploaded (the manifest is written last, after the attestation).publish-nightlyneeds it whenever the build wastree_pending. The build commit's tree-commit marker must exist, name the build's key, and name the installed client's commit aspublishedBy. This is G5's check, moved into the run.prepare-nightly-variantchecks the bundled client against that installed commit.scripts/ci/nightly-steps/and some comments in the touched jobs got shorter.Byte-identity proof
Both paths ran on one fleet Mac (an AWS M4 Pro, macOS 27.0.1, Xcode 26.6) for one commit, 5828634. Its tree b00b2f91b8e0 was published by c230bb5, the oldest of 14 same-key candidates. Each path starts from the same skeleton app and runs the real scripts:
resolve-newest-published; theninstall-cmux-tui-client.sh,strip-release-bundle.sh,write-cmux-tui-version.shand the capability check.await-tree-client.sh, with the tree hidden by a curl wrapper that answers 404 fortree/<key>/, as before publication; then the same install.Results (full log kept with the run; key lines):
cmuxin bothThe compiled app is not in this diff because
xcodebuildis unchanged. Its only new input is the stand-in path above, which no phase copies. The fleet Mac has no gh, so both paths installed with--allow-unattested. CI's install still verifies the manifest's build-provenance attestation, and that code is unchanged.Tests
scripts/cmux-next/tests/nightly-tree-at-install.test.sh(new, 14 cases, run in cmux-next.yml's script tests) covers:scripts/cmux-next/tests/request-nightly-next.test.sh, new cases for a building tip:tests/test_nightly_next_recovery.py: publish-nightly'sifand needs..github/nightly-step-coverage.json: the three new steps.tests/test_nightly_step_coverage.py,tests/test_workflow_file_size.py(nightly.yml 489,822 bytes, limit 490,000),tests/test_nightly_cmux_tui_resolve.py,tests/test_nightly_stop_if_publish_doomed.pyand 63 other nightly/CI workflow tests. Six others fail the same way on base here, because of this host's sparse checkout or missing macOS tools:test_ci_nightly_push_throttle,test_nightly_next_arm64_only,test_nightly_next_guard,test_nightly_next_identity,test_nightly_next_live_feed_check,test_nightly_universal_build.sh(same failing line).Review fixes (second head)
await-nightly-tree-markerpassed (OWN_TREE). A recovered build can no longer be selected while an unmarked own build is skipped. The job'sifis unchanged.await-nightly-tree-markeralso runs for an unsigned resume, against the commit the resumed app installed.await-nightly-tree-markerfailed, was cancelled, has not finished or cannot be read (scripts/ci/nightly-steps/recover-tree-marker-ok.sh).await-tree-client.shreads each candidate's own artifacts runs (pin-cmux-tui.sh runs-state), so a crowded listing never reads as "no publisher".Performance
The remaining critical path is the manifest upload (about 20 min) plus the post-build chain (about 18 min); both have their own PRs.
Timers:
await-tree-client.shpolls the CDN every 20 s for at most 45 min, and ends early when the client is ready or when two run checks find no publisher.await-tree-marker.shpolls every 20 s for at most 50 min, inside a 60-min job. Both are bounded and end with the step.Risk:
🤖 Generated with Claude Code
Agent session: agent session