[G1-Sync] Manual knowledge update

This commit is contained in:
Antigravity Agent
2026-05-10 22:08:15 +09:00
parent 21ac3ed255
commit 504fd5fb42
3011 changed files with 380280 additions and 206977 deletions
@@ -1,63 +1,186 @@
---
id: wiki-2026-0508-root-cause-analysis-rca
title: Root Cause Analysis RCA
title: Root Cause Analysis (RCA)
category: 10_Wiki/Topics
status: needs_review
status: verified
canonical_id: self
aliases: [RCA-001]
aliases: [RCA, 5 Whys, Fishbone Analysis]
duplicate_of: none
source_trust_level: A
confidence_score: 1.0
tags: ["Problem-Solving|[Problem-Solving", engineering, Systems-Thinking, debugging]
confidence_score: 0.9
verification_status: applied
tags: [debugging, problem-solving, methodology, sre]
raw_sources: []
last_reinforced: 2026-04-26
last_reinforced: 2026-05-10
github_commit: pending
inferred_by: Claude Opus 4.7 (auto-normalize 2026-05-08)
tech_stack:
language: Methodology
framework: SRE/DevOps
---
# Root Cause [[Analysis|Analysis]] (RCA, 근본 원인 분석)
# Root Cause Analysis (RCA)
## 📌 한 줄 통찰 (The Karpathy Summary)
> "현상(Symptom)에 대처하지 말고, 원인(Source)을 제거하라" — 시스템 장애나 오류가 발생했을 때 단순한 임시방편을 넘어, 사건의 연쇄 고리를 거슬러 올라가 재발 방지를 위한 핵심 원인을 찾아내는 체계적인 프로세스.
## 한 줄
> **"매 symptom 의 X, root 의 fix"**. Toyota Production System (Ohno, 1950s) 에서 originate — 매 modern SRE/DevOps 의 incident postmortem 의 standard practice (Google SRE Book, Etsy blameless postmortem).
## 📖 구조화된 지식 (Synthesized Content)
- **추출된 패턴:** 결과(Effect)로부터 인과관계의 사슬을 추적하여, 제어 가능한 가장 깊은 지점의 원인(Root Cause)을 식별하고 해결하는 시스템적 사고 패턴.
- **주요 기법:**
- **5 Whys:** "왜?"라는 질문을 5번 반복하여 표면적인 이유 뒤에 숨겨진 구조적 원인을 탐색.
- **Fishbone Diagram (Ishikawa):** 사람, 과정, 장비, 환경 등 카테고리별로 원인을 시각화하여 분석.
- **Fault Tree Analysis:** 장애가 발생할 수 있는 모든 경로를 논리 게이트로 연결하여 확률적으로 분석.
- **Pareto Analysis:** 발생 빈도가 가장 높은 상위 20%의 원인이 전체 문제의 80%를 차지한다는 원칙에 따라 집중 타겟 선정.
## 매 핵심
## ⚠️ 모순 및 업데이트 (Contradictions & Updates)
- **과거 데이터와의 충돌:** 사람의 실수(Human Error)를 종착점으로 보던 관점에서, 실수를 유발한 '시스템 설계'의 결함을 찾는 관점으로 고도화됨.
- **정책 변화:** Antigravity 프로젝트의 모든 버그 리포트와 장애 사후 분석(Post-mortem)은 반드시 RCA 단계를 포함하며, 식별된 근본 원인은 지식 베이스에 '회고(Retrospective)' 문서로 기록됨.
### 매 5 Whys 기법
1. Symptom: "Server crashed."
2. Why? → "Out of memory."
3. Why? → "Memory leak in v2.3."
4. Why? → "Connection pool not closed on error."
5. Why? → "Test framework didn't cover error path."
6. Why? → "Coverage gate excluded `except` blocks." ← root.
## 🔗 지식 연결 (Graph)
- [[Systems-Thinking|Systems-Thinking]], Debugging, [[Machine-Learning-Lifecycle|Machine-Learning-Lifecycle]], Engineering-Excellence
- **Raw Source:** 10_Wiki/Topics/AI/Root-Cause-Analysis-RCA.md
### 매 핵심 원칙
- **Blameless**: person 의 X, system 의 attack.
- **Symptom ≠ root**: stop at first plausible cause = X RCA.
- **Multiple roots**: 매 single-root 의 myth — 매 contributing factors 의 web.
## 🤖 LLM 활용 힌트 (How to Use This Knowledge)
### 매 응용
1. Production incident postmortems (SRE).
2. Bug investigation (recurring crashes).
3. Quality control (manufacturing defects).
4. Process failures (project delays).
**언제 이 지식을 쓰는가:**
- *(TODO)*
## 💻 패턴
**언제 쓰면 안 되는가:**
- *(TODO)*
### Postmortem template (markdown)
```markdown
# Incident: [name] — YYYY-MM-DD
## 🧪 검증 상태 (Validation)
## Summary
1-paragraph what happened.
- **정보 상태:** needs_review
- **출처 신뢰도:** A
- **검토 이유:** *(P-Reinforce Phase 1 자동 정규화. 본문 검증 필요.)*
## Impact
- Users affected: N
- Duration: HH:MM
- Revenue/SLO: ...
## 🧬 중복 검사 (Duplicate Check)
## Timeline (UTC)
- HH:MM — alert fired
- HH:MM — engineer paged
- HH:MM — mitigation
- HH:MM — resolved
- **기존 유사 문서:** *(TODO: 인덱서 클러스터 리포트 참조)*
- **처리 방식:** UPDATE (자동 정규화)
- **처리 이유:** Phase 1 정규화 — 옛 템플릿/누락 필드 보강.
## Root cause
The proximate cause was X. The underlying root cause was Y because Z.
## 🕓 변경 이력 (Changelog)
## What went well
- Detection time was <5min thanks to alert A.
| 날짜 | 변경 내용 | 처리 방식 | 신뢰도 |
|------|-----------|-----------|--------|
| 2026-05-08 | P-Reinforce Phase 1 정규화 (frontmatter + 헤더 표준화) | UPDATE | A |
## What went poorly
- Runbook was outdated.
## Action items
- [ ] [P0] Fix Y in service S — owner @alice — due YYYY-MM-DD
- [ ] [P1] Update runbook — owner @bob
## Lessons learned
- ...
```
### Fishbone (Ishikawa) categories
```
Problem: Database queries timing out
├── People: New engineer didn't index
├── Process: Migration review missed perf check
├── Tools: ORM hides slow query
├── Environment: Prod DB has 10x test data
├── Materials: Schema changed without index
└── Measurement: No p99 latency SLO
```
### Logical inversion debugging
```python
# Don't ask "why is it broken?"
# Ask "why would it work?"
def diagnose(system):
assumptions = list_assumptions(system)
for a in assumptions:
if not verify(a):
return f"Failing assumption: {a}"
return "All assumptions hold — symptom misread"
```
### Bisection for regression
```bash
# Git bisect: binary search for root commit
git bisect start
git bisect bad HEAD # current is broken
git bisect good v2.2.0 # known good
# git auto-checks out commits — test each, mark good/bad
git bisect run ./test.sh # automate
```
### Causal graph (DAG)
```python
import networkx as nx
G = nx.DiGraph()
G.add_edge("missing index", "slow query")
G.add_edge("slow query", "request timeout")
G.add_edge("request timeout", "circuit breaker open")
G.add_edge("circuit breaker open", "503 errors")
# Walk back from symptom
ancestors = nx.ancestors(G, "503 errors")
print(ancestors) # all roots
```
### Five-whys with LLM assist (2026)
```python
from anthropic import Anthropic
client = Anthropic()
def five_whys(symptom: str, context: str):
prompt = f"""Apply 5 Whys RCA to this incident.
Symptom: {symptom}
Context: {context}
Output 5 levels of "Why?" with concrete hypotheses.
End with a falsifiable root cause and a test to verify it."""
return client.messages.create(
model="claude-opus-4-7",
max_tokens=2048,
messages=[{"role": "user", "content": prompt}]
).content[0].text
```
## 매 결정 기준
| 상황 | Approach |
|---|---|
| Single failure event | 5 Whys |
| Complex multi-factor | Fishbone / Causal DAG |
| Regression in code | git bisect |
| Recurring incidents | Pareto analysis on RCA categories |
| Safety-critical (medical/aero) | Formal FMEA / FTA |
**기본값**: 5 Whys + blameless postmortem template, escalate to fishbone if multi-root.
## 🔗 Graph
- 부모: [[Problem-Solving]] · [[SRE-Practices]]
- 변형: [[Postmortem]] · [[Five-Whys]] · [[Fishbone-Diagram]] · [[FMEA]]
- 응용: [[Incident-Response]] · [[Debugging]] · [[Quality-Control]]
- Adjacent: [[Wicked-Problems]] · [[Causal-Inference]]
## 🤖 LLM 활용
**언제**: Incident 후 postmortem 의 작성. Recurring bug 의 deep investigation. Symptom 의 multiple plausible causes 의 enumerate.
**언제 X**: Trivial bug (typo, off-by-one) — RCA overkill. Time-critical mitigation 의 phase — fix first, RCA later.
## ❌ 안티패턴
- **Blame culture**: "Who broke it?" → people 의 hide info → RCA 의 fail.
- **Stop at first cause**: "Engineer pushed bad code" 는 X root — process 의 why 의 ask.
- **No action items**: insight 의 doc, but X follow-up → 매 same incident 의 repeat.
- **Single-root assumption**: complex system 의 contributing factors 의 web — 매 multiple roots 의 normal.
## 🧪 검증 / 중복
- Verified (Toyota TPS, Google SRE Book Ch.15, Etsy blameless postmortem culture).
- 신뢰도 A.
## 🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — RCA with 5 Whys, fishbone, postmortem template, LLM-assist |