Skip to content
CAI
Software that uses CAICheck a score

dart-lang/pub

52.5

Adequate · 17 November 2026

33.2k

lines of production code

Dart

primary language

5

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Add sample\_reproducible\_pkg tool for testing reproducible builds

A new sample package tool has been added to the repository to support testing of reproducible build processes. This includes a minimal Dart package structure with a main entry point, library exports, and internal source files, along with standard documentation and licensing files.

_tool/sample\_reproducible\pkg · high confidence

Initial project configuration and repository setup

This change establishes the foundational configuration for the pub package manager repository. It introduces standard repository files including the BSD-style LICENSE, README, and CONTRIBUTING guidelines to define usage and contribution processes. It also sets up the development environment with .gitignore and .gitallowed (for git-secrets), configures static analysis via analysis\_options.yaml (enabling strict casting/inference and specific lints from dart\_flutter\_team\_lints), and defines test execution parameters in dart\_test.yaml (restricting platforms to VM and configuring compilers).

(repo-wide) · high confidence

Introduce SDK package configuration and dedicated SDK classes

Users can now rely on the pub tool to correctly locate and resolve packages vendored within the Dart, Flutter, and Fuchsia SDKs. This change introduces a new \sdk\_packages.yaml\ format and the \SdkPackageConfig\ parser to map SDK-internal packages, while adding specific \DartSdk\, \FlutterSdk\, and \FuchsiaSdk\ classes to handle SDK detection, version reading, and package path resolution for each environment.

lib/src/sdk · high confidence

Introduction of dependency\_services CLI entry point

A new executable entry point at bin/dependency\_services.dart has been added, providing a command-line interface for automated dependency upgrades. This tool exposes subcommands (list, report, apply) to manage dependency states, distinct from the main pub CLI. The existing bin/pub.dart entry point remains unchanged, continuing to serve as the primary interface for general package management.

bin · high confidence

New embeddable API for pub resolution and command execution

The library now exposes a new public entrypoint in \lib/pub.dart\ that allows embedding applications to programmatically control pub. This includes the \pubCommand\ function to integrate pub as a subcommand within a larger CLI, and \ensurePubspecResolved\ to trigger package resolution and download from code, which now throws a specific \ResolutionFailedException\ on failure. Additionally, \getPackageNameFromGitRepo\ is exposed to retrieve package names from Git repositories. The API also supports configuring verbose output, file systems, streams, and HTTP clients for embedding scenarios.

lib · high confidence

New pub commands: add, bump, cache, deps, downgrade, get, global, and more

The \lib/src/command\ directory now contains a comprehensive set of new command implementations for the Dart pub tool, introducing several new capabilities and restructuring existing ones. Users can now add dependencies directly via \pub add\ (supporting constraints, git, path, and hosted sources), increment package versions with \pub bump\ (major, minor, patch, breaking), and manage the system cache with \pub cache\ subcommands (add, clean, gc, list, preload, repair). Dependency inspection is enhanced with \pub deps\ (including JSON output and executable listing), while dependency resolution is managed through \pub get\, \pub downgrade\ (with tighten support), and \pub check-resolution-up-to-date\. Global package management is available via \pub global\ (activate, deactivate, list, run), and automated dependency upgrades are supported through \pub dependency-services report\. These changes collectively modernize the CLI interface, improve automation capabilities, and provide more granular control over package management and resolution.

lib/src/command · high confidence

New repository tooling for SDK tagging, package extraction, and test acceleration

Three new scripts have been added to the \tool/\ directory to support repository maintenance and testing workflows. \create\_version\_tags\_from\_sdk.dart\ automates the creation and optional pushing of \SDK-\<version\>\ git tags by cross-referencing Dart SDK releases with the current repository's pub package revisions. \extract\_all\_pub\_dev.dart\ provides a manual utility to download and extract all version archives for every package on pub.dev, tracking progress and failures in a status file. \test.dart\ improves test execution speed by precompiling the \pub\ command into a snapshot before running the test suite, reducing the overhead of loading sources for each test invocation.

tool · high confidence

New validation checks for publishing

The \pub publish\ command now runs a comprehensive suite of new validators to help authors avoid common mistakes before publishing. These include checking for \dart analyze\ issues, verifying the presence and content of \CHANGELOG.md\ and \README.md\, ensuring a \LICENSE\ file exists, and validating that package names are legal Dart identifiers. The system also warns against using deprecated \pubspec.yaml\ fields (like \transformers\ or \author\), detects potential secret leaks in source files, ensures git status is clean, and flags dependencies that use non-hosted sources or lack proper version constraints. Additionally, it validates Flutter plugin formats, SDK constraints, and directory naming conventions.

lib/src/validator · high confidence

Platform-agnostic gzip decoder implementation

The library now provides a unified \gzipDecoder\ that automatically selects the appropriate decompression backend for the current platform: it uses \dart:io\ on native environments, the browser's \DecompressionStream\ API on web (with asynchronous streaming support and handling of harmless padding errors), and throws an error on unsupported platforms. On Dart2Wasm, the web implementation also ensures efficient data handling by copying JS-backed byte arrays into native WasmGC \Uint8List\ objects before passing them to consumers.

lib/src/gzip · high confidence

Support for third-party hosted registry authentication

Users can now authenticate with third-party pub registries by storing tokens in a \pub-tokens.json\ configuration file. The system supports both direct token storage and referencing environment variables for token values, allowing credentials to be injected into HTTP requests for specific hosted URLs while ensuring tokens are not leaked to unauthorized servers. Invalid credentials are automatically detected and removed after receiving 401/403 responses.

lib/src/authentication · high confidence

Architecture

Refactored package source architecture with new base classes and descriptions

The package source system has been restructured to improve modularity and clarity. A new \CachedSource\ base class has been introduced to handle common logic for sources that install packages into the system cache (such as \hosted\ and \git\), including methods for caching, downloading, and repairing packages. The \Source\ interface has been refined, and specific source implementations (\GitSource\, \HostedSource\, \PathSource\, \SdkSource\, \RootSource\, \UnknownSource\) now use dedicated description classes (e.g., \GitDescription\, \HostedDescription\) to manage dependency metadata. This change separates the concerns of source-specific behavior from the core source interface, making the dependency resolution logic easier to maintain and extend.

lib/src/source · high confidence

Behavioural changes

Introduce FFI-based chmod and new utility libraries

Pub now uses a platform-specific FFI implementation to call the POSIX \chmod(2)\ system function directly, replacing the previous approach of spawning a subprocess for file permission changes. This change is accompanied by the addition of several new utility libraries: \ascii\_tree.dart\ for rendering file structures in the terminal, \crc32c.dart\ for computing CRC32C checksums, and \exceptions.dart\ which consolidates application-specific error classes like \ApplicationException\ and \PackageNotFoundException\.

lib/src · high confidence

Rewritten version solver with improved error reporting and backtracking

The dependency resolution engine has been completely rewritten to use a backtracking algorithm, replacing the previous approach. This change introduces a new internal data model (including \Assignment\, \PartialSolution\, and \Incompatibility\ classes) that tracks the history of decisions and derivations. For users, this results in significantly more detailed and actionable error messages when version solving fails, including explicit explanations of why conflicts occurred and suggestions for resolution (such as updating SDKs or unlocking specific packages). The solver also now better handles edge cases like retracted packages, SDK constraints, and dependency overrides, leading to more robust dependency resolution.

lib/src/solver · high confidence

Test coverage

Added comprehensive tests for pub global activate; Added golden test data for dependency\_services; Added golden tests for \pub outdated\ command; Added integration tests for the pub embedding API; Added test coverage for the \pub add\ command; Added tests for Git dependency resolution and caching; Added tests for Git package upgrade behavior; Added tests for OAuth2 credential management and authentication flows; Added tests for \pub add\ with path dependencies; Added tests for \pub run\ behavior and error handling; Added tests for adding packages from Git repositories; Added tests for adding packages from non-default hosted servers; Added tests for dependency\_services commands; Added tests for global binstub behavior; Added tests for hosted package resolution and advisory handling; Added tests for hosted package resolution and error handling; Added tests for new and existing pub commands and behaviors; Added tests for new pub cache management commands; Added tests for path dependency resolution and symlink handling; Added tests for pub cache repair behavior; Added tests for pub command overrides and resolution logic; Added tests for pub get behavior and edge cases; Added tests for pub global deactivate; Added tests for pub publish validators; Added tests for pub token management and authentication; Added tests for pub upgrade flags and behaviors; Added tests for pub upgrade reporting details; Added tests for the cache add command; Added tests for the pub deps --executables command; Added tests for the pub global list command; Added tests for the pub remove command; Expanded test coverage for package publishing and archiving; New test descriptors for Git, symlinks, package config, tar, and YAML; New test harness for embedding and testing the pub command.

Dependencies

Initial dependency lock and manifest setup

The project now includes a \pubspec.yaml\ and a generated \pubspec.lock\ file, establishing the dependency graph for the \pub\ tool. This sets the SDK constraint to \^3.7.0\ and pins direct dependencies such as \analyzer\ (10.2.0), \args\ (2.7.0), \http\ (1.6.0), and \test\ (1.31.0), ensuring reproducible builds for the package.

(dependencies) · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 50.8 → 52.5 (+1.7)
  • Rubric changed (rubric-2026.11.2 → rubric-2026.11.4) — scores are not directly comparable.

Lenses

  • Code Health 81.1 → 80.8 (-0.3)
  • Architecture 86.7 → 88.1 (+1.4)
  • Maturity 61.6 → 67.2 (+5.6)
  • Readiness 50.4 → 54.0 (+3.6)
  • Security 37.7 → 37.7 (0.0)
  • Performance 85.0 → 85.0 (0.0)

Resolved (35)

  • Leaked secret: aws-access-key (lib/src/validator/leak_detection.dart)
  • Leaked secret: aws-access-key (lib/src/validator/leak_detection.dart)
  • Leaked secret: aws-access-key (lib/src/validator/leak_detection.dart)
  • Leaked secret: aws-access-key (lib/src/validator/leak_detection.dart)
  • Leaked secret: aws-access-key (lib/src/validator/leak_detection.dart)
  • Leaked secret: aws-access-key (lib/src/validator/leak_detection.dart)
  • Leaked secret: aws-access-key (lib/src/validator/leak_detection.dart)
  • Leaked secret: aws-access-key (lib/src/validator/leak_detection.dart)
  • Leaked secret: aws-access-key (lib/src/validator/leak_detection.dart)
  • Leaked secret: aws-access-key (lib/src/validator/leak_detection.dart)
  • Leaked secret: gcp-api-key (lib/src/validator/leak_detection.dart)
  • Leaked secret: high-entropy-secret (lib/src/authentication/credential.dart)
  • Leaked secret: signing-key (lib/src/oauth2.dart)
  • No ADRs found
  • Off-boarding risk: anonymized user #1
  • Orphaned file (lib/src/authentication/client.dart)
  • Orphaned file (lib/src/crc32c.dart)
  • Orphaned file (lib/src/error_group.dart)
  • Orphaned file (lib/src/sdk/dart.dart)
  • Orphaned file (lib/src/sdk/sdk_package_config.dart)
  • …and 15 more

New (32)

  • AWS access key ID with no secret key beside it (lib/src/validator/leak_detection.dart)
  • AWS access key ID with no secret key beside it (lib/src/validator/leak_detection.dart)
  • AWS access key ID with no secret key beside it (lib/src/validator/leak_detection.dart)
  • AWS access key ID with no secret key beside it (lib/src/validator/leak_detection.dart)
  • AWS access key ID with no secret key beside it (lib/src/validator/leak_detection.dart)
  • AWS access key ID with no secret key beside it (lib/src/validator/leak_detection.dart)
  • AWS access key ID with no secret key beside it (lib/src/validator/leak_detection.dart)
  • AWS access key ID with no secret key beside it (lib/src/validator/leak_detection.dart)
  • AWS access key ID with no secret key beside it (lib/src/validator/leak_detection.dart)
  • AWS access key ID with no secret key beside it (lib/src/validator/leak_detection.dart)
  • AWS access key ID with no secret key beside it (lib/src/validator/leak_detection.dart)
  • AWS access key ID with no secret key beside it (lib/src/validator/leak_detection.dart)
  • AWS access key ID with no secret key beside it (lib/src/validator/leak_detection.dart)
  • AWS access key ID with no secret key beside it (lib/src/validator/leak_detection.dart)
  • AWS access key ID with no secret key beside it (lib/src/validator/leak_detection.dart)
  • AWS access key ID with no secret key beside it (lib/src/validator/leak_detection.dart)
  • AWS access key ID with no secret key beside it (lib/src/validator/leak_detection.dart)
  • AWS access key ID with no secret key beside it (lib/src/validator/leak_detection.dart)
  • AWS access key ID with no secret key beside it (lib/src/validator/leak_detection.dart)
  • AWS access key ID with no secret key beside it (lib/src/validator/leak_detection.dart)
  • …and 12 more

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

dart-lang/pub was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 17 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit fe190660d68a4dd3070fe33fc406ff58d754dccc — the exact code this score is about.
  • Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.85+preprod-eba6548ac50f.