# yarnpkg/berry — codebase unpack

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

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

- Scanned commit: e4e423a1eb117b5129f20ac626a03eb7a97aedff (2026-09-24)
- Last upstream commit: Sync master with the changes from master
- Generated by codevetter 1.15.0 on 2026-10-02
- 1581 files scanned · 12.0 MB

Source inspection; upstream code and tests were not executed.

## Languages

- TypeScript: 511 files
- JavaScript: 341 files
- JSON: 250 files
- Markdown: 104 files
- YAML: 42 files
- Shell: 13 files
- CSS: 10 files
- C: 2 files

## Repository structure

- packages/ — 1454 files
- scripts/ — 45 files
- .github/ — 41 files
- .yarn/ — 16 files
- .vim/ — 1 files

Probable source entrypoint: `packages/` (inferred from the tree, not upstream docs)

## Source layout — packages/

- packages/acceptance-tests/ — 153 files
- packages/plugin-npm-cli/ — 17 files

## Package

- package.json: @yarnpkg/monorepo — 24 declared dependencies

## Structural health signals

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

## Recent history

- e4e423a1eb11 (2026-09-24) Sync master with the changes from master
- 75ebe063092f (2026-09-24) Releasing 2 new packages
- 8b6cf965c4a0 (2026-09-24) Update Yarn version configuration for @yarnpkg/cli
- 502acfec2f4b (2026-09-19) fix(core): patch got to prevent crash on settled promise cancelation (#7249)
- 57081c05a398 (2026-07-29) Sync master with the changes from master

## Overview

Berry is Yarn’s TypeScript package-manager monorepo, serving JavaScript developers, workspace maintainers, and tooling authors through both a CLI and reusable libraries. Its core manages dependency graphs, caches, installation state, and scripts, while plugins supply package protocols, commands, and filesystem installation strategies. The inspected implementation supports Plug’n’Play, node_modules, and pnpm-style linking, with a separate React/Docusaurus documentation application.

## System map

The repository separates command dispatch, project management, protocol integrations, and filesystem installation. The CLI composes plugins around reusable core classes rather than containing the dependency engine itself. Distribution includes generated CLI bundles and published library packages, while documentation has its own application and build configuration.
- The root package is a private packages/* workspace monorepo; it declares Jest, ESLint, and TypeScript scripts and pins packageManager to Yarn 4.2.1. — [package.json#L1-7](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/package.json#L1-L7) [package.json#L50-65](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/package.json#L50-L65) [package.json#L76-86](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/package.json#L76-L86)
- The executable source entrypoint imports polyfills and calls runExit with argv, portable cwd, its own path, and getPluginConfiguration(). — [packages/yarnpkg-cli/sources/cli.ts#L1-11](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-cli/sources/cli.ts#L1-L11) [packages/yarnpkg-cli/sources/tools/getPluginConfiguration.ts#L6-15](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-cli/sources/tools/getPluginConfiguration.ts#L6-L15)
- lib.ts owns Clipanion context, Node >=18.12.0 validation, yarnPath delegation, plugin command registration, exit-code handling, and temporary-directory cleanup. — [packages/yarnpkg-cli/sources/lib.ts#L12-52](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-cli/sources/lib.ts#L12-L52) [packages/yarnpkg-cli/sources/lib.ts#L135-170](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-cli/sources/lib.ts#L135-L170) [packages/yarnpkg-cli/sources/lib.ts#L186-208](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-cli/sources/lib.ts#L186-L208)
- Core exposes Configuration, Project, Workspace, Cache, and Manifest; Project.find initializes resolutions and workspaces and uses linker lookup when cwd belongs to an installed package. — [packages/docusaurus/docs/advanced/04-technical/architecture.mdx#L8-14](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/docusaurus/docs/advanced/04-technical/architecture.mdx#L8-L14) [packages/yarnpkg-core/sources/Project.ts#L291-330](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Project.ts#L291-L330)
- Plugin contributions are typed as configuration, commands, fetchers, linkers, resolvers, and hooks; the CLI’s standard bundle includes npm, JSR, constraints, linking, and workspace plugins. — [packages/yarnpkg-core/sources/Plugin.ts#L187-194](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Plugin.ts#L187-L194) [packages/yarnpkg-cli/package.json#L78-106](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-cli/package.json#L78-L106)
- Filesystem installation has distinct implementations: PnpLinker generates loader/data files, NodeModulesLinker persists a package tree, and plugin-pnpm registers PnpmLinker with a configurable store. — [packages/plugin-pnp/sources/PnpLinker.ts#L315-348](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-pnp/sources/PnpLinker.ts#L315-L348) [packages/plugin-nm/sources/NodeModulesLinker.ts#L333-363](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-nm/sources/NodeModulesLinker.ts#L333-L363) [packages/plugin-pnpm/sources/index.ts#L15-30](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-pnpm/sources/index.ts#L15-L30)
- build:cli invokes builder build bundle, which bundles sources/cli.ts into bundles/yarn.js using esbuild; the manual release workflow builds binaries, pushes tags, and invokes release publishing scripts. — [packages/yarnpkg-cli/package.json#L57-71](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-cli/package.json#L57-L71) [packages/yarnpkg-builder/sources/commands/build/bundle.ts#L77-86](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-builder/sources/commands/build/bundle.ts#L77-L86) [packages/yarnpkg-builder/sources/commands/build/bundle.ts#L120-149](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-builder/sources/commands/build/bundle.ts#L120-L149) [.github/workflows/release-branch.yml#L51-71](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/.github/workflows/release-branch.yml#L51-L71)
- The separate Docusaurus workspace uses React 19 and provides development/build scripts; its configuration generates CLI and TypeDoc API documentation alongside docs and blog routes. — [packages/docusaurus/package.json#L4-10](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/docusaurus/package.json#L4-L10) [packages/docusaurus/package.json#L55-57](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/docusaurus/package.json#L55-L57) [packages/docusaurus/docusaurus.config.ts#L144-162](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/docusaurus/docusaurus.config.ts#L144-L162) [packages/docusaurus/docusaurus.config.ts#L177-195](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/docusaurus/docusaurus.config.ts#L177-L195)

## Feature catalog

The inspected command registries cover dependency editing, installation, execution, diagnostics, workspace operations, and registry publishing. Protocol and linker plugins provide alternative dependency sources and installation layouts. Additional plugins support constraints, release workflows, patching, project creation, and editor tooling; this catalog groups the evidenced surfaces rather than asserting exhaustive inspection of every command implementation.
- plugin-essentials registers add, remove, up, dedupe, install, rebuild, cache clean, resolution overrides, and package link/unlink commands. — [packages/plugin-essentials/sources/index.ts#L172-209](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-essentials/sources/index.ts#L172-L209)
- Execution features include run, exec, and node; RunCommand supports top-level selection, binaries-only mode, Node --require forwarding, and a unique colon-named script fallback across workspaces. — [packages/plugin-essentials/sources/index.ts#L185-206](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-essentials/sources/index.ts#L185-L206) [packages/plugin-essentials/sources/commands/run.ts#L47-57](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-essentials/sources/commands/run.ts#L47-L57) [packages/plugin-essentials/sources/commands/run.ts#L124-143](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-essentials/sources/commands/run.ts#L124-L143)
- Workspace features include listing and selecting a workspace, plus workspaces focus and foreach supplied by plugin-workspace-tools. — [packages/plugin-essentials/sources/index.ts#L172-180](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-essentials/sources/index.ts#L172-L180) [packages/plugin-essentials/sources/index.ts#L203-209](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-essentials/sources/index.ts#L203-L209) [packages/plugin-workspace-tools/sources/index.ts#L3-13](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-workspace-tools/sources/index.ts#L3-L13)
- Installation supports PnP loader generation, a persisted node_modules tree, and a pnpm-style store; install also exposes immutable, immutable-cache, check-cache, refresh-lockfile, and execution modes. — [packages/plugin-pnp/sources/PnpLinker.ts#L328-348](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-pnp/sources/PnpLinker.ts#L328-L348) [packages/plugin-nm/sources/NodeModulesLinker.ts#L333-363](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-nm/sources/NodeModulesLinker.ts#L333-L363) [packages/plugin-pnpm/sources/index.ts#L15-30](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-pnpm/sources/index.ts#L15-L30) [packages/plugin-essentials/sources/commands/install.ts#L62-76](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-essentials/sources/commands/install.ts#L62-L76)
- Documented dependency integrations include npm semver, file, Git, GitHub, HTTP tarballs, exec, link, portal, and patch protocols; JSR adds its own resolver/fetcher and converts jsr: dependencies when packing. — [README.md#L195-208](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/README.md#L195-L208) [packages/plugin-jsr/sources/index.ts#L10-40](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-jsr/sources/index.ts#L10-L40)
- npm CLI commands include audit, info, login/logout, publish, whoami, dist-tag management, and staged-publication approve/list/reject; publication provenance is a configurable option. — [packages/plugin-npm-cli/sources/index.ts#L43-79](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-npm-cli/sources/index.ts#L43-L79)
- Constraints provide check/query/source commands and optional install-time checking; version provides apply/check/version with deferred records, while documented plugins add dlx, init, interactive upgrades, pack, patch, stage, and TypeScript assistance. — [packages/plugin-constraints/sources/index.ts#L22-51](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-constraints/sources/index.ts#L22-L51) [packages/plugin-version/sources/index.ts#L21-38](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-version/sources/index.ts#L21-L38) [README.md#L191-212](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/README.md#L191-L212)
- User diagnostics and tooling include config get/set/unset, explain and peer-requirement explanation, info, why, plugin management, Yarn version selection, PnPify, editor SDK generation, and a documentation site with CLI/configuration/API navigation. — [packages/plugin-essentials/sources/index.ts#L172-209](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-essentials/sources/index.ts#L172-L209) [README.md#L226-234](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/README.md#L226-L234) [packages/docusaurus/docusaurus.config.ts#L226-265](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/docusaurus/docusaurus.config.ts#L226-L265)

## Data flow

Inputs enter through argv, environment settings, RC files, package manifests, and registry metadata. Configuration and Project own the interpreted settings and dependency graph, while fetchers translate package identities into filesystem-backed artifacts. Linkers publish runtime layouts, and lockfiles plus compressed installation state support subsequent commands.
- argv becomes a Clipanion command after startup configuration and cwd handling; command context carries cwd, plugin configuration, and stdin/stdout/stderr. — [packages/yarnpkg-cli/sources/cli.ts#L7-11](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-cli/sources/cli.ts#L7-L11) [packages/yarnpkg-cli/sources/lib.ts#L19-28](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-cli/sources/lib.ts#L19-L28) [packages/yarnpkg-cli/sources/lib.ts#L160-170](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-cli/sources/lib.ts#L160-L170)
- Configuration.find combines environment settings, discovered RC files, and a home RC file; it processes yarnPath fields before project discovery and plugin activation. — [packages/yarnpkg-core/sources/Configuration.ts#L1178-1199](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Configuration.ts#L1178-L1199) [packages/yarnpkg-core/sources/Configuration.ts#L1219-1256](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Configuration.ts#L1219-L1256)
- Workspace.setup loads a manifest, derives stable workspace descriptors/locators from relative paths, expands workspace patterns, excludes node_modules/.git/.yarn, and sorts discovered paths. — [packages/yarnpkg-core/sources/Workspace.ts#L36-75](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Workspace.ts#L36-L75)
- Descriptor resolution first resolves resolver-specific dependencies, requests candidates, selects the first candidate, optionally verifies it with getSatisfying, and records descriptor-to-locator hashes. — [packages/yarnpkg-core/sources/Project.ts#L902-943](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Project.ts#L902-L943)
- NpmSemverResolver turns registry versions into approved, preferably nondeprecated candidates sorted descending; unconventional tarball URLs are bound into locators, and resolve loads manifest dependency metadata. — [packages/plugin-npm/sources/NpmSemverResolver.ts#L76-118](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-npm/sources/NpmSemverResolver.ts#L76-L118) [packages/plugin-npm/sources/NpmSemverResolver.ts#L155-175](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-npm/sources/NpmSemverResolver.ts#L155-L175) [packages/plugin-npm/sources/NpmSemverResolver.ts#L190-207](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-npm/sources/NpmSemverResolver.ts#L190-L207)
- NpmSemverFetcher requests a checksum-aware cached package; a miss downloads a tarball and converts it into a vendor-prefixed ZIP, returning packageFs, releaseFs, prefixPath, and checksum. — [packages/plugin-npm/sources/NpmSemverFetcher.ts#L29-70](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-npm/sources/NpmSemverFetcher.ts#L29-L70)
- fetchEverything updates storedChecksums and releases fetched filesystems; linkEverything creates installers with restored custom data, attaches internal/external relationships, and captures finalizeInstall custom data and build records. — [packages/yarnpkg-core/sources/Project.ts#L1127-1154](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Project.ts#L1127-L1154) [packages/yarnpkg-core/sources/Project.ts#L1218-1229](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Project.ts#L1218-L1229) [packages/yarnpkg-core/sources/Project.ts#L1394-1439](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Project.ts#L1394-L1439) [packages/yarnpkg-core/sources/Project.ts#L1441-1460](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Project.ts#L1441-L1460)
- Project.persist writes the normalized lockfile and workspace manifests; installation state is V8-serialized and gzipped, while restoration only reuses saved resolutions when the lockfile checksum matches. — [packages/yarnpkg-core/sources/Project.ts#L2012-2049](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Project.ts#L2012-L2049) [packages/yarnpkg-core/sources/Project.ts#L2075-2102](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Project.ts#L2075-L2102) [packages/yarnpkg-core/sources/Workspace.ts#L217-228](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Workspace.ts#L217-L228)

## Behavior traces

Three concrete flows were followed through their implementation: CLI startup, installation through persistence, and script/binary execution. Startup can terminate by handing control to another Yarn executable. Installation and execution both restore project state, but apply different resolution, linking, and subprocess branches.
- Startup: cli.ts calls getPluginConfiguration(), which reads the standard bundle list and constructs modules/plugins; runExit then calls getBaseCli() and run(). — [packages/yarnpkg-cli/sources/cli.ts#L1-11](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-cli/sources/cli.ts#L1-L11) [packages/yarnpkg-cli/sources/tools/getPluginConfiguration.ts#L6-15](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-cli/sources/tools/getPluginConfiguration.ts#L6-L15) [packages/yarnpkg-cli/sources/lib.ts#L186-201](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-cli/sources/lib.ts#L186-L201)
- Startup dispatch: run() performs validateNodejsVersion → getCoreConfiguration → optional runYarnPath; otherwise checkCwd → initTelemetry → initCommands → cli.process → cli.run. Delegation sets YARN_IGNORE_PATH=1 in the child. — [packages/yarnpkg-cli/sources/lib.ts#L75-86](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-cli/sources/lib.ts#L75-L86) [packages/yarnpkg-cli/sources/lib.ts#L143-170](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-cli/sources/lib.ts#L143-L170)
- Install setup: InstallCommand.execute finds Project, applies applicable lockfile migration settings, finds Cache, requires a workspace, restores state without resolutions, and derives refresh/check behavior from explicit flags or hardened mode before Project.install. — [packages/plugin-essentials/sources/commands/install.ts#L303-342](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-essentials/sources/commands/install.ts#L303-L342) [packages/plugin-essentials/sources/commands/install.ts#L344-380](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-essentials/sources/commands/install.ts#L344-L380)
- Install resolution: Project.install runs validateProject, stops on validation errors, snapshots an immutable lockfile, invokes resolveEverything, emits peer warnings, and rejects changed generated lockfile content before fetching. — [packages/yarnpkg-core/sources/Project.ts#L1750-1807](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Project.ts#L1750-L1807) [packages/yarnpkg-core/sources/Project.ts#L1829-1856](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Project.ts#L1829-L1856)
- Install persistence: fetchEverything → optional persist → linkEverything → persistInstallStateFile → post-install validation. UpdateLockfile mode fetches only missing checksums and skips linking; SkipBuild returns from linking before package builds. — [packages/yarnpkg-core/sources/Project.ts#L1116-1120](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Project.ts#L1116-L1120) [packages/yarnpkg-core/sources/Project.ts#L1866-1907](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Project.ts#L1866-L1907) [packages/yarnpkg-core/sources/Project.ts#L1464-1467](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Project.ts#L1464-L1467)
- Run script: RunCommand.execute calls Configuration.find → Project.find → restoreInstallState → hasPackageScript → executePackageScript; initialization creates a temporary binary environment, then wrapScriptExecution wraps portable-shell execution. — [packages/plugin-essentials/sources/commands/run.ts#L69-83](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-essentials/sources/commands/run.ts#L69-L83) [packages/yarnpkg-core/sources/scriptUtils.ts#L458-476](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/scriptUtils.ts#L458-L476) [packages/yarnpkg-core/sources/scriptUtils.ts#L488-490](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/scriptUtils.ts#L488-L490)
- Run fallback: absent a selected script, RunCommand checks dependency binaries and forwards Node flags; otherwise it accepts one matching colon-named workspace script. Binary execution chooses Node or direct pipevp and removes its binary folder in finally. — [packages/plugin-essentials/sources/commands/run.ts#L88-143](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-essentials/sources/commands/run.ts#L88-L143) [packages/yarnpkg-core/sources/scriptUtils.ts#L763-787](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/scriptUtils.ts#L763-L787)
- State recovery: restoreInstallState reads and gunzips the saved file, deserializes it, and restores requested categories. When resolution restoration is requested, unreadable state or a changed lockfile triggers applyLightResolution → resolveEverything(lockfileOnly) → persistInstallStateFile. — [packages/yarnpkg-core/sources/Project.ts#L2052-2092](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Project.ts#L2052-L2092)

## Testing signals

Tests and CI were inspected, not executed; their existence is not a passing result. The sampled Jest suites exercise project recovery, configuration handling, installation modes, execution precedence, and mocked network behavior. CI defines broader platform and ecosystem checks, but this bounded investigation does not establish exhaustive coverage or current CI status.
- Root test:unit uses Jest 29; its Node environment applies a custom JavaScript/TypeScript transformer and polyfills, excludes acceptance-tests and plugin-compat, and sets a 50-second timeout. — [package.json#L21-27](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/package.json#L21-L27) [package.json#L62-64](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/package.json#L62-L64) [jest.config.js#L1-14](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/jest.config.js#L1-L14) [scripts/setup-ts-jest.js#L13-20](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/scripts/setup-ts-jest.js#L13-L20)
- Acceptance tests have a separate Jest configuration and setup; beforeEach starts the package server and initializes the fixture registry, and test:integration delegates to test:unit with that configuration. — [packages/acceptance-tests/jest.config.js#L1-4](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/acceptance-tests/jest.config.js#L1-L4) [packages/acceptance-tests/yarn.setup.ts#L1-11](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/acceptance-tests/yarn.setup.ts#L1-L11) [packages/acceptance-tests/package.json#L16-18](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/acceptance-tests/package.json#L16-L18)
- Project.test.ts asserts Manifest.raw updates, preservation of resolver-specific dependencies during lockfile-only resolution, and recovery after replacing installation state with invalid content. — [packages/yarnpkg-core/tests/Project.test.ts#L221-249](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/tests/Project.test.ts#L221-L249) [packages/yarnpkg-core/tests/Project.test.ts#L272-301](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/tests/Project.test.ts#L272-L301)
- Configuration.test.ts checks hideSecrets redaction for both top-level npmAuthToken and scoped tokens; this directly tests formatted access rather than every logging or subprocess exposure path. — [packages/yarnpkg-core/tests/Configuration.test.ts#L55-79](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/tests/Configuration.test.ts#L55-L79)
- Install acceptance assertions cover inline build logs, SkipBuild suppression without changing PnP artifacts, and immutable refusal to create or alter a lockfile; the inspected ZIP-symlink case excludes Windows. — [packages/acceptance-tests/pkg-tests-specs/sources/commands/install.test.ts#L134-185](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/acceptance-tests/pkg-tests-specs/sources/commands/install.test.ts#L134-L185) [packages/acceptance-tests/pkg-tests-specs/sources/commands/install.test.ts#L189-238](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/acceptance-tests/pkg-tests-specs/sources/commands/install.test.ts#L189-L238)
- Run acceptance tests cover invocation with and without run, script exit-code propagation, delegated yarnPath exit codes, dependency binary execution, and script precedence over binaries. — [packages/acceptance-tests/pkg-tests-specs/sources/commands/run.test.js#L4-48](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/acceptance-tests/pkg-tests-specs/sources/commands/run.test.js#L4-L48) [packages/acceptance-tests/pkg-tests-specs/sources/commands/run.test.js#L52-87](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/acceptance-tests/pkg-tests-specs/sources/commands/run.test.js#L52-L87)
- The inspected HTTP tests intercept requests through hooks: core checks wrapper arguments, while npm checks registry URL joining and noninteractive OTP failure. These tests do not themselves exercise real TLS, proxies, or live registry authentication. — [packages/yarnpkg-core/tests/httpUtils.test.ts#L6-34](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/tests/httpUtils.test.ts#L6-L34) [packages/plugin-npm/tests/npmHttpUtils.test.ts#L5-24](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-npm/tests/npmHttpUtils.test.ts#L5-L24) [packages/plugin-npm/tests/npmHttpUtils.test.ts#L30-71](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-npm/tests/npmHttpUtils.test.ts#L30-L71)
- Integration CI defines immutable/cache checks and sharded unit/acceptance jobs across Linux, Windows, and macOS; scheduled ecosystem workflows add compatibility checks, but the Webpack thread-loader case immediately exits and is not exercised. — [.github/workflows/integration-workflow.yml#L35-49](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/.github/workflows/integration-workflow.yml#L35-L49) [.github/workflows/integration-workflow.yml#L244-304](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/.github/workflows/integration-workflow.yml#L244-L304) [.github/workflows/e2e-vitest-workflow.yml#L24-40](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/.github/workflows/e2e-vitest-workflow.yml#L24-L40) [.github/workflows/e2e-webpack-workflow.yml#L100-104](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/.github/workflows/e2e-webpack-workflow.yml#L100-L104)

## Risk map

These are security-sensitive source observations and one explicitly labeled review hypothesis, not confirmed vulnerabilities. The main boundaries involve dynamic code, inherited environments, authenticated network requests, archive integrity, and filesystem mutation. Persistence ordering and a documented symlink uncertainty also warrant care when changing critical flows.
- Dynamic plugin loading executes dynamicRequire(pluginPath) and factory(pluginRequire); builtin modules remain available. Missing HTTP-sourced plugins are downloaded and written locally, with checksum enforcement conditional on a configured checksum. — [packages/yarnpkg-core/sources/Configuration.ts#L1311-1340](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Configuration.ts#L1311-L1340) [packages/yarnpkg-core/sources/Configuration.ts#L1360-1401](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Configuration.ts#L1360-L1401)
- Package lifecycle scripts can execute preinstall/install/postinstall or synthesized node-gyp rebuild; soft links, built metadata, enableScripts, and architecture gate these builds, while explicit run executes selected scripts through the shell. — [packages/plugin-pnp/sources/jsInstallUtils.ts#L15-41](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-pnp/sources/jsInstallUtils.ts#L15-L41) [packages/yarnpkg-core/sources/scriptUtils.ts#L458-476](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/scriptUtils.ts#L458-L476)
- Configuration reads a home RC file and configured environment files outside the immediate project boundary; makeScriptEnv copies the resulting environment into subprocess environments and prepends temporary wrappers to PATH. — [packages/yarnpkg-core/sources/Configuration.ts#L1183-1193](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Configuration.ts#L1183-L1193) [packages/yarnpkg-core/sources/Configuration.ts#L1257-1273](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Configuration.ts#L1257-L1273) [packages/yarnpkg-core/sources/scriptUtils.ts#L108-147](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/scriptUtils.ts#L108-L147)
- Network policy is configurable: unsafe HTTP requires a hostname whitelist, enableNetwork can block requests, enableStrictSsl controls certificate rejection, and optional CA/certificate/key paths are read. npm authentication may supply hook headers, bearer tokens, Basic credentials, or OIDC tokens. — [packages/yarnpkg-core/sources/httpUtils.ts#L231-239](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/httpUtils.ts#L231-L239) [packages/yarnpkg-core/sources/httpUtils.ts#L255-279](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/httpUtils.ts#L255-L279) [packages/plugin-npm/sources/npmHttpUtils.ts#L445-477](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-npm/sources/npmHttpUtils.ts#L445-L477)
- Archive mismatch handling depends on checksumBehavior: ignore preserves the expected hash, update accepts the actual hash, reset rejects the cached entry, and throw errors; check-cache overrides mismatch handling to throw, while linking requests skipIntegrityCheck. — [packages/yarnpkg-core/sources/Cache.ts#L270-321](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Cache.ts#L270-L321) [packages/yarnpkg-core/sources/Project.ts#L1208-1216](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Project.ts#L1208-L1216)
- Installation persists manifests/lockfile before linking and saves state before post-install validation; PnP finalization can remove detected node_modules or obsolete loader/unplugged artifacts, so failures can follow filesystem changes. — [packages/yarnpkg-core/sources/Project.ts#L1878-1907](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Project.ts#L1878-L1907) [packages/plugin-pnp/sources/PnpLinker.ts#L242-246](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-pnp/sources/PnpLinker.ts#L242-L246) [packages/plugin-pnp/sources/PnpLinker.ts#L315-323](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-pnp/sources/PnpLinker.ts#L315-L323)
- initializeWorkspaceEnvironment realpaths package.json to choose default cwd; its source comment explicitly says tests for that behavior are absent and the historical symlink use case is uncertain. This is a documented local coverage concern. — [packages/yarnpkg-core/sources/scriptUtils.ts#L492-512](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/scriptUtils.ts#L492-L512)
- Review hypothesis: Smart merge crosses a consequential artifact trust boundary because pull_request_target checks out the PR head to generate a patch, then a separate job applies that artifact and pushes using a bot token. Exploitability was not assessed. (inferred) — [.github/workflows/pr-smart-merge.yml#L1-3](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/.github/workflows/pr-smart-merge.yml#L1-L3) [.github/workflows/pr-smart-merge.yml#L25-40](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/.github/workflows/pr-smart-merge.yml#L25-L40) [.github/workflows/pr-smart-merge.yml#L83-126](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/.github/workflows/pr-smart-merge.yml#L83-L126)

## Extension points

The Plugin type is the primary extension contract, with factories assembling runtime integrations. Typed configuration augmentation and ordered hooks allow cross-cutting behavior without expanding command implementations. Build profiles, shell builtins, and documentation plugins provide additional extension surfaces.
- A Plugin can contribute configuration, command classes, fetchers, linkers, resolvers, and hooks; plugin-constraints demonstrates ConfigurationValueMap augmentation with typed settings and defaults. — [packages/yarnpkg-core/sources/Plugin.ts#L187-194](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Plugin.ts#L187-L194) [packages/plugin-constraints/sources/index.ts#L14-32](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-constraints/sources/index.ts#L14-L32)
- CLI commands plug into each plugin’s commands array; initCommands iterates activated plugins and registers every contributed class with Clipanion. — [packages/plugin-essentials/sources/index.ts#L172-209](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-essentials/sources/index.ts#L172-L209) [packages/yarnpkg-cli/sources/lib.ts#L135-140](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-cli/sources/lib.ts#L135-L140)
- Configuration.makeResolver constructs plugin resolver instances behind VirtualResolver and WorkspaceResolver; NpmSemverResolver demonstrates supportsDescriptor/supportsLocator, candidate selection, satisfying checks, and metadata resolution. — [packages/yarnpkg-core/sources/Configuration.ts#L1771-1785](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Configuration.ts#L1771-L1785) [packages/plugin-npm/sources/NpmSemverResolver.ts#L45-76](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-npm/sources/NpmSemverResolver.ts#L45-L76) [packages/plugin-npm/sources/NpmSemverResolver.ts#L121-155](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-npm/sources/NpmSemverResolver.ts#L121-L155)
- Configuration.makeFetcher composes builtin virtual/workspace fetchers with plugin fetchers; NpmSemverFetcher shows the cache loader pattern and filesystem/release/checksum result contract. — [packages/yarnpkg-core/sources/Configuration.ts#L1788-1800](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Configuration.ts#L1788-L1800) [packages/plugin-npm/sources/NpmSemverFetcher.ts#L29-44](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-npm/sources/NpmSemverFetcher.ts#L29-L44)
- New installation layouts implement Linker package/location lookup and makeInstaller; Installer separates installPackage, dependency attachment, finalization, retained fetch lifetimes, and migratable custom state. — [packages/yarnpkg-core/sources/Linker.ts#L28-88](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Linker.ts#L28-L88) [packages/yarnpkg-core/sources/Installer.ts#L48-82](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Installer.ts#L48-L82) [packages/yarnpkg-core/sources/Installer.ts#L85-142](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Installer.ts#L85-L142)
- Hooks can modify script environments, wrap script/network execution, reduce dependency descriptors, and validate installs; triggerHook and reduceHook await contributors sequentially in plugin iteration order. — [packages/yarnpkg-core/sources/Plugin.ts#L54-93](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Plugin.ts#L54-L93) [packages/yarnpkg-core/sources/Plugin.ts#L105-155](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Plugin.ts#L105-L155) [packages/yarnpkg-core/sources/Configuration.ts#L2030-2065](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Configuration.ts#L2030-L2065)
- Builder supports additional --plugin entries and named profiles; findPlugins accepts profile combinations separated by '+', validates them against manifest bundles, and deduplicates contributions. — [packages/yarnpkg-builder/sources/commands/build/bundle.ts#L53-59](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-builder/sources/commands/build/bundle.ts#L53-L59) [packages/yarnpkg-builder/sources/tools/findPlugins.ts#L3-20](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-builder/sources/tools/findPlugins.ts#L3-L20) [packages/yarnpkg-cli/package.json#L78-106](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-cli/package.json#L78-L106)
- The portable shell accepts custom builtins, filesystem, environment, variables, and glob behavior; documentation extends separately through remark plugins, generated CLI docs, and TypeDoc entries discovered from package exports. — [packages/yarnpkg-shell/sources/index.ts#L1015-1041](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-shell/sources/index.ts#L1015-L1041) [packages/docusaurus/docusaurus.config.ts#L16-26](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/docusaurus/docusaurus.config.ts#L16-L26) [packages/docusaurus/docusaurus.config.ts#L68-95](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/docusaurus/docusaurus.config.ts#L68-L95) [packages/docusaurus/docusaurus.config.ts#L144-162](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/docusaurus/docusaurus.config.ts#L144-L162)

## Contributor handoff

Begin with the relevant command, its core operation, and the owning plugin instead of treating this as a React application. Preserve generated-artifact boundaries, typed portable paths, and repository constraint conventions. Tests and CI were inspected, not executed; proposed checks below require separate execution authority, and the inventory remains bounded.
- Read the root and CLI manifests first: CLI version 4.18.1 differs from the root packageManager pin of Yarn 4.2.1, and standard plugin membership is declared in the CLI manifest. — [package.json#L76-86](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/package.json#L76-L86) [packages/yarnpkg-cli/package.json#L1-9](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-cli/package.json#L1-L9) [packages/yarnpkg-cli/package.json#L78-106](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-cli/package.json#L78-L106)
- For installation changes, read InstallCommand and Project.install together; the command’s source explicitly directs reusable install customization into configuration/core because other commands also install projects. — [packages/plugin-essentials/sources/commands/install.ts#L364-380](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-essentials/sources/commands/install.ts#L364-L380) [packages/yarnpkg-core/sources/Project.ts#L1750-1802](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Project.ts#L1750-L1802)
- For protocol changes, keep NpmSemverResolver.getCandidates and getSatisfying consistent: both use selectMatchingVersions, whose prerelease fallback applies only to a literal '*' with no stable matches. — [packages/plugin-npm/sources/NpmSemverResolver.ts#L15-42](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-npm/sources/NpmSemverResolver.ts#L15-L42) [packages/plugin-npm/sources/NpmSemverResolver.ts#L81-90](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-npm/sources/NpmSemverResolver.ts#L81-L90) [packages/plugin-npm/sources/NpmSemverResolver.ts#L137-147](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/plugin-npm/sources/NpmSemverResolver.ts#L137-L147)
- For linker changes, honor Installer ordering and fetch-result ownership; custom data must tolerate absence and handle its own migration, and asynchronous holds require bounded concurrency. — [packages/yarnpkg-core/sources/Installer.ts#L48-82](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Installer.ts#L48-L82) [packages/yarnpkg-core/sources/Installer.ts#L93-142](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Installer.ts#L93-L142)
- Follow strict TypeScript and the portable-path conversions already used by Workspace; ESLint requires semverUtils.validRange and httpUtils instead of direct semver.Range/validRange and global fetch. — [tsconfig.json#L3-20](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/tsconfig.json#L3-L20) [packages/yarnpkg-core/sources/Workspace.ts#L36-66](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/sources/Workspace.ts#L36-L66) [eslint.config.mjs#L85-104](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/eslint.config.mjs#L85-L104)
- Dependency edits must account for yarn.config.cjs constraints: internal dependencies become workspace:^, most shared ranges are synchronized, lodash/inquirer are forbidden, and package metadata/prepack conventions are enforced. — [yarn.config.cjs#L22-55](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/yarn.config.cjs#L22-L55) [yarn.config.cjs#L106-124](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/yarn.config.cjs#L106-L124) [yarn.config.cjs#L207-228](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/yarn.config.cjs#L207-L228)
- Edit source implementations rather than generated bundles, hooks, workers, and grammars; ESLint excludes those outputs, while CI conditionally regenerates PnP hooks and checks their diffs. — [eslint.config.mjs#L14-48](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/eslint.config.mjs#L14-L48) [.github/workflows/integration-workflow.yml#L80-89](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/.github/workflows/integration-workflow.yml#L80-L89)
- Tests and CI were inspected, not executed. For later authorized validation, start with the affected Jest file or acceptance command suite using test:unit/test:integration, then use existing test:lint and typecheck:all scripts; mocked transport tests and explicitly skipped compatibility cases limit conclusions. — [package.json#L62-64](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/package.json#L62-L64) [packages/acceptance-tests/package.json#L16-18](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/acceptance-tests/package.json#L16-L18) [packages/yarnpkg-core/tests/httpUtils.test.ts#L11-22](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/packages/yarnpkg-core/tests/httpUtils.test.ts#L11-L22) [.github/workflows/e2e-webpack-workflow.yml#L100-104](https://github.com/yarnpkg/berry/blob/e4e423a1eb117b5129f20ac626a03eb7a97aedff/.github/workflows/e2e-webpack-workflow.yml#L100-L104)

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

## Public product links

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