mirror of
https://github.com/redwoodjs/local-ci.git
synced 2026-09-19 07:54:29 +08:00
7a349fdb43
## Problem Agent CI still depended on the TypeScript runner as the main execution path. That made it harder to ship a small native binary and harder to prove the Rust path matched the TypeScript path. Review also found places where Rust and TypeScript could drift before the Rust path becomes the default. ## Solution This PR adds the opt-in Rust native `agent-ci` binary and platform npm packages while keeping the TypeScript fallback. It splits the Rust code into `agent-ci-core`, `agent-ci-runtime`, and a thin CLI/orchestration crate. Pure planning, reusable workflow expansion, event contracts, and run-result contracts now live in core; runtime owns Docker, DTU, runner, macOS VM, workspace, execution-plan adapters, and the generic wave worker pool. The fixture checks now use real TypeScript helpers instead of a shadow planner. Shared fixtures cover plans, events, run results, Docker socket resolution, and default job-limit CPU/memory vectors. The Rust runner honors `--jobs`, probes Docker memory for the default job limit, supports macOS VM concurrency limits, avoids nested runner container name collisions, has `--all` smoke coverage, and stages `bin/agent-ci` in every platform package. ## Validation - `cargo check --workspace --all-targets` - `cargo fmt --all -- --check` - `cargo clippy --workspace --all-targets -- -D warnings` - `cargo test --workspace --all-targets` - `pnpm check` - `pnpm fixtures:check` - `pnpm golden:cli` - `pnpm rust:smoke:parity` - `pnpm agent-ci-dev run --all -q -p --json --github-token` ## Notes Rust execution is still opt-in. The TypeScript implementation and fallback remain in place until the later default-switch and removal gates pass.
1.0 KiB
1.0 KiB
Rust rewrite performance snapshot
Generated by pnpm rust:perf on 2026-05-22T12:46:26.802Z.
| Benchmark | min | avg | max |
|---|---|---|---|
| startup: TypeScript --help | 74.8 ms | 78.6 ms | 84.2 ms |
| startup: Rust --help | 2.1 ms | 26.1 ms | 120.4 ms |
| workflow parse: TypeScript diff parser | 6524.2 ms | 7077.1 ms | 7789.5 ms |
| workflow parse: Rust smoke discovery | 4720.1 ms | 6023.9 ms | 6720.4 ms |
| job orchestration: Rust matrix discovery | 13246.2 ms | 13441.7 ms | 13598.1 ms |
Notes:
- Rust workflow execution parity is validated separately; workflow benchmarks time the release binary path and accept any known Agent CI exit status.
- The TypeScript workflow-parse comparison uses the existing differential parser script to avoid launching Docker jobs.
- Re-run before switching defaults so release notes include current numbers from the final release build.