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

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:

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

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.