@walwal-harness/cli 3.3.1 → 3.3.2

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.
@@ -152,23 +152,39 @@ pending → draft → reviewed → approved
152
152
  "하네스 엔지니어링 시작" 또는 /harness-dispatcher
153
153
  ```
154
154
 
155
- #### 2. 이후 세션: harness-next.sh로 안내받기
156
- ```bash
157
- bash scripts/harness-next.sh
155
+ #### 2. 이후 세션: 새 세션만 열면 자동 진행
156
+
157
+ 에이전트가 완료 후 STOP하면, **새 세션을 시작하기만 하면 됩니다**.
158
+ SessionStart 훅이 자동으로:
159
+ 1. 이전 에이전트의 완료 상태 감지
160
+ 2. 게이트 체크 실행 (Pre-Eval Gate, 파일 소유권, 아티팩트 선행조건)
161
+ 3. `handoff.json` 생성 (prompt, model, thinking_mode, regression 등)
162
+ 4. 다음 에이전트 안내 출력
163
+
164
+ ```
165
+ # 새 세션 시작 시 자동 출력 예시:
166
+ # Harness: next → /harness-generator-backend (sonnet)
158
167
  ```
159
- Feature-level 프로그래스를 출력하고 다음 에이전트를 안내합니다.
160
168
 
161
- #### 3. 다음 세션 시작
162
- ```bash
163
- # 방법 A: 새 세션에서 스킬 직접 호출
164
- /harness-generator-backend
169
+ 사용자는 안내에 따라 스킬을 호출하면 됩니다.
170
+
171
+ #### 자동 CLI 실행 (옵션)
165
172
 
166
- # 방법 B: claude CLI 자동 실행
173
+ 완전 자동화를 원하면 아래 명령으로 다음 에이전트를 즉시 시작할 수 있습니다:
174
+
175
+ ```bash
167
176
  claude --model $(jq -r .model .harness/handoff.json) --prompt "$(jq -r .prompt .harness/handoff.json)"
168
177
  ```
169
178
 
170
- #### 4. SessionStart 훅 (자동)
171
- 세션 시작 시 `.claude/settings.json` 훅이 자동으로 현재 프로그래스를 출력합니다.
179
+ #### 디버깅 (수동)
180
+
181
+ 문제가 생겼을 때만 수동으로 상태를 확인합니다:
182
+
183
+ ```bash
184
+ bash scripts/harness-next.sh # 게이트 체크 + 프로그래스 출력
185
+ jq . .harness/handoff.json # handoff 내용 확인
186
+ jq . .harness/progress.json # 현재 상태 확인
187
+ ```
172
188
 
173
189
  ### Session Boundary Protocol
174
190
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@walwal-harness/cli",
3
- "version": "3.3.1",
3
+ "version": "3.3.2",
4
4
  "description": "Production harness for AI agent engineering — Planner, Generator(BE/FE), Evaluator(Func/Visual), optional Brainstormer (requirements refinement). Supports React and Flutter FE stacks.",
5
5
  "bin": {
6
6
  "walwal-harness": "bin/init.js"
@@ -1,6 +1,11 @@
1
1
  #!/bin/bash
2
- # harness-session-start.sh — SessionStart 훅 (compact)
3
- # statusline이 상시 상태를 표시하므로, 여기서는 핵심 안내만 출력.
2
+ # harness-session-start.sh — SessionStart 훅
3
+ # 새 세션 시작 시 자동으로:
4
+ # 1) 이전 에이전트가 completed이면 harness-next.sh를 실행하여 게이트 체크 + handoff 생성
5
+ # 2) handoff.json이 있으면 다음 에이전트 안내
6
+ # 3) statusline이 상시 상태를 표시하므로 여기서는 핵심 안내만 출력
7
+ #
8
+ # 사용자가 수동으로 harness-next.sh를 실행할 필요가 없도록 자동화.
4
9
 
5
10
  SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
6
11
  LIB="$SCRIPT_DIR/lib/harness-render-progress.sh"
@@ -11,6 +16,8 @@ command -v jq &>/dev/null || exit 0
11
16
 
12
17
  PROJECT_ROOT="$(resolve_harness_root "." 2>/dev/null)" || exit 0
13
18
  PROGRESS="$PROJECT_ROOT/.harness/progress.json"
19
+ CONFIG="$PROJECT_ROOT/.harness/config.json"
20
+ HANDOFF="$PROJECT_ROOT/.harness/handoff.json"
14
21
  [ -f "$PROGRESS" ] || exit 0
15
22
 
16
23
  sprint_status=$(jq -r '.sprint.status // "init"' "$PROGRESS" 2>/dev/null)
@@ -18,17 +25,45 @@ current_agent=$(jq -r '.current_agent // "none"' "$PROGRESS" 2>/dev/null)
18
25
  next_agent=$(jq -r '.next_agent // "none"' "$PROGRESS" 2>/dev/null)
19
26
  agent_status=$(jq -r '.agent_status // "pending"' "$PROGRESS" 2>/dev/null)
20
27
 
21
- # init 상태: 간단 안내
28
+ # ─────────────────────────────────────────
29
+ # init 상태: 첫 안내
30
+ # ─────────────────────────────────────────
22
31
  if [ "$sprint_status" = "init" ]; then
23
32
  echo "# Harness ready — say \"하네스 엔지니어링 시작\" or /harness-dispatcher"
24
33
  exit 0
25
34
  fi
26
35
 
27
- # 활성 세션: 다음 액션만 안내 (상세 프로그래스는 statusline에서 상시 표시)
36
+ # ─────────────────────────────────────────
37
+ # 이전 에이전트가 completed → 자동으로 harness-next 실행
38
+ # (게이트 체크, 아티팩트 검증, handoff.json 생성)
39
+ # ─────────────────────────────────────────
40
+ if [ "$agent_status" = "completed" ] || [ "$agent_status" = "failed" ]; then
41
+ # harness-next.sh를 백그라운드로 실행하면 안 됨 — 결과가 필요
42
+ bash "$SCRIPT_DIR/harness-next.sh" "$PROJECT_ROOT" 2>/dev/null
43
+
44
+ # harness-next.sh가 progress.json과 handoff.json을 업데이트했으므로 다시 읽기
45
+ next_agent=$(jq -r '.next_agent // "none"' "$PROGRESS" 2>/dev/null)
46
+ agent_status=$(jq -r '.agent_status // "pending"' "$PROGRESS" 2>/dev/null)
47
+ fi
48
+
49
+ # ─────────────────────────────────────────
50
+ # 상태별 안내 출력
51
+ # ─────────────────────────────────────────
28
52
  if [ "$agent_status" = "blocked" ]; then
29
- echo "# Harness BLOCKED — user intervention required. Run: bash scripts/harness-next.sh"
30
- elif [ "$next_agent" != "none" ] && [ "$next_agent" != "null" ]; then
31
- echo "# Harness: next → /harness-${next_agent}"
53
+ echo "# Harness BLOCKED — retry limit reached, user intervention required"
54
+
55
+ elif [ -f "$HANDOFF" ] && [ "$next_agent" != "none" ] && [ "$next_agent" != "null" ]; then
56
+ # handoff.json에서 모델/모드 정보 읽기
57
+ handoff_model=$(jq -r '.model // "opus"' "$HANDOFF" 2>/dev/null)
58
+ handoff_thinking=$(jq -r '.thinking_mode // empty' "$HANDOFF" 2>/dev/null)
59
+
60
+ mode_str=""
61
+ if [ -n "$handoff_thinking" ] && [ "$handoff_thinking" != "null" ]; then
62
+ mode_str=" /${handoff_thinking}"
63
+ fi
64
+
65
+ echo "# Harness: next → /harness-${next_agent} (${handoff_model}${mode_str})"
66
+
32
67
  elif [ "$current_agent" != "none" ] && [ "$current_agent" != "null" ]; then
33
68
  echo "# Harness: ${current_agent} [${agent_status}]"
34
69
  fi
@@ -282,14 +282,8 @@ render_progress() {
282
282
  fi
283
283
 
284
284
  echo ""
285
- echo " Next → /harness-${next_agent} (model: ${next_model}${mode_str})"
286
-
287
- # Build auto CLI command with model flag, reading prompt from handoff.json
288
- local model_flag=""
289
- if [ "$next_model" != "opus" ]; then
290
- model_flag=" --model ${next_model}"
291
- fi
292
- echo " Auto → claude${model_flag} --prompt \"\$(jq -r .prompt .harness/handoff.json)\""
285
+ echo " Next → /harness-${next_agent} (${next_model}${mode_str})"
286
+ echo " Tip → 새 세션을 시작하면 자동으로 안내됩니다"
293
287
  fi
294
288
 
295
289
  echo ""