Boundary Sensors
“This package must not import that package.” A sensor of encapsulation and module boundaries — computationally enforced, not prose rules.
Boundary sensors are the module-level version of fitness functions: they assert that specific imports or dependencies are forbidden. Unlike complexity metrics, they have high oracle strength — a forbidden import is a definitive violation.
Sensor properties
| Property | Value |
|---|---|
| Oracle strength | High — a boundary violation is definitive |
| Independence | High — rules are external to the code |
| Scope | Module-level |
| Feedback latency | Seconds |
| Actionability | Guiding — shows exactly which import violates the boundary |
| Type | Predictive |
What it cannot detect
Boundary sensors check structural boundaries, not behavioral boundaries. A module can respect import boundaries while still violating encapsulation through shared mutable state.