# task-2150: gate-config.json 신규 생성 — 게이트 설정 중앙 관리

## ★ 프로젝트: `/home/jay/workspace/`

## 3문서 참조 (필독)
- 프로젝트 계획서: `/home/jay/workspace/memory/plans/system/dispatch-quality-gates/plan.md` — 컴포넌트 6번
- 미팅 기록: `/home/jay/workspace/memory/meetings/2026-04-24-dispatch-quality-automation.md` (Cycle 4 마아트/엔키 의견)

## 문제
각 게이트의 ON/OFF, mode(warn/fail), 타임아웃, 임계치가 코드에 하드코딩되면 운영 중 조정이 어려움.
중앙 설정 파일로 관리하여 즉시 조정 가능하게 해야 함.

## 구현

### 파일 1: `/home/jay/workspace/config/gate-config.json` (신규, ~40줄)

```json
{
  "version": "1.0",
  "gates": {
    "impact_scanner": {
      "enabled": true,
      "mode": "warn",
      "timeout_per_symbol": 3,
      "timeout_total": 15,
      "max_symbols": 5,
      "block_threshold": 6,
      "warn_threshold": 1
    },
    "ci_preflight": {
      "enabled": true,
      "mode": "warn",
      "timeout_per_runner": 120,
      "timeout_total": 300,
      "affected_only": true
    },
    "l1_smoketest": {
      "enabled": true,
      "mode": "fail"
    },
    "goal_assertions": {
      "enabled": true,
      "mode": "fail",
      "max_assertions": 5,
      "allowed_commands": ["grep", "curl", "pytest", "python3", "tsc", "cat", "jq", "npx", "npm"]
    },
    "unresolved_gate": {
      "enabled": true,
      "mode": "warn",
      "max_in_scope_unresolved": 3
    }
  }
}
```

### 파일 2: `/home/jay/workspace/utils/gate_config_loader.py` (신규, ~30줄)

```python
def load_gate_config(gate_name: str) -> dict:
    """gate-config.json에서 특정 게이트 설정 로드"""
    
def is_gate_enabled(gate_name: str) -> bool:
    """게이트 활성화 여부"""

def get_gate_mode(gate_name: str) -> str:
    """게이트 모드 (warn/fail) 반환"""
```

Bash에서도 호출 가능:
```bash
MODE=$(python3 -c "from utils.gate_config_loader import get_gate_mode; print(get_gate_mode('impact_scanner'))")
```

## ★ 먼저 읽을 파일
- `/home/jay/workspace/config/` — 기존 config 디렉토리 구조
- `/home/jay/workspace/utils/` — 기존 유틸리티 구조

## 검증 시나리오

### 시나리오 1: JSON 파싱
gate-config.json 로드 → 5개 게이트 설정 정상 반환

### 시나리오 2: Python 로더
`load_gate_config("impact_scanner")` → `{"enabled": True, "mode": "warn", ...}`

### 시나리오 3: Bash 호출
`python3 -c "..."` → "warn" 출력

### 시나리오 4: 존재하지 않는 게이트
`load_gate_config("nonexistent")` → 기본값 반환 (enabled=false)

### 시나리오 5: JSON 스키마 검증
잘못된 JSON → 명확한 에러 메시지

## 완료 시그니처
- gate-config.json 생성 (5개 게이트 초기값)
- gate_config_loader.py 3개 함수 구현
- Python + Bash 양쪽 호출 동작
- 단위 테스트 3건+ PASS

## 레벨
- Lv.3

## 프로젝트
- dev-system