Skip to content

ci: compose reusable products and add Depot routing - #1113

Merged
ndizazzo merged 24 commits into
mainfrom
codex/ci-composable-pr-builds
Jul 30, 2026
Merged

ci: compose reusable products and add Depot routing#1113
ndizazzo merged 24 commits into
mainfrom
codex/ci-composable-pr-builds

Conversation

@ndizazzo

@ndizazzo ndizazzo commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

This restructures CI around one immutable product pipeline:

source -> neutral host + native runtime -> verified product-v2 -> smoke / SDK / packaging

  • PR, main, release, SDK smoke, and GPU paths use the same composable host/runtime producers, product composer, and smoke restoration contracts.
  • Linux GPU runtimes are independent producers; Windows builds one neutral host plus independent CPU/CUDA/ROCm/Vulkan runtimes.
  • Static ABI is produced once and fanned out. Consumers fail rather than rebuilding missing producer inputs.
  • The Node addon is an immutable five-target release producer; downstream packaging verifies its checksummed release artifacts instead of rebuilding native code.
  • PR CI remains change-routed and debug-profiled; main/release retain exhaustive release-profile coverage.
  • Native caches use exact OS/toolchain epochs and validate restored ABI contracts.
  • Release extraction, tags, assets, manifests, checksums, identity, and trust boundaries fail closed.
  • Public-mesh readiness is manual; normal readiness checks are hermetic.
  • Obsolete runner-provider references are removed from source and PR text.

GitHub-hosted control

Current head: 60488208f704b49593531804a0c300b491456cab

Workflow Result Wall Aggregate runner Aggregate job queue Maximum job queue
PR Builds green 42m05s 4h16m43s 2h14m33s 12m03s
PR Quality green 14m15s
PR Website green 43s
Controlled same-input attempt 1 green 31m06s 4h18m31s 12m29s
Controlled same-input attempt 2 green 34m43s 4h22m04s 2m30s

All jobs above used GitHub-hosted or existing dedicated GPU runners. They are not Depot timings.

Historical PR Builds, 20-run sample: p50 33m12s, p90 45m21s, p95 55m33s, maximum 69m01s. The latest run stayed below historical p90 despite unusually high queue pressure. Its critical path was the 31m35s Windows CUDA producer, followed by a 2m16s thin composer and 3s summary. Queue and execution are reported separately.

The latest run completed 48 jobs with no failures. It uploaded 36 artifacts totaling 2.823 GiB: 16 immutable producer inputs, seven composed products, 11 machine-readable sccache evidence artifacts, and two inference-binary artifacts. Linux and Windows composers downloaded the exact expected neutral-host digest, combined it with the exact runtime digest, verified the product, and observed client readiness.

Cache evidence

The PR cache policy uses writable job-local sccache. Trusted main/release/warmers own shared compiler-cache publication.

Latest downloadable sccache evidence:

Signal Result
evidence files 11
compile requests 4,584
classified hits / misses 3 / 3,881
successful writes 3,881
read / write / general errors 0 / 0 / 0

The Swift producer recorded 1,234 compile requests, 1,053 misses, 1,053 successful writes, and zero cache errors, confirming the earlier write-error failure mode is fixed.

Exact native restore evidence included Linux Vulkan, Linux static ABI, macOS dynamic Metal, macOS static Metal, and Swift hits. Windows CPU/CUDA/ROCm/Vulkan were expected cold misses after the corrected exact keys. Windows CUDA still completed with three sccache hits, 829 misses, and zero cache, write, or timeout errors.

The two controlled repeats are reproducible but are not Windows-native warm benchmarks: untrusted PR jobs intentionally cannot publish shared Windows ABI caches. Trusted main/warmers seed those exact epochs.

Depot evidence and rollback

DEPOT_RUNNERS_ENABLED remains absent/false. Regular PR workflows remain on GitHub-hosted runners.

The isolated canary has no checkout, permissions: {}, validates architecture/image identity, exercises authenticated WebDAV sccache, and separately tests actions/cache.

First real cold canary: 30521012517.

  • Six real Depot jobs succeeded.
  • Wall: 12m37s; synchronized queue: 12m04s; critical execution: 31s; aggregate runner execution: 3m03s.
  • Intel and ARM architecture checks passed.
  • WebDAV sccache totals: four hits, two misses, two writes, zero errors.
  • Same-run repository-scoped cache sharing meant sibling runner sizes observed hits; this is not represented as six independent cold probes.

The first warm assertion 30521970209 correctly exposed an actions/cache prefix collision between the unsuffixed and sized runner labels. The canary now uses delimiter-safe v2 keys, with regression coverage.

Corrected v2 sequence at merge SHA 3e30937ada7f4ff0dae61396c25b00ea09d392a9:

Run Result Wall Aggregate queue Aggregate execution actions/cache
cold green 37s 6s 3m08s six exact misses, then six saves
warm green 37s 6s 3m04s six exact primary-key hits

Every row queued for one second. Intel labels passed x86_64, ARM labels passed aarch64, and image identity, WebDAV endpoint, and authentication guards passed. Every WebDAV sccache probe hit with zero errors or timeouts; the entry already existed from the earlier repository-scoped canary, so this is a clean actions/cache cold/warm sequence but not a fresh sccache cold-write measurement.

No general CI routing is enabled. Immediate rollback remains DEPOT_RUNNERS_ENABLED=false, which selects GitHub-hosted labels without changing producer/composer inputs. GPU runner selection is independent and unchanged.

Runner-images evidence

mesh-llm-runner-images PR #9 is merged as 4e79e68e.

The post-merge staging run is green:

  • 20 platform producers, 12 family-index composers, and one compatibility composer succeeded.
  • Exact staged digests were pulled and verified before candidate descriptors were uploaded.
  • 35 jobs succeeded and four intended promotion/latest jobs skipped.
  • Wall: 42m30s; aggregate execution: 3h14m13s; maximum queue: 22m10s.
  • All execution was GitHub-hosted; no Depot runner was used.
  • No versioned or latest aliases were promoted.

The earlier PR validation run completed in 6m22s versus 22m57s historically, a 72.3% wall reduction, with aggregate execution reduced 57.7%.

Packaging migration

mesh-packaging PR #16 applies the same build-once/stage/test/promote model.

  • Latest precheck is green.
  • TypeScript tests: 79/79; matrix validation covers nine native variants and five npm lanes.
  • Reusable staging permissions are explicit and dry/package jobs downscope to contents: read.
  • Broad secret inheritance was removed.
  • The typed planner prevents filtered dispatch from broadening native, Homebrew, or npm work.
  • Dry-run QA tests the exact final local image.
  • Publish stages once, tests the exact digest, assembles a canonical index, and promotes only tested digests.

The attempted full native/Homebrew dry run 30521970516 reached execution and failed closed because every currently published Mesh release predates the product-v2 schema and five-addon contract. Bypassing the immutable released-tag requirement would weaken the trust model. PR #16 remains draft until a compatible authorized Mesh release exists for the complete native/Homebrew/npm rehearsal.

Local validation

Mesh-LLM:

  • Python CI suite: 364 passed, 7 skipped.
  • actionlint 1.7.12, YAML, Bash syntax, ShellCheck, and git diff --check: clean.
  • cargo run -p xtask -- repo-consistency release-targets: passed.
  • cargo fmt --all --check: clean.
  • cargo test -p mesh-llm --test qa_nightly_stability: 6/6.
  • cargo check -p mesh-llm: passed.
  • cargo clippy -p mesh-llm --all-targets -- -D warnings: passed.
  • just --fmt --check and just build: passed.

Packaging:

  • TypeScript tests: 79/79.
  • Matrix coverage: 100% lines, branches, and functions.
  • actionlint, YAML, ShellCheck, and git diff --check: clean.

PowerShell is unavailable locally; the green GitHub-hosted Windows matrix is the execution evidence.

Summary by CodeRabbit

  • New Features

    • Added reusable build and verification workflows for platform runtimes, SDKs, static artifacts, and release packages.
    • Added CI performance metrics and cache evidence reporting.
    • Added safer archive extraction and checksum validation for downloaded artifacts.
  • Bug Fixes

    • Improved cross-platform build consistency, runtime reuse, and artifact integrity checks.
    • Prevented untrusted pull-request jobs from accessing restricted runners or remote caches.
  • Documentation

    • Updated CI, release, SDK, and infrastructure documentation with the new workflows and rollout guidance.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c2b10575-1cb1-412a-a217-2e0e21c588e6

📥 Commits

Reviewing files that changed from the base of the PR and between 9f0bc21 and 6048820.

📒 Files selected for processing (114)
  • .agents/skills/manage-ci/SKILL.md
  • .agents/skills/manage-ci/references/current-inventory.md
  • .github/actionlint.yaml
  • .github/actions/capture-sccache-stats/action.yml
  • .github/actions/capture-sccache-stats/capture.py
  • .github/actions/compose-product-input/action.yml
  • .github/actions/compute-changes/action.yml
  • .github/actions/configure-sccache-gha/action.yml
  • .github/actions/install-actionlint/action.yml
  • .github/actions/prepare-host-input/action.yml
  • .github/actions/prepare-native-runtime-input/action.yml
  • .github/actions/prepare-native-sdk-input/action.yml
  • .github/actions/prepare-static-abi-input/action.yml
  • .github/actions/prepare-windows-host-input/action.yml
  • .github/actions/resolve-native-toolchain-epoch/action.yml
  • .github/actions/restore-smoke-inputs/action.yml
  • .github/actions/restore-windows-abi-cache/action.yml
  • .github/actions/select-ci-runners/action.yml
  • .github/actions/setup-windows-rocm-sdk/action.yml
  • .github/workflows/ci.yml
  • .github/workflows/depot-canary.yml
  • .github/workflows/docker-precheck.yml
  • .github/workflows/docker.yml
  • .github/workflows/fly-deploy-console.yml
  • .github/workflows/hf-download-smoke.yml
  • .github/workflows/llama-upstream-canary.yml
  • .github/workflows/native-sdk-artifact.yml
  • .github/workflows/nightly-stability-run.yml
  • .github/workflows/nightly-stability.yml
  • .github/workflows/node-sdk-addon-artifact.yml
  • .github/workflows/pr_auto_assign.yml
  • .github/workflows/pr_builds.yml
  • .github/workflows/pr_cleanup.yml
  • .github/workflows/pr_quality.yml
  • .github/workflows/pr_website.yml
  • .github/workflows/queue-unsloth-layer-packages.yml
  • .github/workflows/release.yml
  • .github/workflows/reset-caches.yml
  • .github/workflows/scripted-binary-smoke.yml
  • .github/workflows/sdk-smoke.yml
  • .github/workflows/smoke.yml
  • .github/workflows/stale-prs.yml
  • .github/workflows/static-abi-artifact.yml
  • .github/workflows/swift-sdk-artifact.yml
  • .github/workflows/website-pages.yml
  • .github/workflows/windows-warm-caches.yml
  • README.md
  • RELEASE.md
  • ci/DEPOT_MIGRATION.md
  • ci/METRICS.md
  • ci/ci.md
  • ci/metrics/2026-07-29-pr-builds-baseline.json
  • crates/mesh-llm/tests/qa_nightly_stability.rs
  • docs/AGENTS.md
  • docs/SDK.md
  • docs/design/TESTING.md
  • install.ps1
  • scripts/build-host.sh
  • scripts/build-llama.sh
  • scripts/build-release.sh
  • scripts/build-windows.ps1
  • scripts/ci-client-readiness-process.py
  • scripts/ci-compose-product-input.sh
  • scripts/ci-kotlin-sdk-smoke.sh
  • scripts/ci-prepare-native-runtime.sh
  • scripts/ci-rust-sdk-smoke.sh
  • scripts/ci-swift-sdk-smoke.sh
  • scripts/collect-ci-metrics.py
  • scripts/compose-product-bundle.py
  • scripts/generate-native-runtime-release-manifest.sh
  • scripts/package-native-sdk.sh
  • scripts/package-release.ps1
  • scripts/package-release.sh
  • scripts/plan-pr-build-jobs.py
  • scripts/prepare-llama.sh
  • scripts/restore-native-sdk-input.sh
  • scripts/restore-static-abi-input.sh
  • scripts/safe-extract-tar.py
  • scripts/safe-extract-zip.py
  • scripts/summarize-sccache-stats.py
  • scripts/tests/test_build_release.py
  • scripts/tests/test_build_windows.py
  • scripts/tests/test_ci_artifact_actions.py
  • scripts/tests/test_ci_client_readiness_process.py
  • scripts/tests/test_ci_prepare_native_runtime.py
  • scripts/tests/test_ci_workflow_artifacts.py
  • scripts/tests/test_collect_ci_metrics.py
  • scripts/tests/test_depot_canary_workflow.py
  • scripts/tests/test_generate_native_runtime_release_manifest.py
  • scripts/tests/test_install_ps1.py
  • scripts/tests/test_native_artifact_verifiers.py
  • scripts/tests/test_package_release_ps1.py
  • scripts/tests/test_plan_pr_build_jobs.py
  • scripts/tests/test_pr_builds_summary.py
  • scripts/tests/test_pr_workflow_artifacts.py
  • scripts/tests/test_prepare_llama.py
  • scripts/tests/test_release_workflow_artifacts.py
  • scripts/tests/test_reusable_workflow_runner_trust.py
  • scripts/tests/test_safe_extract_tar.py
  • scripts/tests/test_safe_extract_zip.py
  • scripts/tests/test_sccache_evidence.py
  • scripts/tests/test_static_abi_artifacts.py
  • scripts/tests/test_verify_host_dependencies.py
  • scripts/tests/test_verify_swift_xcframework.py
  • scripts/tests/test_windows_native_runtime_deps.py
  • scripts/verify-checksum-sidecar.py
  • scripts/verify-native-runtime-package.sh
  • scripts/verify-native-sdk-package.sh
  • scripts/verify-static-abi-build-stamp.py
  • scripts/verify-swift-release-artifact.sh
  • scripts/verify-swift-xcframework.py
  • sdk/swift/scripts/build-host-macos-xcframework.sh
  • tools/xtask/src/publish_consistency.rs
  • tools/xtask/src/workflow_checks.rs

📝 Walkthrough

Walkthrough

This change reorganizes CI around immutable host, runtime, SDK, and static-ABI producers with composition-only consumers. It adds strict artifact verification, planned PR job routing, Depot trust boundaries, sccache evidence capture, pinned actions, reusable workflows, release integration, security-focused extraction, and extensive contract tests.

Changes

CI artifact and runner migration

Layer / File(s) Summary
Shared producer and verification actions
.github/actions/*, scripts/verify-*, scripts/safe-extract-*
Host, runtime, SDK, static-ABI, composition, restoration, checksum, and extraction contracts are implemented as reusable actions and scripts.
Planned PR and platform workflows
.github/workflows/ci.yml, .github/workflows/pr_builds.yml, .github/workflows/pr_quality.yml
Linux, macOS, and Windows jobs use planned routing, immutable artifacts, independent runtime producers, and composition-only product jobs.
Release and reusable artifact workflows
.github/workflows/release.yml, .github/workflows/*-artifact.yml, .github/workflows/sdk-smoke.yml
Release, SDK, Swift, Node addon, static ABI, and smoke workflows consume typed producer artifacts and use pinned actions.
Build and packaging scripts
scripts/build-*.sh, scripts/package-*, scripts/ci-*
Build stamping, prebuilt reuse, runtime selection, product packaging, release composition, and SDK smoke flows are updated for immutable inputs.
Validation and documentation
scripts/tests/*, ci/*, docs/*, README.md, RELEASE.md
Workflow contracts, artifact integrity, runner trust, cache behavior, metrics, and migration documentation are added or expanded.

Estimated code review effort: 5 (Critical) | ~120 minutes

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/ci-composable-pr-builds

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request is currently a draft. Reviews will not take place until the PR is marked as ready for review.

@ndizazzo
ndizazzo force-pushed the codex/ci-composable-pr-builds branch from f89bec9 to ac5e517 Compare July 29, 2026 22:15
@ndizazzo
ndizazzo marked this pull request as ready for review July 30, 2026 08:02
@github-actions
github-actions Bot requested a review from michaelneale July 30, 2026 08:02
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