# vercel/turborepo — codebase unpack

> Canonical page: https://codevetter.com/unpack/turborepo

This is a deterministic Repo Unpack scan of vercel/turborepo — a structural map, not a review, security audit, or maintainer-endorsed description.

- Scanned commit: 2540ee1d740bb96bf249459a7957ef4b380c9e43 (2026-10-02)
- Last upstream commit: chore: Release Turborepo 2.11.7 (#14357)
- Generated by codevetter 1.15.0 on 2026-10-02
- 4000 files scanned · 12.4 MB

Source inspection; upstream code and tests were not executed.

## Languages

- JSON: 2051 files
- TypeScript: 921 files
- Rust: 567 files
- JavaScript: 372 files
- Markdown: 371 files
- YAML: 238 files
- TOML: 110 files
- CSS: 76 files

## Repository structure

- examples/ — 658 files
- crates/ — 658 files
- lockfile-tests/ — 657 files
- turborepo-tests/ — 657 files
- packages/ — 657 files
- apps/ — 628 files
- .github/ — 32 files
- scripts/ — 12 files

Probable source entrypoint: `Cargo.toml` (inferred from the tree, not upstream docs)

## Package

- Cargo.toml: turborepo-crates — 0 declared dependencies

## Structural health signals

Average score 5.4/10 across 96 files; 89 hotspots. These are deterministic review leads, not proof of a bug.

## Recent history

- 2540ee1d740b (2026-10-02) chore: Release Turborepo 2.11.7 (#14357)
- 3ce82f57d27f (2026-10-02) fix: Ignore Vercel OIDC token rotation in .env.local cache inputs (#14356)
- 8cc3cce30705 (2026-10-01) chore: Update with-vite-module-federation example (#14349)
- 41387de0cdd2 (2026-10-01) fix: Pass SDKROOT through to repository tasks (#14353)
- 3a2072cad9ea (2026-10-01) chore: Release Turborepo 2.11.6 (#14352)

## Overview

Turborepo is a Rust-based build orchestrator for developers and coding agents working across repository packages. It discovers packages, constructs task graphs, hashes inputs, executes native toolchain commands, and restores reusable outputs from local or authenticated remote caches. This commit also includes experimental Rust, Python, and Go workspace support, repository inspection tools, JavaScript scaffolding and migration packages, a documentation site, and an internal agent workspace application.

## System map

The principal product is a native CLI organized into focused Rust crates. Startup, repository discovery, task scheduling, process execution, caching, and output rendering have separate owners. JavaScript packages and Next.js applications surround the CLI with distribution, onboarding, documentation, and internal operator tooling.
- The turbo binary handles internal LSP commands before normal startup, installs the panic handler, and delegates ordinary execution to turborepo_cli::main. — [crates/turborepo/src/main.rs#L74-104](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo/src/main.rs#L74-L104)
- The binary injects TurboQueryServer because it depends on both the CLI and GraphQL implementation; query execution is exposed through the QueryServer interface. — [crates/turborepo/src/main.rs#L32-69](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo/src/main.rs#L32-L69) [crates/turborepo-cli/src/lib.rs#L48-57](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cli/src/lib.rs#L48-L57)
- CLI argument parsing precedes Rayon and Tokio startup; run_main owns command dispatch and runtime shutdown uses shutdown_background. — [crates/turborepo-cli/src/cli/mod.rs#L324-366](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cli/src/cli/mod.rs#L324-L366)
- RunBuilder::build assembles discovery results, AsyncCache, an execution context, run services, and a repository context into Run. — [crates/turborepo-run/src/builder.rs#L2126-2136](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-run/src/builder.rs#L2126-L2136) [crates/turborepo-run/src/builder.rs#L2188-2255](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-run/src/builder.rs#L2188-L2255)
- Local cache storage uses hash-named .tar.zst archives plus restore-manifest and metadata JSON sidecars. — [crates/turborepo-cache/src/fs.rs#L92-122](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cache/src/fs.rs#L92-L122) [crates/turborepo-cache/src/fs.rs#L275-305](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cache/src/fs.rs#L275-L305)
- The npm turbo package distributes a launcher, bundled docs, and schema.json, with version-matched optional binaries for macOS, Linux, and Windows on two architectures. — [packages/turbo/package.json#L9-28](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/packages/turbo/package.json#L9-L28)
- The root provides build:turbo and turbo scripts, pins Node 24 and pnpm 12, and registers Rust crates and the repository addon in the Cargo workspace. — [package.json#L5-11](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/package.json#L5-L11) [package.json#L28-31](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/package.json#L28-L31) [Cargo.toml#L1-13](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/Cargo.toml#L1-L13)
- apps/docs is a Next.js documentation application; apps/factory is a separate operator surface whose documented workspace storage uses private Blob objects and Vercel Sandbox sessions. — [apps/docs/package.json#L2-14](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/apps/docs/package.json#L2-L14) [apps/factory/README.md#L7-18](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/apps/factory/README.md#L7-L18) [apps/factory/README.md#L37-47](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/apps/factory/README.md#L37-L47)

## Feature catalog

The inspected command dispatcher exposes execution, watching, pruning, inspection, authentication, generation, and configuration features. Execution supports terminal, TUI, and machine-readable output, alongside graph and dry-run modes. Additional package and application surfaces support project creation, configuration migration, and durable agent workspaces; this catalog is bounded by the inspected files.
- Task runs support structured JSON output, a TUI or streamed terminal output, graph output, and JSON dry runs; machine-readable modes suppress competing stdout. — [crates/turborepo-cli/src/commands/run.rs#L145-177](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cli/src/commands/run.rs#L145-L177) [crates/turborepo-cli/src/commands/run.rs#L191-200](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cli/src/commands/run.rs#L191-L200) [crates/turborepo-run/src/lib.rs#L1333-1356](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-run/src/lib.rs#L1333-L1356)
- turbo watch constructs WatchClient with experimental_write_cache, requires tasks, treats SignalInterrupt as normal termination, and explicitly shuts down the client. — [crates/turborepo-cli/src/cli/mod.rs#L753-787](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cli/src/cli/mod.rs#L753-L787)
- turbo prune accepts scope, Docker layout, production mode, output directory, and gitignore behavior; its CLI adapter passes repository options and future flags to turborepo-prune. — [crates/turborepo-cli/src/cli/mod.rs#L794-825](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cli/src/cli/mod.rs#L794-L825) [crates/turborepo-cli/src/commands/prune.rs#L6-28](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cli/src/commands/prune.rs#L6-L28)
- Inspection commands include boundaries, devtools, info, config, ls, and GraphQL query; query and ls reject execution when no QueryServer is available. — [crates/turborepo-cli/src/cli/mod.rs#L480-517](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cli/src/cli/mod.rs#L480-L517) [crates/turborepo-cli/src/cli/mod.rs#L551-596](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cli/src/cli/mod.rs#L551-L596) [crates/turborepo-cli/src/cli/mod.rs#L721-749](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cli/src/cli/mod.rs#L721-L749)
- Login supports standard, manual, and SSO branches; standard Vercel login uses OAuth device authorization while self-hosted login uses a localhost redirect. — [crates/turborepo-cli/src/commands/login/mod.rs#L34-55](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cli/src/commands/login/mod.rs#L34-L55) [crates/turborepo-auth/src/auth/login.rs#L157-169](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-auth/src/auth/login.rs#L157-L169) [crates/turborepo-auth/src/auth/login.rs#L282-295](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-auth/src/auth/login.rs#L282-L295)
- The dispatcher also exposes daemon client/server operation, documentation lookup, generation with custom arguments, and telemetry configuration; scan only emits a deprecation warning and returns 1. — [crates/turborepo-cli/src/cli/mod.rs#L491-549](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cli/src/cli/mod.rs#L491-L549) [crates/turborepo-cli/src/cli/mod.rs#L561-574](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cli/src/cli/mod.rs#L561-L574)
- Experimental native workspace support covers Cargo crates, uv Python packages, and go.work modules, each gated by its ecosystem-specific future flag. — [crates/turborepo-repository/src/cargo.rs#L21-41](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-repository/src/cargo.rs#L21-L41) [crates/turborepo-repository/src/uv.rs#L16-38](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-repository/src/uv.rs#L16-L38) [crates/turborepo-repository/src/go.rs#L1-12](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-repository/src/go.rs#L1-L12)
- Companion features include create-turbo template selection, dynamically loaded codemod transformers, turbo-trace forward/reverse dependency tracing, and Factory's durable workspace UI. — [packages/create-turbo/src/commands/create/index.ts#L82-111](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/packages/create-turbo/src/commands/create/index.ts#L82-L111) [packages/turbo-codemod/src/utils/load-transformers.ts#L5-28](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/packages/turbo-codemod/src/utils/load-transformers.ts#L5-L28) [crates/turbo-trace/src/main.rs#L37-59](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turbo-trace/src/main.rs#L37-L59) [apps/factory/README.md#L7-18](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/apps/factory/README.md#L7-L18)

## Data flow

CLI arguments and inferred repository state establish the execution boundary. Discovery and configuration become immutable repository and execution contexts, while file, dependency, and environment inputs feed task hashes. Task results flow through completion callbacks, output sinks, and caches; authentication has a separate user-level persistence path.
- run_main combines inferred RepoState and --cwd to select the repository root, canonicalizes it on Windows, and applies repository/package inference to command flags. — [crates/turborepo-cli/src/cli/mod.rs#L416-439](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cli/src/cli/mod.rs#L416-L439)
- RepositoryContributor separates cheap scope inventory from authoritative package discovery; inventory must not supply tasks, relationships, resolution facts, or prune domains. — [crates/turborepo-repository/src/toolchain.rs#L535-572](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-repository/src/toolchain.rs#L535-L572)
- RunBuilder passes discovered package graphs, SCM, lazy plans, and AsyncCache into build_execution_context, then creates service and repository owners before returning Run. — [crates/turborepo-run/src/builder.rs#L2200-2255](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-run/src/builder.rs#L2200-L2255)
- TaskHashable combines global and dependency hashes, package directory, file and external-dependency hashes, outputs, arguments, environment settings, and command overrides into the cache key. — [crates/turborepo-task-hash/src/lib.rs#L643-674](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-task-hash/src/lib.rs#L643-L674)
- ToolchainCommandProvider resolves native task specifications or authoritative argv overrides, assigns cwd and serial groups, and clears inherited environment before applying the selected map. — [crates/turborepo-task-executor/src/command.rs#L254-323](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-task-executor/src/command.rs#L254-L323) [crates/turborepo-task-executor/src/command.rs#L21-24](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-task-executor/src/command.rs#L21-L24)
- Engine::execute sends task IDs through a visitor channel and waits on completion results; StopExecution controls cancellation or dependent-subgraph traversal. — [crates/turborepo-engine/src/execute.rs#L119-144](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-engine/src/execute.rs#L119-L144) [crates/turborepo-task-executor/src/visitor.rs#L27-46](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-task-executor/src/visitor.rs#L27-L46)
- TaskCache restores through AsyncCache using the repository root and task hash; saves expand output globs, isolate managed logs, reject paths outside the repository, and put relative paths with duration. — [crates/turborepo-run-cache/src/lib.rs#L639-674](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-run-cache/src/lib.rs#L639-L674) [crates/turborepo-run-cache/src/lib.rs#L780-821](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-run-cache/src/lib.rs#L780-L821) [crates/turborepo-run-cache/src/lib.rs#L842-850](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-run-cache/src/lib.rs#L842-L850)
- Login converts TokenSet expiry into an absolute timestamp and persists token/refresh metadata to user configuration; vca_ tokens go to Turbo auth storage while stale alternate storage is cleared. — [crates/turborepo-cli/src/commands/login/mod.rs#L145-182](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cli/src/commands/login/mod.rs#L145-L182) [crates/turborepo-auth/src/lib.rs#L415-445](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-auth/src/lib.rs#L415-L445)

## Behavior traces

Three concrete flows were followed: CLI startup, task execution with cache persistence, and standard login with credential persistence. The traces retain branches that change execution, including local-binary selection, graph-only runs, cache hits, cache failures, and existing-token reuse. These are source-derived execution sequences, not runtime observations.
- Startup: binary main → turborepo_cli::main → raise_open_file_limit → shim::run; internal LSP requests return before this ordinary path. — [crates/turborepo/src/main.rs#L85-104](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo/src/main.rs#L85-L104) [crates/turborepo-cli/src/lib.rs#L53-57](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cli/src/lib.rs#L53-L57)
- Startup continues: normalize_config_dir_env_vars → ShimArgs::parse → TurboSubscriber construction → ShimRuntime::new → run_with_args; TurboCliRunner then delegates to cli::run. — [crates/turborepo-cli/src/shim.rs#L54-59](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cli/src/shim.rs#L54-L59) [crates/turborepo-cli/src/shim.rs#L215-252](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cli/src/shim.rs#L215-L252)
- CLI startup: Args::new → init_rayon_pool → Tokio runtime → run_main → deferred telemetry initialization → get_command → inference flags and repository root → agent guidance maintenance. — [crates/turborepo-cli/src/cli/mod.rs#L333-353](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cli/src/cli/mod.rs#L333-L353) [crates/turborepo-cli/src/cli/mod.rs#L378-390](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cli/src/cli/mod.rs#L378-L390) [crates/turborepo-cli/src/cli/mod.rs#L416-441](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cli/src/cli/mod.rs#L416-L441)
- Run setup: commands::run creates signals and log sinks → RunBuilder::new → execute_run → run_with_ui → RunBuilder::build → start_ui → Run::run. — [crates/turborepo-cli/src/commands/run.rs#L59-78](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cli/src/commands/run.rs#L59-L78) [crates/turborepo-cli/src/commands/run.rs#L102-142](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cli/src/commands/run.rs#L102-L142) [crates/turborepo-cli/src/commands/run.rs#L171-200](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cli/src/commands/run.rs#L171-L200)
- Run execution: Run::run starts proxy/shutdown services; graph mode writes the graph and returns 0, otherwise execute_visitor constructs Visitor, enables dry-run when requested, visits the engine, and derives the exit code. — [crates/turborepo-run/src/lib.rs#L1320-1356](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-run/src/lib.rs#L1320-L1356) [crates/turborepo-run/src/lib.rs#L1242-1278](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-run/src/lib.rs#L1242-L1278)
- Task branch: execute_inner → restore_outputs; a hit updates the hash tracker and skips spawning, while a miss or logged fetch error proceeds through serial-group locking to ProcessManager::spawn. — [crates/turborepo-task-executor/src/exec.rs#L356-403](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-task-executor/src/exec.rs#L356-L403)
- Persistence branch: execute flushes output and sends the completion callback before save_outputs; only a successful Run outcome is eligible, and FSCache writes archive entries, atomically finishes the archive, then writes sidecars. — [crates/turborepo-task-executor/src/exec.rs#L259-304](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-task-executor/src/exec.rs#L259-L304) [crates/turborepo-task-executor/src/exec.rs#L612-614](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-task-executor/src/exec.rs#L612-L614) [crates/turborepo-cache/src/fs.rs#L285-305](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cache/src/fs.rs#L285-L305)
- Standard login: login → login_no_sso → auth_login; reusable credentials return without writing, otherwise Vercel device login performs discover → authorization request → poll_for_token → get_user, then write_token persists the returned credentials. — [crates/turborepo-cli/src/commands/login/mod.rs#L85-111](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cli/src/commands/login/mod.rs#L85-L111) [crates/turborepo-auth/src/auth/login.rs#L282-307](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-auth/src/auth/login.rs#L282-L307) [crates/turborepo-auth/src/auth/login.rs#L333-353](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-auth/src/auth/login.rs#L333-L353) [crates/turborepo-cli/src/commands/login/mod.rs#L175-182](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cli/src/commands/login/mod.rs#L175-L182)

## Testing signals

Tests and CI were inspected, not executed; no passing result is asserted. The inspected coverage includes Rust integration behavior, executor policies, archive safety regressions, GraphQL host checks, and Jest package tests. CI spans multiple operating systems and Node versions, but exclusions, mocked boundaries, and release-PR skips limit what any individual job establishes.
- Rust integration tests under crates/turborepo/tests use #[test], temporary repositories, shared setup helpers, and subprocess output assertions; run_caching checks env-sensitive misses/hits and JSON cache metadata. — [crates/turborepo/tests/run_caching.rs#L21-51](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo/tests/run_caching.rs#L21-L51) [crates/turborepo/tests/run_caching.rs#L56-95](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo/tests/run_caching.rs#L56-L95)
- Executor unit tests cover all three continuation policies and ensure cache hits, output-flush failures, task failures, shutdowns, restarts, and internal errors do not trigger output saving. — [crates/turborepo-task-executor/src/exec.rs#L641-672](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-task-executor/src/exec.rs#L641-L672)
- Archive regression tests include an existing symlink pointing outside the restore anchor and assert replacement with a directory plus no external write. — [crates/turborepo-cache/src/cache_archive/restore.rs#L2906-2933](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cache/src/cache_archive/restore.rs#L2906-L2933)
- Query-server tests check GraphiQL response content and allowed/rejected host strings; the displayed tests call helper functions rather than exercising live HTTP middleware. — [crates/turborepo-query/src/server.rs#L62-86](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-query/src/server.rs#L62-L86)
- create-turbo and turbo-utils use Jest; inspected tests include starter agent guidance and mocked child-process/fetch boundaries, so these examples do not establish live download or toolchain success. — [packages/create-turbo/__tests__/index.test.ts#L12-21](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/packages/create-turbo/__tests__/index.test.ts#L12-L21) [packages/create-turbo/__tests__/index.test.ts#L47-58](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/packages/create-turbo/__tests__/index.test.ts#L47-L58) [packages/turbo-utils/__tests__/examples.test.ts#L33-38](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/packages/turbo-utils/__tests__/examples.test.ts#L33-L38) [packages/turbo-utils/__tests__/examples.test.ts#L64-68](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/packages/turbo-utils/__tests__/examples.test.ts#L64-L68)
- Rust CI uses macOS, Ubuntu, and Windows with two hash partitions; turbo.json invokes nextest while excluding LSP, schema generation, and N-API from that workspace test task. — [.github/workflows/turborepo-test.yml#L140-162](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/.github/workflows/turborepo-test.yml#L140-L162) [.github/workflows/turborepo-test.yml#L279-286](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/.github/workflows/turborepo-test.yml#L279-L286) [turbo.json#L56-67](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/turbo.json#L56-L67)
- JavaScript CI covers Ubuntu/macOS and Node 22/24/26, runs affected package checks in strict env mode, excludes @turbo/repository from this job, and skips the job for validated release PRs. — [.github/workflows/test-js-packages.yml#L90-112](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/.github/workflows/test-js-packages.yml#L90-L112) [.github/workflows/test-js-packages.yml#L140-163](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/.github/workflows/test-js-packages.yml#L140-L163)
- Lint CI separately configures cargo fmt, cargo lint, and license checking; nextest limits experimental OTel integration tests to one minute with no retries. — [.github/workflows/lint.yml#L32-33](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/.github/workflows/lint.yml#L32-L33) [.github/workflows/lint.yml#L60-76](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/.github/workflows/lint.yml#L60-L76) [.config/nextest.toml#L4-9](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/.config/nextest.toml#L4-L9)

## Risk map

The following are security-sensitive boundaries and source-observed coupling points, not confirmed vulnerabilities. Native command execution, archive restoration, user-level credentials, remote cache authorization, and internal operator deployment protection deserve focused review. The bounded inspection does not establish whole-repository coverage or the absence of other risks.
- Task command configuration can replace native commands or opt out entirely; executable, arguments, cwd, and environment are applied before spawning, making repository task definitions an execution trust boundary. — [crates/turborepo-task-executor/src/command.rs#L254-323](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-task-executor/src/command.rs#L254-L323) [crates/turborepo-task-executor/src/exec.rs#L398-403](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-task-executor/src/exec.rs#L398-L403)
- Archive restore writes into the anchor and supports directories, regular files, and symlinks; Unix regular-file permissions are masked to 0777 and unsupported entry types fail. — [crates/turborepo-cache/src/cache_archive/restore.rs#L63-83](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cache/src/cache_archive/restore.rs#L63-L83) [crates/turborepo-cache/src/cache_archive/restore.rs#L191-200](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cache/src/cache_archive/restore.rs#L191-L200) [crates/turborepo-cache/src/cache_archive/restore_regular.rs#L35-61](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cache/src/cache_archive/restore_regular.rs#L35-L61)
- Output collection follows symlinked output roots, filters peer managed logs, and rejects paths outside the repository; restoration currently fetches the artifact without using output globs to restrict extraction. — [crates/turborepo-run-cache/src/lib.rs#L639-647](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-run-cache/src/lib.rs#L639-L647) [crates/turborepo-run-cache/src/lib.rs#L783-821](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-run-cache/src/lib.rs#L783-L821)
- Login persists access and refresh tokens outside the repository through create_with_contents_secret; credential routing distinguishes vca_ tokens from legacy tokens and clears alternate storage. — [crates/turborepo-cli/src/commands/login/mod.rs#L145-182](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cli/src/commands/login/mod.rs#L145-L182) [crates/turborepo-auth/src/lib.rs#L420-445](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-auth/src/lib.rs#L420-L445)
- Artifact signing uses TURBO_REMOTE_CACHE_SIGNATURE_KEY and binds hash, team ID, and body length; short-key enforcement is conditional, with warning-only compatibility unless longerSignatureKey is enabled. — [crates/turborepo-cache/src/signature_authentication.rs#L55-95](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cache/src/signature_authentication.rs#L55-L95) [crates/turborepo-cache/src/http.rs#L78-87](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cache/src/http.rs#L78-L87)
- Remote-cache token recovery is serialized and retries with changed credentials; failed recovery disables remote caching for the run, while task cache-fetch errors are logged before execution continues. — [crates/turborepo-cache/src/http.rs#L136-187](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cache/src/http.rs#L136-L187) [crates/turborepo-task-executor/src/exec.rs#L362-381](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-task-executor/src/exec.rs#L362-L381)
- The GraphQL service binds 127.0.0.1:8000 and rejects Host values outside localhost/127.0.0.1, explicitly guarding its local HTTP exposure. — [crates/turborepo-query/src/server.rs#L17-51](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-query/src/server.rs#L17-L51)
- Factory documents Vercel Deployment Protection as its outer operator authentication layer and same-origin/action-header checks for mutations; deployment protection configuration is therefore a material access-control dependency. — [apps/factory/README.md#L3-3](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/apps/factory/README.md#L3-L3) [apps/factory/README.md#L37-42](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/apps/factory/README.md#L37-L42)

## Extension points

The core extends through explicit traits, typed configuration, and centralized command dispatch. Repository contributors supply ecosystem knowledge, command providers supply executable specifications, and query interfaces keep GraphQL implementation outside the CLI dependency boundary. Companion packages add filesystem-discovered transformations, while output changes follow a shared logging architecture.
- New ecosystem integrations implement RepositoryContributor::id, discover_packages, and discover_package_scopes; conservative static dependencies are an optional separate hook. — [crates/turborepo-repository/src/toolchain.rs#L535-581](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-repository/src/toolchain.rs#L535-L581)
- CommandFactory::add_provider registers ordered CommandProvider implementations; the first Some command wins and any provider error immediately propagates. — [crates/turborepo-task-executor/src/command.rs#L42-52](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-task-executor/src/command.rs#L42-L52) [crates/turborepo-task-executor/src/command.rs#L76-99](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-task-executor/src/command.rs#L76-L99)
- EngineProvider exposes tasks, definitions, and dependencies, while EngineExecutor accepts concurrency and a message sender, permitting execution support to depend on interfaces. — [crates/turborepo-task-executor/src/visitor.rs#L12-46](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-task-executor/src/visitor.rs#L12-L46)
- QueryServer injection enables alternate query implementations or CLI builds without queries; the binary's adapter delegates execute_query and run_query_server to turborepo-query. — [crates/turborepo-cli/src/lib.rs#L48-54](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cli/src/lib.rs#L48-L54) [crates/turborepo/src/main.rs#L40-69](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo/src/main.rs#L40-L69)
- CLI dispatch is centralized in the Command match; additions must connect parsed commands to their command adapters, telemetry events, and CommandBase requirements. — [crates/turborepo-cli/src/cli/mod.rs#L462-488](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cli/src/cli/mod.rs#L462-L488) [crates/turborepo-cli/src/cli/mod.rs#L519-549](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cli/src/cli/mod.rs#L519-L549)
- The public TypeScript schema maps task names to Pipeline definitions and exposes workspace extends, tags, and boundaries configuration. — [packages/turbo-types/src/types/config-v2.ts#L15-62](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/packages/turbo-types/src/types/config-v2.ts#L15-L62)
- Codemods plug in as default-exported Transformer modules discovered from the transforms directory; loadTransformers ignores loading errors and filters empty results. — [packages/turbo-codemod/src/utils/load-transformers.ts#L5-28](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/packages/turbo-codemod/src/utils/load-transformers.ts#L5-L28)
- New logging areas add Subsystem variants; user-facing events and task bytes pass through GroupingLayer and Logger to terminal, TUI, and file/collector sinks. — [CONTRIBUTING.md#L169-181](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/CONTRIBUTING.md#L169-L181) [CONTRIBUTING.md#L185-200](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/CONTRIBUTING.md#L185-L200)

## Contributor handoff

This handoff is grounded in the pinned commit and a clean tracked working-tree comparison, with bounded inspection rather than exhaustive coverage. Tests and CI were inspected, not executed; commands below are documented future checks, not results. Begin at the owning crate and preserve discovery authority, hash inputs, output modes, credential routing, and completion semantics.
- Read AGENTS.md and CONTRIBUTING.md before changes: repository rules prohibit bypassing commit/push hooks and require Conventional Commit PR titles with uppercase descriptions and no scopes. — [AGENTS.md#L3-22](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/AGENTS.md#L3-L22)
- For CLI changes, keep main.rs thin and follow lib.rs → shim.rs → cli/mod.rs; the binary explicitly directs additional logic into turborepo_cli::main. — [crates/turborepo/src/main.rs#L74-98](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo/src/main.rs#L74-L98) [crates/turborepo-cli/src/lib.rs#L53-57](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cli/src/lib.rs#L53-L57) [crates/turborepo-cli/src/shim.rs#L215-252](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cli/src/shim.rs#L215-L252)
- Use the repository's Node 24/pnpm 12 versions and existing build:turbo script; Rust code inherits edition 2024 and workspace Clippy restrictions on expect and unwrap. — [package.json#L5-7](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/package.json#L5-L7) [package.json#L28-31](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/package.json#L28-L31) [Cargo.toml#L11-28](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/Cargo.toml#L11-L28)
- Documented focused verification is cargo test -p <module> or cargo test -p turbo --test <target>, with cargo lint for Clippy; these checks were inspected, not executed in this audit. — [CONTRIBUTING.md#L105-130](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/CONTRIBUTING.md#L105-L130) [crates/turborepo/tests/run_caching.rs#L21-24](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo/tests/run_caching.rs#L21-L24)
- When execution is authorized, manual development-binary testing requires --skip-infer; CONTRIBUTING also distinguishes deprecated run-daemon behavior from watch's daemon use. — [CONTRIBUTING.md#L134-152](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/CONTRIBUTING.md#L134-L152)
- Do not collapse scope inventory into full discovery or change hash inputs casually: contributor contracts forbid invented task knowledge and TaskHashable includes command, environment, dependency, and output semantics. — [crates/turborepo-repository/src/toolchain.rs#L543-571](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-repository/src/toolchain.rs#L543-L571) [crates/turborepo-task-hash/src/lib.rs#L652-674](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-task-hash/src/lib.rs#L652-L674)
- Preserve callback-before-cache-save ordering and JSON stdout ownership; these behaviors are explicit in the executor and run adapter and affect dependents and machine consumers. — [crates/turborepo-task-executor/src/exec.rs#L264-296](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-task-executor/src/exec.rs#L264-L296) [crates/turborepo-cli/src/commands/run.rs#L145-159](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cli/src/commands/run.rs#L145-L159)
- A turbo invocation under a detected agent can update AGENTS.md when bundled docs and configuration permit it; maintenance uses a PID lock and refuses replacement after concurrent edits. — [crates/turborepo-cli/src/cli/mod.rs#L190-229](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cli/src/cli/mod.rs#L190-L229) [crates/turborepo-cli/src/cli/agent_guidance.rs#L40-54](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cli/src/cli/agent_guidance.rs#L40-L54) [crates/turborepo-cli/src/cli/agent_guidance.rs#L88-127](https://github.com/vercel/turborepo/blob/2540ee1d740bb96bf249459a7957ef4b380c9e43/crates/turborepo-cli/src/cli/agent_guidance.rs#L88-L127)

Source repository: https://github.com/vercel/turborepo
Full evidence corpus: https://github.com/Codevetter/codevetter/tree/main/benchmarks/repo-unpacks/turborepo.json

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
