[G1-Sync] Manual knowledge update
This commit is contained in:
@@ -2,92 +2,158 @@
|
||||
id: wiki-2026-0508-gates
|
||||
title: Gates
|
||||
category: 10_Wiki/Topics
|
||||
status: needs_review
|
||||
status: verified
|
||||
canonical_id: self
|
||||
aliases: [P-Reinforce-AUTO-GATE-001]
|
||||
aliases: [Quality Gates, CI Gates, Release Gates]
|
||||
duplicate_of: none
|
||||
source_trust_level: A
|
||||
confidence_score: 0.95
|
||||
tags: [auto-reinforced, gates, Logic-gates, computer-Architecture, boolean-algebra, Hardware]
|
||||
confidence_score: 0.9
|
||||
verification_status: applied
|
||||
tags: [architecture, ci-cd, quality, governance]
|
||||
raw_sources: []
|
||||
last_reinforced: 2026-04-20
|
||||
last_reinforced: 2026-05-10
|
||||
github_commit: pending
|
||||
inferred_by: Claude Opus 4.7 (auto-normalize 2026-05-08)
|
||||
tech_stack:
|
||||
language: unspecified
|
||||
framework: unspecified
|
||||
language: yaml
|
||||
framework: github-actions
|
||||
---
|
||||
|
||||
# [[Gates|Gates]]
|
||||
# Gates
|
||||
|
||||
## 📌 한 줄 통찰 (The Karpathy Summary)
|
||||
> "지능의 최소 입자: 전기가 흐르거나 흐르지 않는 단순한 물리적 상태를 조합하여 AND, OR, NOT이라는 논리 연산을 수행하고, 이를 수십억 개 엮어 현대 컴퓨터의 거대한 '생각'을 가능케 하는 디지털 세계의 기초 벽돌."
|
||||
## 매 한 줄
|
||||
> **"매 quality gate 의 build/release 의 progress 의 block 의 conditional checkpoint 의 정의"**. 매 SonarQube popularization 의 origin (~2008), 매 modern CI/CD 의 essential part — 매 PR merge / deploy 의 prerequisite 의 automated assertion 의 set.
|
||||
|
||||
## 📖 구조화된 지식 (Synthesized Content)
|
||||
논리 게이트(Gates)는 하나 이상의 논리적 입력값에 대해 단일 논리값 출력을 수행하는 하드웨어 소자입니다.
|
||||
## 매 핵심
|
||||
|
||||
1. **기본 문법**:
|
||||
* **AND**: 입력이 모두 1이어야 1 출력. (동시 충족)
|
||||
* **OR**: 입력 중 하나만 1이어도 1 출력. (대안 존재)
|
||||
* **NOT**: 입력을 반전 (0 -> 1, 1 -> 0).
|
||||
* **NAND/NOR**: 범용 게이트(Universal Gates). 이 조합만으로 모든 복잡한 논리 회로 구현 가능.
|
||||
2. **왜 중요한가?**:
|
||||
* 소프트웨어의 모든 추상적 로직은 결국 물리적인 게이트 집합의 전기적 신호로 변환되어 실행됨. ([[Technical-Architecture|Technical-Architecture]]의 밑바닥)
|
||||
### 매 Gate 종류
|
||||
- **Build Gate**: compile + unit test pass.
|
||||
- **Quality Gate**: coverage ≥ 80%, no critical SonarQube issues.
|
||||
- **Security Gate**: SAST (Semgrep, CodeQL), SCA (Dependabot, Snyk), secret scan.
|
||||
- **Performance Gate**: bundle size, Lighthouse, p99 latency budget.
|
||||
- **Manual Approval Gate**: prod deploy 의 human reviewer.
|
||||
|
||||
## ⚠️ 모순 및 업데이트 (Contradictions & Updates)
|
||||
- **과거 데이터와의 충돌**: 과거에는 실리콘 트랜지스터 기반의 '고정형 게이트 정책'이 유일했으나, 현대 정책은 빛으로 연산하는 '광 게이트 정책'이나 양자 중첩을 활용하는 '양자 게이트 정책'으로 하드웨어의 한계 돌파 정책을 모색 중임(RL Update).
|
||||
- **정책 변화(RL Update)**: 신경망의 특정 뉴런을 활성화하거나 억제하는 '게이팅 메커니즘(Gating Mechanism, 예: GRU/[[LSTM|LSTM]]의 Gate)'은 하드웨어 게이트의 개념을 수학적 알고리즘 정책으로 승화시켜 시계열 데이터 학습의 핵심이 됨.
|
||||
### 매 Gate 위치
|
||||
- **PR Gate**: pre-merge — fast (<5 min).
|
||||
- **Main Branch Gate**: post-merge — heavier (E2E, integration).
|
||||
- **Release Gate**: pre-deploy — canary metrics, smoke tests.
|
||||
- **Production Gate**: post-deploy — error rate watcher, auto-rollback.
|
||||
|
||||
## 🔗 지식 연결 (Graph)
|
||||
- [[Technical-Architecture|Technical-Architecture]], [[Logic|Logic]], Scaling-Laws, Moore's Law, [[Hardware|Hardware]]
|
||||
- **Modern Tech/Tools**: FPGA, Verilog, Quantum gates, CMOS transistors.
|
||||
---
|
||||
### 매 응용
|
||||
1. SonarQube Quality Gate (coverage / duplication / issues).
|
||||
2. GitHub branch protection rules.
|
||||
3. ArgoCD sync waves with health gates.
|
||||
|
||||
## 🤖 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 Gate
|
||||
```yaml
|
||||
name: PR Gate
|
||||
on: pull_request
|
||||
jobs:
|
||||
gate:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with: { node-version: 20 }
|
||||
- run: npm ci
|
||||
- run: npm test -- --coverage
|
||||
- name: Coverage gate
|
||||
run: |
|
||||
COV=$(jq '.total.lines.pct' coverage/coverage-summary.json)
|
||||
if (( $(echo "$COV < 80" | bc -l) )); then
|
||||
echo "Coverage $COV% < 80%"; exit 1
|
||||
fi
|
||||
- uses: github/codeql-action/analyze@v3
|
||||
```
|
||||
|
||||
## 🤔 의사결정 기준 (Decision Criteria)
|
||||
### SonarQube Quality Gate
|
||||
```yaml
|
||||
- uses: SonarSource/sonarqube-scan-action@v3
|
||||
env:
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
- uses: SonarSource/sonarqube-quality-gate-action@v1
|
||||
timeout-minutes: 5
|
||||
env:
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
```
|
||||
|
||||
**선택 A를 써야 할 때:**
|
||||
- *(TODO)*
|
||||
### Bundle Size Gate
|
||||
```yaml
|
||||
- uses: andresz1/size-limit-action@v1
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
skip_step: install
|
||||
```
|
||||
|
||||
**선택 B를 써야 할 때:**
|
||||
- *(TODO)*
|
||||
### Manual Approval Gate (GitHub Environments)
|
||||
```yaml
|
||||
deploy-prod:
|
||||
environment:
|
||||
name: production
|
||||
url: https://app.example.com
|
||||
runs-on: ubuntu-latest
|
||||
needs: [test, security]
|
||||
steps:
|
||||
- run: ./deploy.sh prod
|
||||
```
|
||||
Configured in repo Settings → Environments → required reviewers.
|
||||
|
||||
**기본값:**
|
||||
> *(TODO)*
|
||||
### ArgoCD Sync Wave Gate
|
||||
```yaml
|
||||
metadata:
|
||||
annotations:
|
||||
argocd.argoproj.io/sync-wave: "1"
|
||||
argocd.argoproj.io/hook: PreSync
|
||||
argocd.argoproj.io/hook-delete-policy: BeforeHookCreation
|
||||
```
|
||||
|
||||
## ❌ 안티패턴 (Anti-Patterns)
|
||||
### Canary Gate (Argo Rollouts)
|
||||
```yaml
|
||||
strategy:
|
||||
canary:
|
||||
steps:
|
||||
- setWeight: 10
|
||||
- pause: { duration: 5m }
|
||||
- analysis:
|
||||
templates: [{ templateName: success-rate }]
|
||||
- setWeight: 50
|
||||
- pause: { duration: 10m }
|
||||
```
|
||||
|
||||
- **[안티패턴]:** *(TODO: 무엇을 하면 안 되는가 + 이유 + 대신 무엇을)*
|
||||
## 매 결정 기준
|
||||
| 상황 | Approach |
|
||||
|---|---|
|
||||
| Fast PR feedback | unit + lint + type only (<3 min) |
|
||||
| Compliance-heavy | SAST + SCA + license + signed commits |
|
||||
| High-traffic prod | canary + auto-rollback gate |
|
||||
| Monorepo | path-filtered gates (only run affected) |
|
||||
|
||||
**기본값**: PR gate (lint+test+typecheck) → main gate (E2E+coverage) → prod gate (manual approval+canary).
|
||||
|
||||
## 🔗 Graph
|
||||
- 부모: [[CI-CD]] · [[DevOps]]
|
||||
- 변형: [[Quality-Gate]] · [[Release-Gate]] · [[Security-Gate]]
|
||||
- 응용: [[GitHub-Actions]] · [[ArgoCD]] · [[SonarQube]]
|
||||
- Adjacent: [[Trunk-Based-Development]] · [[Canary-Deployment]] · [[Feature-Flags]]
|
||||
|
||||
## 🤖 LLM 활용
|
||||
**언제**: gate 의 thresholds 의 review, gate config 의 generation, failure log 의 root cause 의 analysis.
|
||||
**언제 X**: gate policy 의 organizational decision (compliance, risk tolerance) — human ownership 필요.
|
||||
|
||||
## ❌ 안티패턴
|
||||
- **Gate inflation**: 매 PR 의 30+ checks → developer frustration, gaming via skip flags.
|
||||
- **Flaky gates**: intermittent failures 의 normalize → real failures 의 ignore.
|
||||
- **Bypass culture**: admin 의 "merge anyway" 의 routine usage.
|
||||
- **No rollback gate**: deploy 후 metrics 의 watch 없이 → bad release 의 prolong.
|
||||
- **Unmeasured threshold**: "good enough" coverage % 의 arbitrary 의 set.
|
||||
|
||||
## 🧪 검증 / 중복
|
||||
- Verified (Google SRE Book, GitHub branch protection docs, SonarQube Quality Gates).
|
||||
- 신뢰도 A.
|
||||
|
||||
## 🕓 Changelog
|
||||
| 날짜 | 변경 |
|
||||
|---|---|
|
||||
| 2026-05-08 | Phase 1 |
|
||||
| 2026-05-10 | Manual cleanup — quality gates / CI gates 의 full content |
|
||||
|
||||
Reference in New Issue
Block a user