Domain Connections
How Scrubby knows which domains are coupled to which others, and why that connection graph keeps changing.
Domains are linked by weighted connections representing how tightly two areas of a codebase are coupled. A higher weight means a change in one domain is more likely to require a change in the other. This is what powers blast-radius analysis. Before editing a file, Scrubby can point to the other domains a change is likely to affect.
Where connections come from
- Co-change history: domains whose files frequently change together in the same commits.
- Import relationships: code in one domain that imports code from another.
- Review findings: connections strengthen when reviews repeatedly produce useful findings tied to that pairing, and fade when they stop being useful.
File-level co-change
Underneath the domain-level graph, Scrubby also tracks file-level co-change: which specific files tend to change together, learned from git commit history (for example, a model and its migration, or an API endpoint and its client). When a changeset touches one file but not its usual co-change partner, that's a gap:
- Model change without a migration.
- API endpoint change without a client update.
- Code change without a test update.
- Controller change without a route update.
These gaps are what Files you may have forgotten calls-out in PR Reviews.
Why connections keep changing
Every review can produce findings, and each finding is tied to the domain that produced it. When your editor calls scrubby_report_findings after a review, that result feeds back into the connection weights. Pairings that keep producing useful findings get stronger, and ones that don't fade. Global-domain connections are shared across repositories, so a new repository starts with reasonable defaults. A repository's own connections tune specifically to its code as it's used.
Viewing the connection graph
scrubby_get_network— returns every domain connection for a repository, sorted by weight.- Dashboard — a repository's detail page visualizes the same graph.
Accuracy and history depth
Connections improve with more git history. A repository with only a handful of commits doesn't have enough signal to form reliable pairs yet, though Scrubby still reviews it for conventions and domain crossings in the meantime. A rename done as delete-and-add rather than a tracked rename can break the chain of history for a file. Squashing or force-pushing resets the co-change view of the affected commits, and the model rebuilds on the next index.