uctm 1.5.3 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,24 +1,24 @@
1
- # Shared Prompt Sections
1
+ # 공유 프롬프트 섹션
2
2
 
3
- Common reusable sections. Each agent references these via `cache_control` markers.
3
+ 에이전트가 `cache_control` 마커를 통해 참조하는 공통 재사용 섹션.
4
4
 
5
5
  ---
6
6
 
7
- ## § 1. Output Language Rule
7
+ ## § 1. 출력 언어 규칙
8
8
 
9
9
  ```
10
- Priority: PLAN.md > Language: → CLAUDE.md ## Language → en (default)
10
+ 우선순위: PLAN.md > Language: → CLAUDE.md ## Language → en (기본값)
11
11
 
12
- On dispatch: pass resolved language code in <context><language> field
13
- Section headers (##) are also written in the resolved language (refer to language mapping table)
12
+ 디스패치 시: <context><language> 필드에 결정된 언어 코드 전달
13
+ 섹션 헤더(##) 결정된 언어로 작성 (언어 매핑 참조)
14
14
  ```
15
15
 
16
16
  ---
17
17
 
18
- ## § 2. Build and Lint Commands
18
+ ## § 2. 빌드 린트 명령
19
19
 
20
20
  ```bash
21
- # Auto-detect Build (execute only if script exists)
21
+ # 빌드 자동 감지 (스크립트가 있을 때만 실행)
22
22
  if [ -f "package.json" ]; then
23
23
  if node -e "const p=JSON.parse(require('fs').readFileSync('package.json','utf8')); process.exit(p.scripts&&p.scripts.build?0:1)" 2>/dev/null; then
24
24
  npm run build 2>&1 || bun run build 2>&1 || yarn build 2>&1
@@ -33,7 +33,7 @@ elif [ -f "Makefile" ]; then
33
33
  make build 2>&1 || make 2>&1
34
34
  fi
35
35
 
36
- # Auto-detect Lint (execute only if script exists)
36
+ # 린트 자동 감지 (스크립트가 있을 때만 실행)
37
37
  if [ -f "package.json" ]; then
38
38
  if node -e "const p=JSON.parse(require('fs').readFileSync('package.json','utf8')); process.exit(p.scripts&&p.scripts.lint?0:1)" 2>/dev/null; then
39
39
  npm run lint 2>&1 || bun run lint 2>&1 || true
@@ -43,99 +43,107 @@ elif [ -f "pyproject.toml" ]; then
43
43
  fi
44
44
  ```
45
45
 
46
- - If build/lint scripts do not exist **skip (treat as N/A)**.
47
- - On build/lint failure, always fix before reporting.
46
+ - 빌드/린트 스크립트가 없으면**생략 (N/A로 처리)**.
47
+ - 빌드/린트 실패 보고 전에 항상 수정.
48
48
 
49
49
  ---
50
50
 
51
- ## § 3. WORK and TASK File Path Patterns
51
+ ## § 3. WORK TASK 파일 경로 패턴
52
52
 
53
53
  ```
54
54
  works/{WORK_ID}/
55
- ├─ Requirement.md # Created by Specifier (mandatory)
55
+ ├─ Requirement.md # Specifier가 생성 (필수)
56
56
  ├─ PLAN.md
57
- ├─ TASK-00.md # No WORK prefix
58
- ├─ TASK-00_result.md # Separator: underscore
57
+ ├─ TASK-00.md # WORK 접두사 없음
58
+ ├─ TASK-00_result.md # 구분자: 언더스코어
59
59
  └─ TASK-01.md ...
60
60
  ```
61
61
 
62
- - WORK ID: `WORK-NN` (e.g., `WORK-03`)
63
- - TASK ID: `TASK-NN` (e.g., `TASK-00`) — WORK prefix must NOT be included
62
+ - WORK ID: `WORK-NN` (예: `WORK-03`)
63
+ - TASK ID: `TASK-NN` (예: `TASK-00`) — WORK 접두사 포함 금지
64
64
 
65
65
  ---
66
66
 
67
- ## § 4. File System Discovery Scripts
67
+ ## § 4. 파일 시스템 Discovery 스크립트
68
68
 
69
69
  ```
70
- # Find latest WORK with incomplete TASKs
71
- # Use Glob tool: pattern "works/WORK-*/" → list all WORK directories (sorted)
72
- # For each WORK (descending), read last line of works/WORK-NN/work_WORK-NN.log
73
- # - No log filenot started
74
- # - Last line contains "COMMITTER_DONE" with last TASK number check if more TASKs remain
75
- # First WORK that is not fully completed is the active WORK
76
-
77
- # List all WORKs
78
- # Use Glob tool: pattern "works/WORK-*/"
79
-
80
- # WORK/TASK status from activity log (last line)
81
- # Read last line of works/${WORK_ID}/work_${WORK_ID}.log
82
- # Format: [timestamp] EVENT — description
70
+ # 미완료 TASK가 있는 최신 WORK 찾기
71
+ # Glob 도구 사용: pattern "works/WORK-*/" → 모든 WORK 디렉토리 목록 (정렬)
72
+ # WORK (내림차순) 대해 works/WORK-NN/work_WORK-NN.log 마지막 줄 읽기
73
+ # - 로그 파일 없음시작 안 됨
74
+ # - 마지막 줄이 "ORCHESTRATOR_DONE" → 완료됨
75
+ # 완전히 완료되지 않은 번째 WORK가 활성 WORK
76
+
77
+ # 모든 WORK 목록
78
+ # Glob 도구 사용: pattern "works/WORK-*/"
79
+
80
+ # 활동 로그의 마지막 줄로 WORK/TASK 상태 파악 (orchestrator가 일괄 기록 → work-activity-log.md 참조)
81
+ # works/${WORK_ID}/work_${WORK_ID}.log 마지막 줄 읽기
82
+ # 형식: [timestamp] EVENT — description
83
83
  #
84
- # Key rule: *_START without matching *_DONE = interrupted, must REDO that step
84
+ # 핵심 규칙: STAGE_START에 대응하는 STAGE_DONE/GATE_WAIT/DECISION_WAIT가 없으면 = 자식 실행 중단됨, 해당 단계 재수행 필요
85
85
  #
86
- # COMMITTER_DONE — TASK-NN TASK-NN completed, next TASK is TASK-(NN+1)
87
- # COMMITTER_START — TASK-NN committer interrupted, redo verifier+committer for TASK-NN
88
- # VERIFIER_DONETASK-NN TASK-NN verified, needs committer
89
- # VERIFIER_START — TASK-NN verifier interrupted, redo verifier+committer for TASK-NN
90
- # BUILDER_DONETASK-NN TASK-NN builder done, needs verifier+committer
91
- # BUILDER_START — TASK-NN builder interrupted, redo builder for TASK-NN
92
- # PLANNER_DONE planning done, start first TASK
93
- # PLANNER_START planner interrupted, redo specifier+planner
94
- # SPECIFIER_DONE → specifier done, needs planner
95
- # SPECIFIER_START → specifier interrupted, redo specifier+planner
96
- # No log file → start from scratch
86
+ # ORCHESTRATOR_DONE WORK 전체 완료
87
+ # STAGE_DONEstage=X[ task=TASK-NN] 해당 단계 완료(게이트 통과됨), 다음 단계로
88
+ # GATE_WAITstage=X 게이트 미승인, 자식 재실행 없이 동일 게이트 재제시
89
+ # DECISION_WAITstage=X[ task=TASK-NN] 결정 미확정, DECISIONS.md의 PENDING 항목 재제시
90
+ # DECISIONstage=X by=user|auto 결정 확정됨, 후속 STAGE_DONE 없으면 해당 단계 이어서 진행
91
+ # STAGE_STARTstage=X[ task=TASK-NN] (대응 DONE/WAIT 없으면) 자식 실행 중 중단됨, 재실행
92
+ # ORCHESTRATOR_START orchestrator 시작됨, 하위 이벤트로 세부 판정
93
+ # 로그 파일 없음 처음부터 시작 (신규 WORK)
97
94
  ```
98
95
 
99
96
  ---
100
97
 
101
- ## § 5. Task Result XML Format
98
+ ## § 5. Task Result XML 형식
102
99
 
103
100
  ```xml
104
101
  <task-result work="{WORK_ID}" task="{TASK_ID}" agent="{agent}" status="{PASS|FAIL}">
105
- <summary>{1-2 line summary}</summary>
102
+ <summary>{1-2 요약}</summary>
106
103
  <files-changed>
107
- <file action="{created|modified|deleted}" path="{path}">{description}</file>
104
+ <file action="{created|modified|deleted}" path="{path}">{설명}</file>
108
105
  </files-changed>
109
106
  <verification>
110
- <check name="{type}" status="{PASS|FAIL|N/A}">{details}</check>
107
+ <check name="{type}" status="{PASS|FAIL|N/A}">{상세}</check>
111
108
  </verification>
112
- <notes>{notes for next steps}</notes>
109
+ <notes>{다음 단계를 위한 메모}</notes>
113
110
  </task-result>
114
111
  ```
115
112
 
116
113
  ---
117
114
 
118
- ## § 7. PLAN.md Required Meta-Information — 7 Fields
115
+ ## § 6. 자동결정 기록 관례
116
+
117
+ 권고안을 자동결정(결정주체 `auto`)한 경우, 판단 근거를 남겨 추적 가능하게 한다.
118
+
119
+ - **기록 위치**: `works/{WORK_ID}/DECISIONS.md`(항목별 배경/선택지/권고안/확정값/결정주체/상태) + 최종 결과보고서 `## 자동 결정 사항` 목록.
120
+ - **기록 시점**: 결정 확정 즉시 `RESOLVED`로 기록. `mode=auto`뿐 아니라 `mode=gated`에서 orchestrator가 경미한 사항으로 판단해 게이트 없이 자체 확정(`by=auto`)한 경우도 동일하게 기록.
121
+ - **최소 기재 항목**: 대상(stage 또는 task) · 확정값 · 근거 1줄.
122
+
123
+ → 상세 포맷: `file-content-schema.md` § 4 참조. 기록 주체·이벤트: `work-activity-log.md`의 `DECISION` 이벤트 참조.
124
+
125
+ ---
119
126
 
120
- `{REFERENCES_DIR}/file-content-schema.md` § 1 reference
127
+ ## § 7. PLAN.md 필수 메타 정보 — 7개 필드
121
128
 
122
- | Field | Required | Description |
123
- |-------|----------|-------------|
129
+ `{REFERENCES_DIR}/file-content-schema.md` § 1 참조
130
+
131
+ | 필드 | 필수 | 설명 |
132
+ |------|------|------|
124
133
  | `> Created:` | ✅ | YYYY-MM-DD |
125
- | `> Requirement:` | ✅ | `REQ-XXX` or user request text |
126
- | `> Execution-Mode:` | ✅ | `direct` / `pipeline` / `full` |
127
- | `> Project:` | ✅ | Project name |
128
- | `> Tech Stack:` | ✅ | Detected tech stack |
129
- | `> Language:` | ✅ | Language code (`ko`, `en`, etc.) |
130
- | `> Status:` | ✅ | Always starts as `PLANNED` |
134
+ | `> Requirement:` | ✅ | `REQ-XXX` 또는 사용자 요청 텍스트 |
135
+ | `> Project:` | ✅ | 프로젝트 이름 |
136
+ | `> Tech Stack:` | ✅ | 감지된 기술 스택 |
137
+ | `> Language:` | ✅ | 언어 코드 (`ko`, `en` 등) |
138
+ | `> Status:` | ✅ | 항상 `PLANNED`로 시작 |
131
139
 
132
140
  ---
133
141
 
134
- ## § 8. WORK-LIST.md Update Rules
142
+ ## § 8. WORK-LIST.md 업데이트 규칙
135
143
 
136
- File: `works/WORK-LIST.md`
144
+ 파일: `works/WORK-LIST.md`
137
145
 
138
- **Format:**
146
+ **형식:**
139
147
  ```
140
148
  LAST_WORK_ID: WORK-XX
141
149
 
@@ -145,163 +153,57 @@ LAST_WORK_ID: WORK-XX
145
153
  | WORK-MM | ... | DONE | YYYY-MM-DD | YYYY-MM-DD |
146
154
  ```
147
155
 
148
- | Status | Meaning | Trigger |
149
- |--------|---------|---------|
150
- | `IN_PROGRESS` | WORK is being executed | specifier creates WORK |
151
- | `DONE` | All TASKs completed, awaiting review/push | committer completes last TASK |
152
- | `COMPLETED` | Archived to _COMPLETED/ | push merge (Main Claude batch processes all DONE) |
156
+ | 상태 | 의미 | 트리거 |
157
+ |------|------|--------|
158
+ | `IN_PROGRESS` | WORK 실행 | specifier WORK 생성 |
159
+ | `DONE` | 모든 TASK 완료, 리뷰/push 대기 | committer 마지막 TASK 완료 |
160
+ | `COMPLETED` | _COMPLETED/로 아카이빙됨 | push 머지 (Main Claude 모든 DONE 일괄 처리) |
153
161
 
154
- Rules:
155
- - `LAST_WORK_ID` header tracks the highest WORK ID ever created
156
- - **specifier**: on WORK creation, add IN_PROGRESS row + update `LAST_WORK_ID`
157
- - **committer**: when last TASK is completed, change `IN_PROGRESS` → `DONE` and fill completion date (do NOT move folder or remove row)
158
- - **Main Claude** (push procedure): move all DONE WORKs to `works/_COMPLETED/`, remove their rows from WORK-LIST.md
162
+ 규칙:
163
+ - `LAST_WORK_ID` 헤더는 지금까지 생성된 가장 높은 WORK ID 추적
164
+ - **specifier**: WORK 생성 IN_PROGRESS 추가 + `LAST_WORK_ID` 업데이트
165
+ - **committer**: 마지막 TASK 완료 `IN_PROGRESS` → `DONE`으로 변경하고 완료일 기입 (폴더 이동이나 제거 금지)
166
+ - **Main Claude** (push 절차): 모든 DONE WORK를 `works/_COMPLETED/`로 이동, WORK-LIST.md에서 해당 행 제거
159
167
 
160
168
  ---
161
169
 
162
- ## § 9. Locale Detection
170
+ ## § 9. 로케일 감지
163
171
 
164
172
  ```
165
- 1. Use Grep tool: pattern "Language:\s*[a-z]{2}" path="CLAUDE.md" → extract language code
166
- 2. If not found, ask user for language
167
- 3. If not found, auto-detect system locale via Bash:
173
+ 1. Grep 도구 사용: pattern "Language:\s*[a-z]{2}" path="CLAUDE.md" → 언어 코드 추출
174
+ 2. 없으면 사용자에게 언어 확인
175
+ 3. 없으면 Bash로 시스템 로케일 자동 감지:
168
176
  - Windows: powershell -c "[CultureInfo]::CurrentCulture.TwoLetterISOLanguageName"
169
177
  - Linux/Mac: locale | grep LANG
170
- - Fallback: "en"
171
- ```
172
-
173
- ---
174
-
175
- ## § 10. Callback & Activity Log
176
-
177
- ### 10-1. Callback (CE7)
178
-
179
- Each agent sends START/DONE/FAILED events to the server via CE7 API.
180
-
181
- **Activation condition:** Only when `CALLBACK_URL` is available. Check in order:
182
- 1. Dispatch XML `<callback-url>` element (passed from Main Claude)
183
- 2. Prompt text containing `CALLBACK_URL=...` line
184
- 3. If neither found → **skip all callbacks**
185
-
186
- **How to resolve CALLBACK_URL and CALLBACK_TOKEN:**
187
-
188
- The runner injects callback info directly into the prompt:
189
- ```
190
- POST {CALLBACK_URL}
191
- Authorization: Bearer {CALLBACK_TOKEN}
192
- ```
193
- The first agent (specifier) extracts these and passes them via dispatch XML to subsequent agents.
194
-
195
- **When to send:**
196
- - **START**: At the very beginning of agent execution (after STARTUP)
197
- - **DONE**: At the very end, before returning task-result XML
198
- - **FAILED**: On unrecoverable failure, before returning FAIL task-result
199
-
200
- **How to send** (single curl command):
201
- ```bash
202
- curl -s --connect-timeout 3 --max-time 5 -X POST "$CALLBACK_URL" \
203
- -H "Authorization: Bearer $CALLBACK_TOKEN" \
204
- -H "Content-Type: application/json" \
205
- -d '{"stage":"BUILDER","event":"START","workId":"WORK-09","taskId":"TASK-01"}' \
206
- 2>/dev/null || true
207
- ```
208
-
209
- - `--connect-timeout 3`: 연결 대기 최대 3초
210
- - `--max-time 5`: 전체 요청 최대 5초
211
- - `|| true`: 실패해도 agent 실행 계속
212
-
213
- **Include docs (actual file content, not references):**
214
- - specifier DONE: `"docs": {"requirementContent": "<Requirement.md content>"}`
215
- - planner DONE: `"docs": {"planContent": "<PLAN.md content>"}`
216
- - builder START: `"docs": {"taskContent": "<TASK-NN.md content>"}`
217
- - committer DONE: `"docs": {"resultContent": "<TASK-NN_result.md content>"}`
218
-
219
- **Token usage** (DONE event only, optional):
220
- ```json
221
- {"inputTokens": 1234, "outputTokens": 567, "cacheCreationTokens": 890, "cacheReadTokens": 456}
222
- ```
223
-
224
- Callback failure must NOT block agent execution. Always continue.
225
-
226
- ### 10-2. Activity Log
227
-
228
- Each agent records start/end to `works/{WORK_ID}/work_{WORK_ID}.log`.
229
-
230
- **All WORKs** — no CALLBACK_URL condition.
231
-
232
- **Timestamp:** Run `date -u +"%Y-%m-%dT%H:%M:%SZ"` via Bash tool to get the real UTC time. Do NOT use dummy/placeholder timestamps.
233
-
234
- **Format:**
235
- ```
236
- [2026-03-30T14:30:00Z] AGENT_EVENT — description
237
- ```
238
-
239
- **How to write:** Use Bash `echo "[timestamp] EVENT — description" >> works/{WORK_ID}/work_{WORK_ID}.log`
240
-
241
- **Required entries per agent (START and DONE only):**
242
- ```
243
- [{timestamp}] SPECIFIER_START — WORK-NN specifier started
244
- [{timestamp}] SPECIFIER_DONE — WORK-NN specifier completed
245
- [{timestamp}] BUILDER_START — TASK-NN implement
246
- [{timestamp}] BUILDER_DONE — TASK-NN complete
247
- [{timestamp}] VERIFIER_START — TASK-NN verification
248
- [{timestamp}] VERIFIER_DONE — TASK-NN verified
249
- [{timestamp}] COMMITTER_START — TASK-NN commit
250
- [{timestamp}] COMMITTER_DONE — TASK-NN committed
251
- ```
252
-
253
- Do NOT write INIT, REF, PLAN, DISPATCH or other intermediate entries. Only START and DONE per agent role.
254
-
255
- ---
256
-
257
- ## § 11. Project Discovery
258
-
259
- ```
260
- # 1. Check CLAUDE.md language setting
261
- Use Grep tool: pattern "Language:\s*[a-z]{2}" path="CLAUDE.md"
262
-
263
- # 2. Tech stack (read first 50/30/20/10 lines if file exists)
264
- Use Read tool: "package.json" (limit=50)
265
- Use Read tool: "pyproject.toml" (limit=30)
266
- Use Read tool: "Cargo.toml" (limit=20)
267
- Use Read tool: "go.mod" (limit=10)
268
-
269
- # 3. Structure (when needed)
270
- Use Glob tool: pattern "**/*.{md,json,toml}" (exclude node_modules)
178
+ - 폴백: "en"
271
179
  ```
272
180
 
273
181
  ---
274
182
 
275
- ## § 12. Bash Command Rules
183
+ ## § 12. Bash 명령 규칙
276
184
 
277
- Bash commands MUST follow these rules for permission compatibility.
185
+ Bash 명령은 권한 호환성을 위해 다음 규칙을 반드시 따라야 합니다.
278
186
 
279
- **MANDATORY:**
280
- - One simple command per Bash call NO compound commands (`&&`, `||`, `;`, `|`)
281
- - NO `cd` — Bash tool cwd is always the project root. Never use `cd dir &&`, `cd dir ;`, or `cd dir` in any form. Use relative paths from project root
282
- - NO multi-line scriptssplit into separate Bash calls
283
- - NO sub-shell expansions in argumentse.g., `$(date ...)` inside `printf`
284
- - Use relative paths from project root (e.g., `works/WORK-01/`) — NO absolute paths
285
- - Use `git add file`, `git commit -m "msg"` — NO `git -C path` flag
187
+ **필수:**
188
+ - Bash 호출당 단순 명령 하나복합 명령 금지 (`&&`, `||`, `;`, `|`)
189
+ - `cd` 금지 — Bash 도구의 cwd 항상 프로젝트 루트. `cd dir &&`, `cd dir ;`, `cd dir` 어떤 형태든 사용 금지. 프로젝트 루트 기준 상대 경로 사용
190
+ - 멀티라인 스크립트 금지별도 Bash 호출로 분할
191
+ - 인수 서브셸 확장 금지예: `printf` 안의 `$(date ...)`
192
+ - 프로젝트 루트 기준 상대 경로 사용 (예: `works/WORK-01/`) — 절대 경로 금지
193
+ - `git add file`, `git commit -m "msg"` 사용 — `git -C path` 플래그 금지
286
194
 
287
- **For file operations, prefer dedicated tools over Bash:**
288
- - Read files → `Read` tool (NOT `cat`)
289
- - Write/append files → `Write` tool (NOT `echo >>` or `printf >>`)
290
- - Edit files → `Edit` tool (NOT `sed -i`)
291
- - Search files → `Grep` tool (NOT `grep`)
292
- - Find files → `Glob` tool (NOT `find`)
293
-
294
- **Activity log example:**
295
- ```
296
- WRONG: printf '[%s]_%s\n' "$(date ...)" "INIT" >> work.log
297
- RIGHT: Use Write tool to append a line to the log file
298
- ```
195
+ **파일 작업에는 Bash 대신 전용 도구를 우선 사용:**
196
+ - 파일 읽기 → `Read` 도구 (`cat` 아님)
197
+ - 파일 쓰기/추가 → `Write` 도구 (`echo >>` 또는 `printf >>` 아님)
198
+ - 파일 편집 → `Edit` 도구 (`sed -i` 아님)
199
+ - 파일 검색 → `Grep` 도구 (`grep` 아님)
200
+ - 파일 찾기 → `Glob` 도구 (`find` 아님)
299
201
 
300
- **Git example:**
202
+ **Git 예시:**
301
203
  ```
302
- WRONG: cd /path/to/project && git add file && git commit -m "msg"
303
- RIGHT: git add file (one call)
304
- git commit -m "msg" (next call)
204
+ 잘못됨: cd /path/to/project && git add file && git commit -m "msg"
205
+ 올바름: git add file ( 번의 호출)
206
+ git commit -m "msg" (다음 호출)
305
207
  ```
306
208
 
307
209
  ---
@@ -309,4 +211,4 @@ RIGHT: git add file (one call)
309
211
  ## Version
310
212
 
311
213
  - Created: 2026-03-10
312
- - Updated: 2026-03-28
214
+ - Updated: 2026-03-31
@@ -1,26 +1,33 @@
1
- # Work Activity Log
2
-
3
- Records agent start/end events in `works/{WORK_ID}/work_{WORK_ID}.log`.
4
-
5
- ## Rules
6
-
7
- 1. **Timestamp**: Run `date -u +"%Y-%m-%dT%H:%M:%SZ"` via Bash to get real UTC time. Never use dummy values.
8
- 2. **Write method**: Use `Edit` tool to append. Do NOT use Bash for log writes.
9
- 3. **Entries**: Only START and DONE per agent role. No intermediate stages.
10
-
11
- ## Format
12
-
13
- ```
14
- [YYYY-MM-DDTHH:MM:SSZ] AGENT_EVENT — description
15
- ```
16
-
17
- ## Required Entries
18
-
19
- | Agent | START | DONE |
20
- |-------|-------|------|
21
- | specifier | `SPECIFIER_START WORK-NN specifier started` | `SPECIFIER_DONE — WORK-NN specifier completed` |
22
- | planner | `PLANNER_START — WORK-NN planner started` | `PLANNER_DONE — WORK-NN planner completed` |
23
- | scheduler | `SCHEDULER_START WORK-NN scheduler started` | `SCHEDULER_DONE — WORK-NN scheduler completed` |
24
- | builder | `BUILDER_START TASK-NN implement` | `BUILDER_DONETASK-NN complete` |
25
- | verifier | `VERIFIER_START TASK-NN verification` | `VERIFIER_DONETASK-NN verified` |
26
- | committer | `COMMITTER_START TASK-NN commit` | `COMMITTER_DONETASK-NN committed` |
1
+ # 작업 활동 로그
2
+
3
+ `works/{WORK_ID}/work_{WORK_ID}.log`에 실행 이벤트를 기록.
4
+
5
+ ## 규칙
6
+
7
+ 1. **기록 주체**: **orchestrator**. 자식의 spawn/완료를 `STAGE_START`/`STAGE_DONE`으로 기록한다.
8
+ 2. **타임스탬프**: Bash로 `date -u +"%Y-%m-%dT%H:%M:%SZ"` 실행하여 실제 UTC 시간 획득. 더미 사용 금지.
9
+ 3. **기록 방법**: Bash `echo` 추가.
10
+ 4. **`STAGE_DONE`은 게이트 통과 후에 기록한다.** 해당 단계에 게이트(`<gate type="stage">` 또는 `<gate type="decision">`)가 있는 경우, Main Claude/사용자의 승인·결정으로 게이트가 해소(RESOLVED)된 시점에만 `STAGE_DONE`을 남긴다. 게이트 대기 중에는 `GATE_WAIT`/`DECISION_WAIT`만 기록되고, `STAGE_DONE`은 아직 기록되지 않은 상태로 남는다.
11
+ - **근거(재개 판정)**: 파이프라인이 중단 후 재개(resume)될 때 orchestrator는 로그의 마지막 이벤트로 재개 지점을 판정한다. 특정 단계에 `STAGE_START`만 있고 `STAGE_DONE`이 없다면 "그 단계의 게이트가 아직 승인/결정되지 않았다"는 뜻이므로, orchestrator는 다음 단계로 건너뛰지 않고 동일 게이트를 다시 제시해야 한다. `STAGE_DONE`을 게이트 통과 이전에 기록하면 재개 시 미승인 게이트를 건너뛰는 사고로 이어진다.
12
+
13
+ ## 형식
14
+
15
+ ```
16
+ [YYYY-MM-DDTHH:MM:SSZ] EVENT — description
17
+ ```
18
+
19
+ ## 이벤트 체계 (orchestrator 기록)
20
+
21
+ | 이벤트 | 기록 시점 | 예시 |
22
+ |--------|----------|------|
23
+ | `ORCHESTRATOR_START` | orchestrator 실행 시작 | `ORCHESTRATOR_START — WORK-NN orchestrator started` |
24
+ | `STAGE_START` | 자식 에이전트(specifier/planner/builder/verifier/committer) spawn 직전 | `STAGE_STARTstage=specifier` |
25
+ | `GATE_WAIT` | `<gate type="stage">`에서 정지, Main Claude 승인 대기 | `GATE_WAITstage=specifier` |
26
+ | `DECISION_WAIT` | `<gate type="decision">` 또는 자식의 `<needs-decision>` 수신 후 결정 대기 | `DECISION_WAITstage=planner` |
27
+ | `DECISION` | 결정 확정 — 주체는 `user`(사용자 승인) 또는 `auto`(orchestrator 자동결정) | `DECISION — stage=planner by=user` / `DECISION — task=TASK-03 by=auto` |
28
+ | `STAGE_DONE` | 게이트 해소(RESOLVED) 후, 또는 게이트가 없는 단계는 완료 즉시 | `STAGE_DONE — stage=specifier` |
29
+ | `ORCHESTRATOR_DONE` | orchestrator 실행 종료 (WORK 완료) | `ORCHESTRATOR_DONE — WORK-NN orchestrator completed` |
30
+
31
+ - `stage` 값: `specifier`/`planner`/`builder`/`verifier`/`committer`.
32
+ - `by` 값: `user`/`auto`. `<decision>`(§ 7, `xml-schema.md`)의 `by` 속성과 동일한 값 체계를 사용.
33
+ - 확정된 결정의 상세 내용(배경/선택지/권고안/확정값)은 로그가 아니라 `works/{WORK_ID}/DECISIONS.md`에 기록한다 → `file-content-schema.md` § 4 참조. 로그의 `DECISION` 이벤트는 "언제·누가 결정했는지"만 남긴다.