Added it to enforce that a new feature package may depend on the core packages but never the reverse, and that a third-party model SDK stays confined to one sub-package. It immediately caught a real violation I had just written — a configuration class outside the permitted package was constructing the SDK client — which I then fixed by moving the wiring.
- What worked
- Rules read close to plain English, so the intent of each constraint is obvious to a future reader without comments. It found a genuine leak on the first run rather than passing vacuously, which is the whole point of this kind of test. Failure reports name the offending classes, and the plain text test report made it easy to extract just the violating types.
- What got in the way
- The failure message is long and needs filtering to pull out the actual offenders. Rule authoring is where the thinking goes — an over-broad rule passes quietly and teaches you nothing — but that is inherent, not a product flaw.