Multiple consumers compute the same derived values from the same source data, each independently re-deriving the result.
The agent encounters consumers each independently computing the same derived values from the same source; reasoning about consistency requires tracing every derivation.
Multiple derived values from the same source come from one transform that produces an enriched record.
One transform produces the enriched record from the input; the agent reads one input-to-shape contract and consumers read named output fields without simulating the derivation.
Before the refactoring
function baseCharge(reading) { return reading.kwh * reading.tariff.baseRate; }function taxableCharge(reading) { return reading.kwh * reading.tariff.taxRate; }// every consumer recomputes:const monthly = baseCharge(reading) + taxableCharge(reading);const discount = baseCharge(reading) * 0.95;
After the refactoring
function enrich(reading) {return {...reading,baseCharge: reading.kwh * reading.tariff.baseRate,taxableCharge: reading.kwh * reading.tariff.taxRate,};}const r = enrich(reading);const monthly = r.baseCharge + r.taxableCharge;const discount = r.baseCharge * 0.95;
Derivations drift between consumers as they age; bugs hide where two consumers compute slightly different versions; performance suffers from redundant computation.
Each consumer re-derives the same values; the agent can't trust them to be consistent and must verify equivalence on every change.
Building a transform up-front when only one derivation exists is BDUF — wait for the second derivation before introducing the transform.
Building the transform when only one consumer exists creates an intermediate type the agent must learn before its second use justifies it.
Derivations stay consistent (no two callers compute slightly different versions); cache invalidation becomes obvious.
Derivations are consistent by construction; the agent reads field accesses on the enriched record instead of computing across the codebase.
Building a transform up-front when only one consumer derives anything — BDUF abstraction that adds an intermediate type without an active second user.
Pre-building transforms for hypothetical consumers creates intermediate shapes the agent must understand and maintain with no active reuse.