A change to a shared library can pass its own tests and still break a service that consumes it. A dependency graph makes those relationships queryable, helping developers and agents find the right code and identify a change’s potential blast radius. section 10.2.2
Build configuration can record what projects depend on, their available tasks, and their inputs and outputs. Project tags can distinguish production packages from deprecated ones. A forward-dependency query finds what a target uses; a reverse-dependency query finds its consumers. section 10.2.2
Use the graph as part of the change workflow:
- Navigate to the intended project and check its status before editing; ask the team if its status is unknown. section 10.2.2
- For a shared-library change, query reverse dependencies and run the consumers’ tests, not just the library’s tests. section 10.2.2
- Investigate consumer failures and include the affected consumers in the pull request. section 10.2.2
Listing 10.2 Query-based navigation and blast radius computation
bazel query 'deps(//packages/checkout:all)' --output=package # Navigation: what does checkout depend on? bazel query 'rdeps(//..., //libs/shared-utils:all)' --output=package # Blast radius: what depends on shared-utils? bazel test $(bazel query 'rdeps(//..., //libs/shared-utils:all)' \ --kind='test_suite rule') # Targeted testing: only test what this change actually affects
Bazel queries illustrate forward dependencies, reverse dependencies, and targeted tests for a shared library. section 10.2.2
The graph is only a safety net if it reflects real dependencies. Strict dependency enforcement prevents imports from bypassing declarations, but it also exposes cross-team conflicts and requires coordination. A build-time graph does not describe deployment configuration or establish runtime behavior; affected tests still need to be reliable. section 10.2.6 section 3.3.4 section 10.9
Modernizing a shared dependency
To upgrade a serialization library in a shared API, query its consumers, use those relationships to sequence the upgrade, and run the affected tests. Check whether consumer tests actually cover the serialized formats. Automated changes can then be triaged for merge or human review. section 10.6.1








