refactor(topics): 멀티 에이전트용 지식 재편 — _Common(공통 기본기) + Domain_* 구조

에이전트 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>
This commit is contained in:
Antigravity Agent
2026-07-11 11:05:56 +09:00
parent 6549ead309
commit c24165b8bc
6193 changed files with 1717 additions and 31 deletions
@@ -0,0 +1,171 @@
---
id: wiki-2026-0508-simple-event-processing
title: Simple Event Processing
category: 10_Wiki/Topics
status: verified
canonical_id: self
aliases: [SEP, Direct Event Handling, 1:1 Event Processing]
duplicate_of: none
source_trust_level: A
confidence_score: 0.9
verification_status: applied
tags: [event-driven, architecture, eda, messaging]
raw_sources: []
last_reinforced: 2026-05-10
github_commit: pending
tech_stack:
language: typescript
framework: kafka
---
# Simple Event Processing
## 매 한 줄
> **"매 1 event → 1 reaction. No correlation, no aggregation, no temporal pattern."**. 매 EDA 의 simplest tier — notable event 의 detect 후 매 single downstream action 의 trigger. 매 CEP (Complex Event Processing) / ESP (Event Stream Processing) 와 대비되는 매 baseline pattern.
## 매 핵심
### 매 SEP vs ESP vs CEP
- **SEP**: 1 event → 1 action. No state, no correlation.
- **ESP**: stream 의 windowing, aggregation (Flink, Kafka Streams).
- **CEP**: pattern matching across events (Drools Fusion, Esper).
### 매 properties
- Stateless (매 event 의 self-contained).
- Low latency (no buffering / windowing).
- High throughput (parallelize trivially).
- Idempotent handlers preferred (at-least-once delivery).
### 매 응용
1. Order placed → email confirmation.
2. User signup → welcome workflow.
3. Sensor reading → threshold alert.
4. Payment captured → inventory reserve.
5. Log line → metric increment.
## 💻 패턴
### Kafka consumer (TypeScript)
```typescript
import { Kafka } from 'kafkajs';
const kafka = new Kafka({ brokers: ['localhost:9092'] });
const consumer = kafka.consumer({ groupId: 'order-emails' });
await consumer.subscribe({ topic: 'orders.placed' });
await consumer.run({
eachMessage: async ({ message }) => {
const order = JSON.parse(message.value!.toString());
await sendOrderEmail(order.userId, order.id);
},
});
```
### AWS EventBridge rule
```typescript
import { EventBridgeClient, PutRuleCommand } from '@aws-sdk/client-eventbridge';
await client.send(new PutRuleCommand({
Name: 'order-placed-email',
EventPattern: JSON.stringify({
source: ['app.orders'],
'detail-type': ['OrderPlaced'],
}),
Targets: [{ Arn: lambdaArn, Id: 'send-email' }],
}));
```
### NATS subject handler
```typescript
import { connect, StringCodec } from 'nats';
const nc = await connect({ servers: 'nats://localhost:4222' });
const sc = StringCodec();
const sub = nc.subscribe('orders.placed');
for await (const msg of sub) {
const order = JSON.parse(sc.decode(msg.data));
await reserveInventory(order);
}
```
### Idempotent handler
```typescript
async function handleOrderPlaced(event: OrderEvent) {
const seen = await redis.set(`processed:${event.id}`, '1', 'NX', 'EX', 86400);
if (!seen) return; // already handled
await sendEmail(event);
}
```
### Dead-letter handling
```typescript
await consumer.run({
eachMessage: async ({ message }) => {
try {
await handle(message);
} catch (err) {
await producer.send({
topic: 'orders.placed.dlq',
messages: [{ value: message.value, headers: { error: err.message } }],
});
}
},
});
```
### CloudEvents envelope
```typescript
const cloudEvent = {
specversion: '1.0',
type: 'com.example.order.placed',
source: '/orders',
id: crypto.randomUUID(),
time: new Date().toISOString(),
data: { orderId, userId, amount },
};
await producer.send({ topic: 'orders.placed', messages: [{ value: JSON.stringify(cloudEvent) }] });
```
### Webhook fan-out
```typescript
app.post('/webhooks/payment', async (req, res) => {
await eventBus.publish('payment.captured', req.body);
res.status(202).end();
});
```
## 매 결정 기준
| 상황 | Approach |
|---|---|
| 1:1 event → action, stateless | SEP |
| Stream aggregation (window sums) | ESP (Flink) |
| Pattern detect (A then B within 5s) | CEP (Esper) |
| Cross-system fan-out | SEP via EventBridge/Kafka |
**기본값**: Kafka or EventBridge + idempotent stateless handlers.
## 🔗 Graph
- 부모: [[Event-Driven-Architecture]]
- 변형: [[Event Stream Processing]]
- 응용: [[Webhooks]] · [[Pub-Sub]] · [[Event Sourcing]]
- Adjacent: [[CQRS]]
## 🤖 LLM 활용
**언제**: stateless 1:1 event handling — webhook, notification, simple workflow trigger.
**언제 X**: pattern correlation 필요 — CEP / ESP 사용.
## ❌ 안티패턴
- **Stateful SEP**: 매 cross-event state 가지면 ESP 로 reframe.
- **No idempotency**: at-least-once delivery 에서 매 duplicate side-effect.
- **Synchronous webhook chain**: 매 cascading failure — async queue 사이로.
## 🧪 검증 / 중복
- Verified (Hohpe Enterprise Integration Patterns, Confluent docs, AWS EventBridge guide).
- 신뢰도 A.
## 🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — SEP vs ESP vs CEP, Kafka/EventBridge/NATS patterns |