Files
2nd/10_Wiki/Topics/Architecture/Thought-Architecture.md
T
koriweb d8a80f6272 chore(wiki): dangling 링크 canonical 정규화 (768파일/1200건)
이름만 다른(표기 변형) [[위키링크]]를 대상 문서의 canonical 제목으로 치환해
끊겼던 1,200개 링크를 연결. 제목/파일명 정규화 일치만 적용하고 별칭 매칭은
과병합 위험으로 제외(애매성 가드). 원본은 _link_reconcile_backup/ 에 백업.
도구: Datacollect/scripts/link_reconcile_apply.mjs

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-08 12:24:15 +09:00

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-thought-architecture Thought Architecture 10_Wiki/Topics verified self
생각 설계
Architecture of Thought
사고 아키텍처
none A 0.9 applied
architecture
design-thinking
mental-model
2026-05-10 pending
language framework
conceptual software-architecture

Thought Architecture

매 한 줄

"매 architecture 는 thought 의 외화 (externalization)". 매 system 의 구조는 매 designer 의 사고 모델을 그대로 반영. 2026 LLM-assisted era 에서도 매 핵심 thought structure 는 인간이 결정 — AI 는 elaboration / pattern matching.

매 핵심

매 layers of thought

  • What: 도메인 / 문제 정의.
  • Why: 매 가치 / 제약 / trade-off.
  • How: 매 component / boundary / contract.
  • When: 매 evolution / lifecycle.

매 thought-to-architecture mapping

  • 매 mental concept → module.
  • 매 invariant → contract / type.
  • 매 change axis → seam / interface.
  • 매 trust boundary → service / process boundary.

매 응용

  1. Domain-Driven Design — 매 ubiquitous language ⇔ thought architecture.
  2. Hexagonal — 매 core thought 는 안쪽, 매 details 는 바깥.
  3. C4 model — 매 thought 의 zoom levels.

💻 패턴

Concept-to-Module 매핑

// 매 도메인 concept "Order" → module
// src/domain/order/
//   order.ts          // 매 entity (invariants 의 집)
//   order-events.ts   // 매 state transitions
//   order-policy.ts   // 매 business rules

export class Order {
  private constructor(
    readonly id: OrderId,
    private state: OrderState,
    private items: LineItem[],
  ) {}

  static create(items: LineItem[]): Order {
    if (items.length === 0) throw new Error('Empty order');
    return new Order(OrderId.new(), 'pending', items);
  }

  confirm(): OrderConfirmed {
    if (this.state !== 'pending') throw new Error('Bad state');
    this.state = 'confirmed';
    return { type: 'OrderConfirmed', orderId: this.id };
  }
}

Invariant-as-Type

// 매 thought: "email 은 항상 valid 한 형식"
// 매 architecture: type 으로 enforce
type Email = string & { readonly __brand: 'Email' };

function parseEmail(raw: string): Email {
  if (!/^[^@]+@[^@]+\.[^@]+$/.test(raw)) throw new Error('Invalid');
  return raw as Email;
}

// 매 downstream 은 valid email 만 받음 — invariant 가 type 에 새겨짐
function send(to: Email, body: string) { /* ... */ }

Change-axis-as-seam

// 매 thought: "결제 provider 는 바뀔 수 있다"
// 매 architecture: interface seam
interface PaymentProvider {
  charge(amount: Money, token: string): Promise<ChargeResult>;
}

class StripeProvider implements PaymentProvider { /* ... */ }
class TossProvider implements PaymentProvider { /* ... */ }

// 매 core 는 PaymentProvider 만 알고, 매 concrete 는 wiring 시 결정

Trust-boundary-as-process

// 매 thought: "user-supplied data 는 untrusted"
// 매 architecture: validation gateway

// gateway/api.ts
app.post('/orders', async (req, res) => {
  const dto = OrderDto.parse(req.body); // 매 zod schema — boundary
  const cmd = toCommand(dto);
  await commandBus.dispatch(cmd);
  res.json({ ok: true });
});

C4-style zoom

L1 Context:    [User] → [ShopApp] → [PaymentProvider]
L2 Container:  [Web] → [API] → [DB] / [Queue] → [Worker]
L3 Component:  API = [Router] + [CommandHandler] + [Repository]
L4 Code:       Repository = class with save/find methods

Thought log → ADR

# ADR-0042: Use event sourcing for orders
## Context
매 order state 는 audit trail 이 critical.
## Decision
매 event sourcing — state 는 events 의 fold.
## Consequences
- (+) 매 audit / replay 의 free.
- (-) 매 query 는 projection 필요.

매 결정 기준

상황 Approach
매 domain 이 rich DDD + concept-to-module
매 changes axis 명확 Hexagonal + seams
매 communication 이 main concern C4 + ADR
매 thought 가 아직 흐림 Spike → throw away → rebuild

기본값: 매 concept-to-module mapping + ADR 의 light-weight 사용.

🔗 Graph

🤖 LLM 활용

언제: 매 ADR draft, 매 concept extraction, 매 module boundary 의 review. 언제 X: 매 core thought 의 결정 — 매 human 의 책임. LLM 은 매 elaboration 만.

안티패턴

  • Architecture without thought: 매 framework 의 default 만 따라가기.
  • Thought without architecture: 매 brilliant idea 가 매 code 에 reflect 되지 않음.
  • Premature crystallization: 매 thought 가 흐릴 때 매 architecture 를 fix.
  • Over-abstraction: 매 thought 보다 더 많은 layer.

🧪 검증 / 중복

  • Verified (Brooks "Mythical Man-Month" — conceptual integrity, Evans DDD, Simon Brown C4).
  • 신뢰도 A.

🕓 Changelog

날짜 변경
2026-05-08 Phase 1
2026-05-10 Manual cleanup — full content with thought-to-architecture mapping patterns