RepoPilot

astral-sh / uv

Search astral-sh/uv

GitHub

Code

Understand astral-sh/uv's source layout and find a starting point for your task using the saved repository evidence.

B
Architecture grade
score 83/100
0
Import cycles
lower is better
400
Modules parsed
328 edges
100%
Layeredness
clean-layer ratio

Measured from the parsed import graph, retained from the earlier analysis. Coupling, not a reading order.

Module map

Shaded by how many modules use each one
Standalonecrates321 filesagents1 file

2 modules, 0 links. A link means one module imports another; thicker lines mean more imports. Links come from 400 parsed files of 694 source files, so counts are a sample. Select a module to trace it: blue lines go to what it uses, orange lines come from what uses it.

crates32100Standalone
agents100Standalone

Where to start reading

  1. Repository root
  2. Repository root
  3. Public API candidatename match
  4. Public API candidatename match
  5. Runtime candidatename match
  6. Runtime candidatename match
  7. Suggested starting pointAI
  8. Suggested starting pointAI

Find files for a task

AI

Add a new vulnerability audit service provider

  • Implement the provider trait matching the OSV pattern in osv.rs
  • Register the service in crates/uv-audit/src/lib.rs
  • Add SARIF or JSON output format in crates/uv-audit-operations/src/

Add support for a new authentication method (e.g., OAuth2)

  • Create provider module in crates/uv-auth/src/providers.rs
  • Implement credential encoding in crates/uv-auth/src/credentials.rs
  • Update HTTP middleware in crates/uv-auth/src/middleware.rs to handle new auth header format
  • Register the new provider in crates/uv-auth/src/lib.rs service factory

Add a new performance benchmark

  • Use Criterion.rs patterns matching uv.rs and other benches
  • Add to crates/uv-bench/Cargo.toml [[bench]] section

Change the public API

  • File-name match for this task.
  • File-name match for this task.
  • File-name match for this task.

Trace runtime behavior

  • File-name match for this task.
  • File-name match for this task.
  • File-name match for this task.

Add or update tests

  • File-name match for this task.
  • File-name match for this task.
  • File-name match for this task.

Change build or automation

  • File-name match for this task.
  • File-name match for this task.
  • File-name match for this task.

File paths come from a snapshot of up to 500 captured paths; an omitted file may still exist.

  • Public and runtime candidates are based on file names; their exports and execution paths still need checking in source.
  • The file list was refreshed after the written analysis. Subsystem descriptions and suggested changes may describe an older revision.

Code quality and hotspots

Code sample: the 15 largest source files

Branch points
66 per file on average
Code issues
20 errors, 61 warnings
Tests
present · 0.87 test files per source file
Largest file
7,793 lines
Hotspot load
8 high-risk files

Configuration status

CI/CD Pipeline — configured

Provider: GitHub Actions

46 GitHub Actions workflows

Test Suite — detected

606 test files detected

Stack: Rust test

Where: crates/uv/tests/it · crates/uv/tests/build · crates/uv-client/tests/it

Test files: 0.87 test files per source fileheuristic

606 test files / 694 source files. This is a file-count ratio, not real line coverage — set up Codecov for authoritative numbers.

Dependency Scanning — no config detected

No Dependabot / Renovate / Snyk / Trivy / CodeQL config found. Enable Dependabot or Renovate.

Live Signals

Real-time data from Codecov, GitHub Actions, GitHub Issues, deps.dev — not estimates.

CI pass rate86%

last 50 runs · median 4m

Stale-issue ratio0%

of 4 recent open issues are 30d+ old with no replies

Maintainer response17m

median first-reply across 6 recent issues · fast

Top hotspots

Files edited often AND hard to reason about. Churn = recent commit frequency, Complexity = branches and nesting, Risk = both combined. These are the highest-leverage targets for refactoring or testing.

src/registry_client.rs
Churn: 100 (34 commits/180d)Complexity: 100Risk: 100
src/distribution_database.rs
Churn: 100 (34 commits/180d)Complexity: 100Risk: 100

All hotspots

Files that change often and are complex tend to accumulate more bugs

AI-suggested anti-patterns

AI · unverified

Pattern-matches from the file structure and dependencies — useful as hypotheses, but not grounded in actual source. For real findings see Code Scanning above.

Silent credential fallback to unauthenticated access

Medium

If credential lookup fails, requests proceed without auth headers, risking rate limiting or private package rejection without explicit error.

crates/uv-auth/src/middleware.rs

Unchecked OSV service unavailability

High

Audit subsystem may silently skip vulnerability checks if OSV API is unreachable, creating false sense of security.

crates/uv-audit/src/service/osv.rs

Workspace discovery via filesystem scan without validation

Low

Workspace member detection relies on presence of pyproject.toml without schema validation, risking misconfiguration.

crates/uv-bench/benches/workspace_discovery.rs

AI-suggested bottlenecks

AI · unverified

Speculation from file structure, not profiling data. Validate against real metrics before acting on these.

I/O-bound Bottleneck

Serial metadata requests for each discovered dependency; parallelization via async HTTP mitigates but network latency remains.

PyPI metadata fetching loop in dependency resolver

Network-bound Bottleneck

External API calls for every audit operation; no local caching means repeated queries for common packages are re-fetched.

OSV vulnerability database queries in uv-audit

CPU-bound Bottleneck

Exponential backtracking on complex dependency graphs with many conflicting version constraints.

SAT solver for dependency conflict resolution

I/O-bound Bottleneck

System keyring operations are synchronous I/O; repeated credential lookups may block CLI responsiveness.

Keyring access in uv-auth cache layer

Code metrics

Static analysis on sampled source files (up to 15 files).

Avg Cyclomatic Complexity66

Counts if/for/while/switch/catch/ternary branches

Errors / Warnings20 / 61

Secrets, empty catches, console.log, var usage, long lines

Largest File Analyzed7793 lines
crates/uv-cli/src/lib.rs