Skip to main content

whichdep

Which dependency update broke your build? whichdep finds it for you.

Your CI was green, then a cargo update, a Dependabot PR or a fresh install pulled in 30 new package versions and the tests went red. git bisect does not help: your code did not change, your lockfile did. whichdep takes the lockfile that worked and the one that does not, applies subsets of the differences to a copy of your project, runs your test command, and narrows the failure down to the smallest set of package updates that still breaks it. That is delta debugging (Zeller's ddmin) over packages instead of commits.

$ whichdep --good v1.4.0 -- cargo test
whichdep 0.0.1 · cargo · Cargo.lock
  9 changes (8 updated, 1 new)

  #1   pass        good lockfile       exit 0
  #2   fail        bad lockfile        exit 101
  #3   pass        5 of 9 updates      exit 0
  ...

Culprit
  gamma  1.0.0 → 1.0.1

Verified: The bad lockfile without this culprit passes the tests again.

To put them back to the good versions:
  cargo update gamma@1.0.1 --precise 1.0.0

(The output above is illustrative; see tests/e2e.rs for runs against real tools.)

Why not just bisect by hand?

  • Interactions. Two updates that only break together come back as a pair, not as a wrong single answer.
  • Several culprits. After finding one it reverts it in the bad lockfile and checks; if the tests still fail it keeps going.
  • Invalid mixes are not blamed. A half-applied update that Cargo cannot lock, or that pip check rejects, is classified unresolved and skipped, never counted as a failure.
  • Fast. Roughly 2·log2(n) trials for one culprit; identical rendered lockfiles are not run twice, and conclusive trial outcomes can be reused across runs.
  • Isolated. Each trial starts from a fresh copy of the project. Build caches, logs and experiment history live outside your source tree.

Install

cargo install --path .

No dependencies, builds offline. Needs git; uv for the pip ecosystem (falls back to venv + pip).

Usage

whichdep --good <REV|FILE> [--bad <REV|FILE>] [--lockfile PATH] -- <test command>
whichdep --good <REV|FILE> --list          # only show what changed
whichdep adapters [--json]                 # list supported ecosystems
whichdep history [ID] [--json | --html]    # inspect store or export dashboard HTML
whichdep clean [--build-only]              # reclaim cache/store disk space
whichdep format --input rep.json --format github-comment
Option Meaning
--good Lockfile that works: a git revision or a file
--bad Lockfile that fails (default: working tree)
--lockfile Cargo.lock, uv.lock, pinned requirements.txt, package-lock.json, or pnpm-lock.yaml (auto-detected)
--ecosystem cargo, uv, pip, npm, pnpm (guessed from lockfile name)
--strategy ddmin (default), bisect, adaptive, or one-by-one
--repeat N Run the test N times per trial; disagreement = flaky = unresolved
--timeout S Kill a run after S seconds; counts as a failure (finds hangs)
--max-trials N, --max-culprits N Budgets
--prepare SCRIPT Replace the built-in environment setup (none skips)
--json, --format FMT text, json (whichdep-report-v2), markdown, github-comment, html
--out PATH Write the rendered report to a file
--github-summary Append Markdown summary to $GITHUB_STEP_SUMMARY and emit CI annotations
--keep, -v Keep trial workspaces, stream command output
--isolate-target Isolate build target dirs per rendered lockfile instead of sharing per experiment
--no-resume Re-run trials instead of reusing persisted conclusive results

The test command's exit status: 0 pass, 125 cannot be tested (like git bisect run), anything else fail. Exit status of whichdep: 0 found, 1 no result, 2 usage/environment error.

Run it in the directory that contains the lockfile, with the bad state checked out. Only the lockfile varies between trials; code and manifest stay as they are.

How it works

  1. Parse both lockfiles and compute the changes (one unit per package whose locked versions differ).
  2. Check the endpoints: good must pass, bad must fail.
  3. ddmin over the units. Requirements between units (a new crate that needs a new major of another) are respected so impossible lockfiles are not proposed.
  4. Each trial renders a lockfile, builds the environment, verifies that the resolver kept it as written, then runs your test command.
  5. Revert what was found in the bad lockfile and test again to confirm.

Every trial is run in a fresh copy of the project. The reusable Cargo build cache is stored under the whichdep cache directory, not in ./target. The persistent store keeps experiment metadata, diagnosis snapshots, command logs and conclusive trial outcomes. Its default location is $WHICHDEP_HOME, then $XDG_CACHE_HOME/whichdep, then ~/.cache/whichdep (or the platform cache location). --no-resume disables reading old outcomes but still records the new run. Unresolved outcomes are never persisted. If a fresh run disagrees with a previously cached result for the same key, that cache entry is removed.

Using the Rust library

The search engine can be used without the CLI, Git handling or a process runner. A caller supplies an Experiment, a dependency Closure, and any implementation of the Oracle trait:

use whichdep::{Change, Engine, Experiment, NoClosure, Outcome, Set, Snapshot};

let experiment = Experiment::new(
    "example-1",
    "example regression",
    "custom",
    Snapshot::new("good", "good-state-fingerprint"),
    Snapshot::new("bad", "bad-state-fingerprint"),
    vec![Change {
        name: "library-a".into(),
        from: vec!["1.0".into()],
        to: vec!["2.0".into()],
    }],
    "test-oracle-v1",
);
let mut oracle = |changes: &Set| {
    if changes.contains(&0) { Outcome::Fail } else { Outcome::Pass }
};
let diagnosis = Engine::new()
    .run(&experiment, &NoClosure, &mut oracle)
    .expect("experiment runs");
println!("{:?}", diagnosis.findings);

For persistent history and trial caching, pass an ExperimentStore to Engine::with_store and enable reuse with .with_resume(true). The CLI does this by default and prints an experiment ID that identifies its history folder. Cache identity includes the endpoint fingerprints, change units, ecosystem, oracle fingerprint and dependency-closure fingerprint. Callers must make the oracle fingerprint cover every input that can affect its result (tool versions, environment, source tree, command and settings). Custom Closure implementations must return a stable cache_fingerprint() to enable persistent trial reuse; otherwise history is still stored but cross-run cache reuse is disabled. Fingerprints are non-cryptographic, so use --no-resume for volatile or untrusted external oracles. The engine persists each conclusive Pass and Fail outcome immediately when a trial finishes; unresolved states are retried. This allows a later run to continue after an interrupted process, not only after a budget-limited run.

Limitations (v0.0.1)

  • Ecosystems: Cargo.lock (v3/v4), uv.lock (v1), pinned requirements.txt, package-lock.json (v2/v3), and pnpm-lock.yaml (v6/v9), plus custom adapters via AdapterRegistry. See docs/PLATFORM.md for the Adapter API, search strategies, machine-readable JSON schemas, GitHub Action (action.yml), and HTML dashboard export.
  • No reproduced upstream bug is in the regression corpus yet; tests/regression_corpus/README.md lists candidates and admission criteria. The existing Cargo/Python/npm/pnpm integration tests use synthetic fixtures/registries.
  • The persistent store saves fingerprints, metadata, trial outcomes and command logs, but not a full source archive. Use --keep to retain the exact temporary project/trial workspaces for manual replay.
  • Workspace manifests that changed between good and bad are reported as a warning; the baseline may then be unresolved.
  • Path dependencies outside the project directory are not copied.
  • The fresh-workspace boundary is filesystem isolation, not a security sandbox: test and prepare commands still run as the current user and can access the network, home directory and external services.
  • Persistent resume is only as correct as the supplied Oracle and Closure fingerprints. External services, tool binaries changed in place, and environment inputs not captured by the caller may require --no-resume.
  • On non-Unix platforms, symbolic links in the project copy are currently rejected rather than followed. Process-tree termination on timeout is strongest on Unix.

culpip (Python only, alpha), where-broke (npm, one library's versions), debbisect (Debian snapshots), lockvet (explains lockfile diffs, runs no tests), EnvCause (ddmin over .env).

See PLAN.md for the measurement plan and roadmap.

License

Apache-2.0

Metadata

Release files for whichdep 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for whichdep 0.0.1
File Size Uploaded Provenance Actions
whichdep-0.0.1.tar.gz 121.6 kB With provenance Details for whichdep-0.0.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for whichdep 0.0.1
File Actions
whichdep-0.0.1-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details for whichdep-0.0.1-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
whichdep-0.0.1-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for whichdep-0.0.1-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
whichdep-0.0.1-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for whichdep-0.0.1-py3-none-macosx_11_0_arm64.whl
whichdep-0.0.1-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details for whichdep-0.0.1-py3-none-macosx_10_12_x86_64.whl

Total release size: 2.5 MB

Release files / whichdep-0.0.1.tar.gz

Download URL whichdep-0.0.1.tar.gz
Size 121.6 kB
Tags Source
SHA-256 checksum
How to use checksums
baf6537d24fa99220b80cc826fba93d983abae2975805a0bb3c2fe32e6902ead
BLAKE2b-256 checksum
How to use checksums
555b8a7b54ca426247825330d9dfea2d013b86f173ef3b643edc2de8a7c8d729
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / whichdep-0.0.1-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL whichdep-0.0.1-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 635.6 kB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
9b1dfb1f444cd4584a724993bdda41f73382a02c3f7b6188403615d7b5209688
BLAKE2b-256 checksum
How to use checksums
1b4a26e7285435c38bcc9829309bc0dedcb3e315a3b2daf198c678444874c03c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / whichdep-0.0.1-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL whichdep-0.0.1-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 579.2 kB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
57da8a51b51ea6e0a9ce39cf648b1271ebd88a3359713c32bd7b5e86bf6239b5
BLAKE2b-256 checksum
How to use checksums
c69def5c675f6e1dd09f11c508a638de458a2950f9367565ced60df33e0cc88f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / whichdep-0.0.1-py3-none-macosx_11_0_arm64.whl

Download URL whichdep-0.0.1-py3-none-macosx_11_0_arm64.whl
Size 550.7 kB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
245723f144cd0800714369f6dc3e5a30c1bfc34fa3c79be36842106fc5a35287
BLAKE2b-256 checksum
How to use checksums
37bf5ee34da12aa709ea9d574adbd1e4cb0e695d94b044191753ce6e092b9b31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / whichdep-0.0.1-py3-none-macosx_10_12_x86_64.whl

Download URL whichdep-0.0.1-py3-none-macosx_10_12_x86_64.whl
Size 614.0 kB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
fbfa5847f24fcd34e9e7ce837c6f8fe736c6a1b1bd0a1d530f4689229d7b4552
BLAKE2b-256 checksum
How to use checksums
e6283e0078cb387ba2036c673471c7e9b44180cf337464f36e2a8b58fd40d3d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Security for whichdep 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for whichdep-0.0.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

5 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page