Dependency Philosophy

rho is conservative about adding external dependencies. Every new dependency is a supply-chain commitment that affects build times, binary size, audit surface, and maintenance burden.

Decision framework

Before adding a dependency, answer these questions:

  1. Can we write it ourselves in < 100 lines? → Write it. rho prefers small, purpose-built implementations over pulling in a crate for something trivial.

  2. Is it already a transitive dependency? → If reqwest already pulls in serde_urlencoded, we can use it directly without adding a new top-level dependency.

  3. Is it the de-facto standard for the problem?serde, tokio, clap, tracing are widely adopted, well-maintained, and unlikely to cause issues. Standard choices are preferred over novel alternatives.

  4. Is the maintenance track record good? → Check last release date, open issues, contributor count. A crate that hasn't been updated in 2 years is a risk.

Current dependencies

rho's direct (non-transitive) dependencies are:

CratePurposeRationale
reqwestHTTP clientDe-facto standard; needed for model API
tokioAsync runtimeDe-facto standard; needed for async I/O
serde + serde_jsonSerializationEssential; no practical alternative
tomlConfig parsingStandard for TOML in Rust
clapCLI parsingDe-facto standard; derives-based API
tracingStructured loggingDe-facto standard; log-compatible
async-traitAsync trait supportRequired for Box<dyn Tool>
thiserrorError derive macrosClean error type definition
anyhowErgonomic error handlingUsed in binary crates (rho, xtask); library crates use domain-specific error types
ignore.gitignore walkingFrom ripgrep; mature, well-maintained
tree-sitter + grammarsSyntax analysisStandard for tree-sitter in Rust
whichExecutable detectionSmall, focused, no replacement needed

What we don't depend on

AvoidedWhy
scraper (HTML parsing)Not yet needed; regex-based extraction suffices for now
ureq (minimal HTTP)reqwest already in tree; adding a second HTTP client is fragmentation
anyhowBinary crates only
randUUID generation uses uuid crate only in test helpers (dev-only)
clap-cargoManual cargo_metadata integration avoided; --version from clap derive