A field on class A whose value is determined by data on class B (`customer.discountRate` set from `customer.plan.kind`) — the field belongs with the data it's derived from.
The agent finds a field on class A whose value is determined by data on class B; reasoning about the field's value requires loading B to verify the derivation.
Each field belongs to the class that owns its lifecycle; cross-class reaching disappears.
Each field lives in the class that determines its value; reading the field and reading the data that determines it happen in the same class file.
Before the refactoring
class Customer {plan;discountRate;}// every customer in a given plan gets the same rate:customers.forEach(c => c.discountRate = c.plan.kind === 'gold' ? 0.15 : 0.05);
After the refactoring
class Plan {kind;discountRate;}class Customer { plan; }customer.plan.discountRate;
Every consumer of A must maintain the cross-class invariant; refactoring B's data shape breaks A in non-obvious ways; the field's true owner is invisible.
Every consumer must maintain the cross-class invariant; the agent verifying any change must coordinate updates across both classes.
Every reader of the original class now reaches across the new class boundary — coupling drops at the field's new home but reappears at each consumer.
Every previous reader of the field now loads the new owner class to read it; tokens that previously stayed in one file now span two, and the agent follows the new boundary at every read site.
Class boundaries align with data ownership; mutations are local; refactoring becomes safer.
Mutations to the field stay inside the class that determines its value; the agent reads one class file to predict both the field's value and the data that drives it.
Moving fields whose presence on the original class is part of the class's identity — even when the value derives elsewhere, moving the field can break consumer expectations.
Moving fields purely on derivation grounds — without checking whether the original class's identity depends on the field's presence — breaks consumer expectations the agent didn't model.