c24165b8bc
에이전트 8종(대화형/프로그래머 C·S/디자이너/설계자/기획자/QA/PD/PM)에게 [공통 기본 능력 + 롤별 Specialty] 2층으로 지식을 주입하기 위한 재분류. 문서 내용·포맷은 무수정, 폴더 이동만 (6,372개 문서 수 보존 확인). - Topic_Programming → Domain_Programming (내부 구조 보존) - Topic_Graphic → Domain_Design - Topic_Business → Domain_Product - Topic_General → Domain_General - _Common 신설: Math(구 Topic_Math_Specialty), Reasoning(구 General/From_Thinking & Reasoning), Reasoning_Creativity(구 General/From_창의성), Communication(Poetic_Blog_Writing + From_writing) - 타 도메인의 From_* 폴더는 유지 (출처 표기일 뿐, 이미 도메인에 맞게 분류된 문서) - 빈 폴더 정리 (memory/procedures) - 에이전트→폴더 매핑은 workspace의 .astra/agent-knowledge-map.json (9개 에이전트) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
5.3 KiB
5.3 KiB
id, title, category, status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, verification_status, tags, raw_sources, last_reinforced, github_commit, tech_stack
| id | title | category | status | canonical_id | aliases | duplicate_of | source_trust_level | confidence_score | verification_status | tags | raw_sources | last_reinforced | github_commit | tech_stack | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| wiki-2026-0508-cross-cutting-concerns | Cross-Cutting Concerns | 10_Wiki/Topics | verified | self |
|
none | A | 0.9 | applied |
|
2026-05-10 | pending |
|
Cross-Cutting Concerns
매 한 줄
"매 module 매 흩어지는 functionality (logging, auth, tx) 의 횡단". AOP (Aspect-Oriented Programming, Kiczales 1997) 의 motivation. 2026 현재 NestJS interceptors, Spring AOP, OpenTelemetry auto-instrumentation, Sidecar (Istio) 매 modern realization.
매 핵심
매 정의
- 단일 module 의 boundary 를 넘어 매 application 매 widely-scattered concern.
- Tangled with business logic → SoC (Separation of Concerns) 위반.
- Solution: 매 aspect, decorator, middleware, sidecar, interceptor 로 추출.
매 typical concerns
- Logging / tracing — 매 method entry/exit log.
- Authentication / authorization — 매 endpoint 매 token check.
- Transaction management — DB tx begin/commit/rollback.
- Caching — function result memoization.
- Validation — input schema check.
- Rate limiting — request throttling.
- Metrics / observability — counter, histogram.
- Error handling — global exception mapper.
- i18n — locale-aware response.
- Audit — who/when/what.
매 응용
- Web framework middleware (Express, NestJS).
- Spring
@Transactional/@Cacheable. - Service mesh (Istio) — mTLS, retry, circuit-break 매 sidecar.
- OpenTelemetry auto-instrumentation 매 tracing 매 zero code change.
💻 패턴
NestJS interceptor — logging + timing
@Injectable()
export class LoggingInterceptor implements NestInterceptor {
intercept(ctx: ExecutionContext, next: CallHandler) {
const start = Date.now();
const req = ctx.switchToHttp().getRequest();
return next.handle().pipe(
tap(() => log.info({ url: req.url, ms: Date.now() - start }))
);
}
}
NestJS guard — authz
@Injectable()
export class RolesGuard implements CanActivate {
canActivate(ctx: ExecutionContext): boolean {
const required = Reflect.getMetadata('roles', ctx.getHandler());
const user = ctx.switchToHttp().getRequest().user;
return required.some(r => user.roles.includes(r));
}
}
Spring AOP — @Transactional
@Service
public class OrderService {
@Transactional
public Order place(Order o) {
repository.save(o);
inventory.decrement(o.itemId);
// throw → rollback
}
}
Python decorator — caching
from functools import lru_cache
@lru_cache(maxsize=1024)
def expensive_lookup(key: str) -> Result:
return db.query(key)
TypeScript decorator (TC39 stage 3) — metrics
function timed<This, Args extends any[], Return>(
target: (this: This, ...args: Args) => Return,
ctx: ClassMethodDecoratorContext
) {
return function (this: This, ...args: Args): Return {
const start = performance.now();
try { return target.apply(this, args); }
finally { metrics.histogram(ctx.name, performance.now() - start); }
};
}
class API {
@timed
fetchUser(id: string) { /* ... */ }
}
OpenTelemetry — zero-code tracing
# auto-instrumentation, no code changes
# pip install opentelemetry-distro opentelemetry-instrumentation-fastapi
# opentelemetry-instrument --traces_exporter otlp uvicorn app:app
Service mesh (Istio) — mTLS via sidecar
apiVersion: security.istio.io/v1
kind: PeerAuthentication
metadata: { name: default, namespace: prod }
spec:
mtls: { mode: STRICT }
매 결정 기준
| 상황 | Approach |
|---|---|
| Single service, JS/TS | NestJS interceptor / Express middleware |
| JVM, mature DI | Spring AOP / aspectj |
| Polyglot microservices | Service mesh (Istio / Linkerd) |
| Tracing only | OpenTelemetry auto-instrumentation |
| Function-level caching | language-native decorator |
기본값: framework-native (interceptor/middleware/decorator) for in-process; service mesh for network-level.
🔗 Graph
- 부모: Separation of Concerns · Software Architecture
- 변형: Aspect-Oriented Programming (AOP)
- 응용: NestJS · Istio · OpenTelemetry
- Adjacent: Dependency Injection (의존성 주입)
🤖 LLM 활용
언제: identify cross-cutting concern in legacy code, refactor to aspect/middleware. 언제 X: design-time SoC decision (need human architectural taste).
❌ 안티패턴
- Concern duplication: 매 controller 매 try/catch + log + auth 매 copy-paste.
- Aspect overuse: business logic 까지 aspect 로 → magic, debugging hell.
- Order dependency 무시: interceptor chain 의 순서 의존 → fragile.
- Side-effect in interceptor: DB write 매 logging interceptor → tx boundary 깨짐.
🧪 검증 / 중복
- Verified (Kiczales et al. 1997 AOP, Spring/NestJS docs 2026).
- 신뢰도 A.
🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — full content covering interceptors, decorators, service mesh |