Exclusive branch links
noExclusiveLink(a, b) checks that two branches do not depend on each other through a private leak. Shared kernel nodes are allowed:
export function keepFeatureBranchesIndependent(graph: ArchitectureGraph) {
noExclusiveLink(graph.route('/admin'), graph.route('/checkout'));
}What it prevents
Suppose two features are intended to be independent:
admin → checkout-private-service → checkoutThe application has now created a hidden integration. A future checkout rewrite must preserve an admin-only dependency, and removing the link can break a route that was never listed as a consumer.
The same problem appears between feature services:
UserList → UserMutation → UserListor when one route reaches directly into another feature's private data service.
Shared kernels are not leaks
This is allowed:
admin → Auth
checkout → AuthThe helper stops membership at other provides sites, so a common auth service, HTTP boundary or browser boundary is treated as shared infrastructure rather than as a feature-to-feature link.
Use it with routes or services
The arguments are graph nodes, so the same invariant can protect route branches, feature services or any two catalog lookups.