# vercel/turborepo — AlpLab Radar Static Code Audit

- Ring: `adopt`
- Category: `dev`
- Overall score: `4.5/5`
- Implementation check: `verified`
- Maturity: `mature`
- Audited commit: `cc4c6b78c638` (read-only; nothing from the repository was executed)
- Reviewed at: 2026-12-01T20:26:55Z
- Repository: https://github.com/vercel/turborepo
- Radar entry: https://radar.alplab.co/#repo/vercel/turborepo
- License: `MIT`
- CI workflows: `.github/workflows`
- Tags: `monorepo`, `build-system`, `rust`, `task-graph`, `remote-cache`, `ci`

## Summary

A production Rust CLI (`turbo`) that builds a workspace task graph from package.json/Cargo/pyproject manifests, executes tasks in parallel with content-hash-based local and optional Vercel remote caching, plus watch mode, GraphQL `turbo query`, JS/Rust/Go import tracing, shell hooks, and managed toolchain provisioning.

## Implementation Check

README.md's one-line claim ('build system for coding agents') is fully backed by working code: crates/turborepo-cli/src/commands/run.rs `run()` orchestrates execution, crates/turborepo-engine/src/lib.rs `Engine` builds and prunes the petgraph task graph, and crates/turborepo-run/src/lib.rs `Run::hash_inputs` computes file/env/lockfile hashes that drive caching.

## When to Use

Use for JS/Rust/Python/Go monorepos (or single packages) that need cached, parallel, dependency-ordered task execution, affected-only rebuilds, and `turbo query`/`turbo trace` for CI and agent workflows; skip if you need a build tool with no binary download or cannot live with its opt-out telemetry and optional Vercel-API remote-cache integration.

## Sub-scores

| Dimension | Score |
|---|---|
| quality | 5.0/5 |
| usability | 5.0/5 |
| reliability | 3.0/5 |
| security | 4.5/5 |
| integration | 5.0/5 |

## Code Evidence

crates/turborepo/src/main.rs `main()` is a thin binary delegating to `turborepo_cli::main`; crates/turborepo-cli/src/shim.rs `TurboCliRunner::run` routes global vs repository-local turbo with kill-on-close handoff; crates/turborepo-engine/src/lib.rs `retain_affected_tasks`/`watch_reachable_closure` implement affected pruning with dense `NodeMembership`; crates/turborepo-run/src/lib.rs `Run::hash_inputs` runs four hashing jobs concurrently via `rayon::scope`; crates/turborepo-task-executor/src/command.rs `ToolchainCommandProvider::command` resolves package-manager/cargo/uv/go binaries and `MicroFrontendProxyProvider` rejects unsafe config paths via `UnsafeMfeConfigPath` (traversal, drive-letter, backslash checks) plus `repository_root().contains` containment; crates/turborepo-auth/src/lib.rs `write_to_auth_file` writes 0o600 token files (`test_write_to_auth_file_sets_restricted_permissions`) with `secrecy` SecretString and Debug redaction (`token_debug_redacts_value`), and `validate_credential_destination` blocks saved Vercel credentials from arbitrary URLs; Cargo.toml enforces clippy `unwrap_used`/`expect_used` deny and native-tls/rustls-tls mutual exclusion via `compile_error!`; .github/workflows/turborepo-test.yml `rust_test` job shards nextest across macOS/Ubuntu/Windows with SHA-pinned actions; ~100 integration test files under crates/turborepo/tests (e.g. 85KB cargo_workspace_test.rs, 158KB trace_test.rs, 74KB graceful_shutdown_test.rs) cover the core run/caching/watch paths.

## Issues Found

None recorded.

## Key Risks

Remote caching and login exchange tokens with api.vercel.com (opt-in); anonymous telemetry is on by default with documented opt-out (`turbo telemetry disable`, `TURBO_TELEMETRY_DISABLED=1`) per crates/turborepo-telemetry/README.md; `turbo run --log-file` structured logging explicitly captures all task output including potential secrets (warned on stderr in run.rs); task execution runs arbitrary repo-defined scripts by design; musl hosts and Windows arm64 are excluded from managed-tool activation (hook.rs); nothing was executed, so test/CI claims are static observations of test files and workflow definitions only.

## Reviewed Files

- `README.md`
- `Cargo.toml`
- `turbo.json`
- `SECURITY.md`
- `packages/turbo/package.json`
- `crates/turborepo/src/main.rs`
- `crates/turborepo-cli/src/lib.rs`
- `crates/turborepo-cli/src/shim.rs`
- `crates/turborepo-cli/src/commands/mod.rs`
- `crates/turborepo-cli/src/commands/run.rs`
- `crates/turborepo-cli/src/commands/hook.rs`
- `crates/turborepo-engine/src/lib.rs`
- `crates/turborepo-run/src/lib.rs`
- `crates/turborepo-task-executor/src/lib.rs`
- `crates/turborepo-task-executor/src/command.rs`
- `crates/turborepo-auth/src/lib.rs`
- `crates/turborepo-auth/README.md`
- `crates/turborepo-telemetry/README.md`
- `crates/turborepo-run-cache/README.md`
- `crates/turbo-trace/README.md`
- `crates/turborepo-trace-core/README.md`
- `crates/turborepo-trace-tasks/README.md`
- `crates/turborepo-tls/Cargo.toml`
- `crates/turborepo-api-client/Cargo.toml`
- `crates/turborepo-download/Cargo.toml`
- `.github/workflows/turborepo-test.yml`
