한 곳에 정의 — 50군데에서 호출. 함수 이름만으로는 내부 로직이 안 보인다.
// payment-service.ts
const display = formatPrice(amount, currency);
// refund-service.ts
const display = formatPrice(amount, currency);
// invoice-service.ts
const display = formatPrice(amount, currency);
- 호출자는 내부 구현을 모름
- agent가 분석하려면 정의 찾아가야
- 50군데 호출 → context 비용 polynomial 증가
- 추상화가 또 하나의 언어를 만든다
Agent 최적화
일관 반복 (Consistency)
패턴이 정확히 동일한 반복. agent는 어디서 보든 즉시 이해한다.
// payment-service.ts
const display = `${currency} ${(amount / 100).toFixed(2)}`;
// refund-service.ts
const display = `${currency} ${(amount / 100).toFixed(2)}`;
// invoice-service.ts
const display = `${currency} ${(amount / 100).toFixed(2)}`;
- 추상화 layer를 따라 들어갈 필요 없음
- 새 모듈도 이 줄을 그대로 복사
- variance = 0
- agent의 출력이 매번 같은 패턴으로 수렴