@@ -43,28 +43,72 @@ scrolloop은 직접 만든 windowing 기반 가상 스크롤 OSS. turborepo 모
4343
4444### 2. 시스템 아키텍처 — trust boundary 명시 설계
4545
46+ ** 구조 한눈에** :
47+
48+ ``` mermaid
49+ flowchart TD
50+ Event["GitHub Event<br/>(issue · PR comment · workflow_run)"]
51+
52+ subgraph n8n["n8n — Tailscale Funnel HTTPS"]
53+ direction TB
54+ Recv["Webhook 수신"]
55+ Filter["Label · Author · Bot 필터"]
56+ Build["Prompt 합성"]
57+ Recv --> Filter --> Build
58+ end
59+
60+ subgraph gha["GitHub Actions — ephemeral 컨테이너"]
61+ direction TB
62+ Planner["Planner<br/>read-only<br/>→ plan.md"]
63+ Generator["Generator<br/>code edits + verify<br/>→ commit + push"]
64+ Evaluator["Evaluator<br/>plan vs diff<br/>→ review.md"]
65+ Planner -- "plan.md (artifact)" --> Generator
66+ Generator --> Evaluator
67+ end
68+
69+ PR["Pull Request → develop<br/>(plan.md + 코드 변경 + review.md)"]
70+
71+ Event -- "HTTPS · HMAC 서명 검증" --> n8n
72+ n8n -- "workflow_dispatch<br/>(GitHub PAT)" --> gha
73+ gha --> PR
4674```
47- GitHub Event (issue / PR comment / workflow_run)
48- │
49- ▼ (webhook over HTTPS, HMAC 서명 검증)
50- ┌────────────────────────────────────────────┐
51- │ n8n (Tailscale Funnel 공개 HTTPS) │
52- │ - 이벤트 수신 │
53- │ - 라벨 / 권한 / 봇 필터 │
54- │ - prompt 합성 │
55- │ - workflow_dispatch 호출 │
56- └────────────────────────────────────────────┘
57- │
58- ▼ (GitHub PAT, repo:write/actions:write)
59- ┌────────────────────────────────────────────┐
60- │ GitHub Actions (ephemeral 격리 컨테이너) │
61- │ ─ Planner → .harness/<n>/plan.md │
62- │ ─ Generator → code edits + verify │
63- │ ─ Evaluator → review.md + PR 코멘트 │
64- └────────────────────────────────────────────┘
65- │
66- ▼
67- ai/issue-N branch ──▶ Pull Request → develop
75+
76+ ** 실행 흐름 (한 번의 dispatch)** :
77+
78+ ``` mermaid
79+ sequenceDiagram
80+ autonumber
81+ actor User as 사용자
82+ participant GH as GitHub
83+ participant N8N as n8n
84+ participant ACT as GitHub Actions
85+
86+ User->>GH: 이슈에 ai:ready + ai:fix 라벨
87+ GH->>N8N: webhook (issues, action=labeled)
88+
89+ N8N->>N8N: 라벨 / 권한 / 봇 필터
90+ Note over N8N: 통과해야만 진행
91+ N8N->>N8N: prompt 합성
92+ N8N->>GH: POST workflow_dispatch
93+
94+ GH->>ACT: ai-dev.yml 실행
95+
96+ Note over ACT: Job 1 · Planner
97+ ACT->>ACT: gemini --prompt PLAN
98+ ACT->>ACT: .harness/<n>/plan.md
99+
100+ Note over ACT: Job 2 · Generator
101+ ACT->>ACT: plan.md 다운로드
102+ ACT->>ACT: gemini --yolo IMPLEMENT
103+ ACT->>ACT: typecheck · lint · test · build
104+ ACT->>GH: push + gh pr create
105+
106+ Note over ACT: Job 3 · Evaluator
107+ ACT->>ACT: diff vs develop
108+ ACT->>ACT: gemini --prompt EVAL
109+ ACT->>GH: review.md commit + PR 코멘트
110+
111+ GH-->>User: 자동 PR (plan + 코드 + review)
68112```
69113
70114| 시스템 | 책임 | 권한 |
0 commit comments