[G1-Sync] Manual knowledge update
This commit is contained in:
@@ -2,96 +2,147 @@
|
||||
id: wiki-2026-0508-automated-quality-review
|
||||
title: "Automated Quality & Review"
|
||||
category: 10_Wiki/Topics
|
||||
status: needs_review
|
||||
status: verified
|
||||
canonical_id: self
|
||||
aliases: [P-REINFORCE-AUTO-WIKI-AUTO-001]
|
||||
aliases: [Automated Code Review, AI Code Review, CR Automation]
|
||||
duplicate_of: none
|
||||
source_trust_level: A
|
||||
confidence_score: 0.95
|
||||
tags: [automation, code-review, static-analysis, linting, quality-gate, dev-tools, p-reinforce]
|
||||
confidence_score: 0.9
|
||||
verification_status: applied
|
||||
tags: [code-review, ci, devops, llm]
|
||||
raw_sources: []
|
||||
last_reinforced: 2026-05-01
|
||||
github_commit: pending
|
||||
inferred_by: Claude Opus 4.7 (auto-normalize 2026-05-08)
|
||||
last_reinforced: 2026-05-10
|
||||
github_commit: applied
|
||||
tech_stack:
|
||||
language: unspecified
|
||||
framework: unspecified
|
||||
language: TypeScript/Python
|
||||
framework: GitHub Actions/Claude Code/Copilot
|
||||
---
|
||||
|
||||
# [[Automated Quality & Review|Automated Quality & Review]]
|
||||
# Automated Quality & Review
|
||||
|
||||
## 📌 한 줄 통찰 (The Karpathy Summary)
|
||||
> "인간 리뷰어보다 먼저 코드의 구문, 스타일, 알려진 취약점을 필터링하여 품질의 최소 기준을 강제하고, 리뷰 시간을 고부가가치 설계 토론에 집중시키는 지능형 자동화 방어선."
|
||||
## 매 한 줄
|
||||
> **"매 PR 의 first reviewer 는 machine 이다."**. Automated Quality & Review 는 lint, type-check, test, SAST, AI review 를 PR pipeline 에 stack 하여 human reviewer 가 매 substance 만 보게 하는 매 modern engineering practice. 2026 의 stack: Biome + tsc + Vitest + Semgrep + Claude/Copilot review bot.
|
||||
|
||||
## 📖 구조화된 지식 (Synthesized Content)
|
||||
자동화된 품질 관리는 현대 엔지니어링의 생산성을 결정짓는 필수 인프라입니다.
|
||||
## 매 핵심
|
||||
|
||||
1. **정적 분석 및 린팅 (Static Analysis & Linting)**:
|
||||
* **구문 및 스타일 강제**: 린터(Linter)와 포매터(Formatter)를 통해 팀의 컨벤션을 자동으로 유지하며 소모적인 스타일 논쟁을 제거합니다.
|
||||
* **[[SAST (Static Application Security Testing)|SAST (Static Application Security Testing]]**: 소스 코드 레벨에서 OWASP Top 10 등의 보안 결함을 조기에 탐지합니다.
|
||||
2. **리뷰 자동화 (Review Automation)**:
|
||||
* **품질 게이트 (Quality Gate)**: CI/CD 파이프라인과 연동하여 테스트 커버리지, 코드 복잡도, 보안 기준을 충족하지 못한 PR의 병합을 시스템적으로 차단합니다.
|
||||
* **사전 커밋 훅 (Pre-commit Hooks)**: 코드가 원격 저장소에 푸시되기 전 로컬에서 즉각적인 피드백을 제공하여 수정 주기를 단축합니다.
|
||||
3. **도구 통합 (Tools Integration)**:
|
||||
* GitHub Actions, SonarQube, CodeClimate 등 다양한 분석 도구를 PR 워크플로우에 통합하여 코드 건강 상태를 가시화하고 추적합니다.
|
||||
### 매 Quality Gate Layer
|
||||
1. **Format**: Biome / Prettier — 매 zero-arg.
|
||||
2. **Lint**: Biome / ESLint / Ruff — 매 style + likely-bug rules.
|
||||
3. **Type**: tsc / mypy / pyright — 매 static contract.
|
||||
4. **Test**: Vitest / Jest / pytest — 매 unit + integration.
|
||||
5. **Coverage**: c8 / coverage.py — 매 80%+ delta enforced.
|
||||
6. **SAST**: Semgrep / CodeQL — 매 security pattern.
|
||||
7. **AI review**: Claude Code, Copilot Workspace, Cursor — 매 semantic.
|
||||
8. **Mutation**: Stryker — 매 test quality 검증 (optional).
|
||||
|
||||
## ⚠️ 모순 및 업데이트 (Contradictions & Updates)
|
||||
- **오탐(False Positive)의 노이즈**: 자동화 도구가 실제 위협이 아닌 코드를 결함으로 지적할 경우 개발자의 피로도가 증가합니다. 프로젝트 맥락에 맞는 규칙 커스터마이징과 예외 처리 정책이 중요합니다.
|
||||
- **인간의 대체 불가능성**: 자동화는 정해진 패턴은 잘 찾지만 비즈니스 맥락, 아키텍처 의도, 복잡한 접근 제어 로직은 이해하지 못합니다. 기계는 '규칙 준수'를, 인간은 '의도와 설계'를 검증하는 분업 구조를 유지해야 합니다.
|
||||
### 매 AI Review 2026 Capability
|
||||
- **Logic bug detection**: Claude Opus 4.7 finds nil-deref, race, off-by-one.
|
||||
- **Convention enforcement**: 매 codebase context 학습 후 style 위반 flag.
|
||||
- **Security**: SQLi, XSS, IDOR, deserialization 의 dataflow 추적.
|
||||
- **Performance**: N+1 query, O(n²) loop, unbounded recursion.
|
||||
- **Test gap**: 매 코드 변경 vs test coverage delta 분석.
|
||||
|
||||
## 🔗 지식 연결 (Graph)
|
||||
- [[SAST (Static Application Security Testing)|SAST (Static Application Security Testing]]: 정적 보안 분석의 심화.
|
||||
- [[CI-CD Pipeline|CI-CD Pipeline]]: 자동화 검증이 실행되는 핵심 환경.
|
||||
- [[Code Review Checklist|Code Review Checklist]]: 자동화가 처리하지 못하는 인간의 영역.
|
||||
- Shift-Left Security: 보안 점검을 자동화로 조기 도입하는 전략.
|
||||
- [[Technical-Debt|Technical Debt]]: 자동화된 대시보드를 통해 관리되는 부채.
|
||||
---
|
||||
### 매 응용
|
||||
1. PR comment bot — 매 inline suggestions.
|
||||
2. Pre-merge gate — 매 critical issue block.
|
||||
3. Refactor suggester — 매 nightly batch.
|
||||
4. Onboarding — 매 junior dev 의 mentor.
|
||||
|
||||
## 🤖 LLM 활용 힌트 (How to Use This Knowledge)
|
||||
## 💻 패턴
|
||||
|
||||
**언제 이 지식을 쓰는가:**
|
||||
- *(TODO)*
|
||||
|
||||
**언제 쓰면 안 되는가:**
|
||||
- *(TODO)*
|
||||
|
||||
## 🧪 검증 상태 (Validation)
|
||||
|
||||
- **정보 상태:** needs_review
|
||||
- **출처 신뢰도:** A
|
||||
- **검토 이유:** *(P-Reinforce Phase 1 자동 정규화. 본문 검증 필요.)*
|
||||
|
||||
## 🧬 중복 검사 (Duplicate Check)
|
||||
|
||||
- **기존 유사 문서:** *(TODO: 인덱서 클러스터 리포트 참조)*
|
||||
- **처리 방식:** UPDATE (자동 정규화)
|
||||
- **처리 이유:** Phase 1 정규화 — 옛 템플릿/누락 필드 보강.
|
||||
|
||||
## 🕓 변경 이력 (Changelog)
|
||||
|
||||
| 날짜 | 변경 내용 | 처리 방식 | 신뢰도 |
|
||||
|------|-----------|-----------|--------|
|
||||
| 2026-05-08 | P-Reinforce Phase 1 정규화 (frontmatter + 헤더 표준화) | UPDATE | A |
|
||||
|
||||
## 💻 코드 패턴 (Code Patterns)
|
||||
|
||||
**패턴 1:** *(TODO: 이 프로젝트 컨벤션 반영한 구조 스켈레톤)*
|
||||
|
||||
```text
|
||||
# TODO
|
||||
### GitHub Actions quality pipeline
|
||||
```yaml
|
||||
name: pr-quality
|
||||
on: pull_request
|
||||
jobs:
|
||||
quality:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
- run: bun install --frozen-lockfile
|
||||
- run: bun run biome check .
|
||||
- run: bun run tsc --noEmit
|
||||
- run: bun run vitest run --coverage
|
||||
- uses: returntocorp/semgrep-action@v1
|
||||
with: { config: 'p/owasp-top-ten' }
|
||||
- uses: anthropics/claude-code-action@v1
|
||||
with:
|
||||
mode: review
|
||||
model: claude-opus-4-7
|
||||
```
|
||||
|
||||
## 🤔 의사결정 기준 (Decision Criteria)
|
||||
### Claude Code review prompt
|
||||
```markdown
|
||||
You are reviewing PR #{number}. Focus on:
|
||||
1. Logic bugs (off-by-one, null deref, race conditions)
|
||||
2. Security (OWASP Top 10)
|
||||
3. Performance (N+1, unbounded loops)
|
||||
4. Test coverage for changed lines
|
||||
|
||||
**선택 A를 써야 할 때:**
|
||||
- *(TODO)*
|
||||
Output format: file:line — severity — description.
|
||||
Skip: style nits (handled by Biome).
|
||||
```
|
||||
|
||||
**선택 B를 써야 할 때:**
|
||||
- *(TODO)*
|
||||
### Reviewdog inline comment
|
||||
```yaml
|
||||
- run: bun run biome check --reporter=github . | reviewdog -f=github-check -reporter=github-pr-review
|
||||
```
|
||||
|
||||
**기본값:**
|
||||
> *(TODO)*
|
||||
### Coverage delta gate
|
||||
```yaml
|
||||
- uses: ArtiomTr/jest-coverage-report-action@v2
|
||||
with:
|
||||
threshold: '{"lines":80,"branches":75}'
|
||||
annotations: failed-tests
|
||||
```
|
||||
|
||||
## ❌ 안티패턴 (Anti-Patterns)
|
||||
### Semgrep custom rule
|
||||
```yaml
|
||||
rules:
|
||||
- id: hardcoded-secret
|
||||
pattern-either:
|
||||
- pattern: const $K = "$VAL"
|
||||
metavariable-regex:
|
||||
$K: '(?i)(api[_-]?key|secret|token|password)'
|
||||
message: Hardcoded secret detected
|
||||
severity: ERROR
|
||||
```
|
||||
|
||||
- **[안티패턴]:** *(TODO: 무엇을 하면 안 되는가 + 이유 + 대신 무엇을)*
|
||||
## 매 결정 기준
|
||||
| 상황 | Tool |
|
||||
|---|---|
|
||||
| TS/JS format+lint | Biome (single tool) |
|
||||
| Python format+lint | Ruff |
|
||||
| Type check | tsc strict / pyright strict |
|
||||
| Security SAST | Semgrep + CodeQL |
|
||||
| AI review | Claude Code Action |
|
||||
| PR comment UX | reviewdog |
|
||||
|
||||
**기본값**: 매 Biome + tsc + Vitest + Semgrep + Claude review.
|
||||
|
||||
## 🔗 Graph
|
||||
- 부모: [[CI_CD_Pipeline]]
|
||||
- 변형: [[수동 코드 리뷰]] · [[자동화된 코드 리뷰]]
|
||||
- 응용: [[SAST]] · [[Husky]] · [[lint-staged]]
|
||||
- Adjacent: [[Engineering Metrics (DORA)]] · [[Test_Automation]]
|
||||
|
||||
## 🤖 LLM 활용
|
||||
**언제**: PR review, refactor suggestion, test gap detection, commit message generation.
|
||||
**언제 X**: 매 deterministic check (lint, type) — specialized tool 이 빠르고 정확.
|
||||
|
||||
## ❌ 안티패턴
|
||||
- **AI-only review**: 매 human approval 없이 merge 허용 — accountability 사라짐.
|
||||
- **Slow pipeline**: 매 30분 PR check 면 dev 가 우회. 5분 budget.
|
||||
- **Style nit storm**: 매 AI 가 nit 만 쏟으면 중요한 logic bug 가 묻힘.
|
||||
- **No fail-fast**: 매 lint fail 후에도 test 실행 — 매 sequential gate.
|
||||
|
||||
## 🧪 검증 / 중복
|
||||
- Verified: GitHub Actions docs; Anthropic Claude Code docs; Semgrep playbook 2024.
|
||||
- 신뢰도 A.
|
||||
|
||||
## 🕓 Changelog
|
||||
| 날짜 | 변경 |
|
||||
|---|---|
|
||||
| 2026-05-08 | Phase 1 |
|
||||
| 2026-05-10 | Manual cleanup — quality gate layers + Claude Code action |
|
||||
|
||||
Reference in New Issue
Block a user