@walwal-harness/cli 5.6.2 → 5.6.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@walwal-harness/cli",
3
- "version": "5.6.2",
3
+ "version": "5.6.3",
4
4
  "description": "Production harness for AI agent engineering — Solo/Team mode, Planner, Generator(BE/FE), Evaluator chain (Code-Quality → Functional → Visual), optional Brainstormer. Supports React, Next.js, and Flutter FE stacks.",
5
5
  "bin": {
6
6
  "walwal-harness": "bin/init.js"
@@ -0,0 +1,41 @@
1
+ #!/bin/bash
2
+ # harness-progress-set.sh — Safe partial update to .harness/progress.json
3
+ #
4
+ # Usage:
5
+ # bash scripts/harness-progress-set.sh <project-root> <jq_filter>
6
+ #
7
+ # The jq filter is a partial assignment expression. All other fields are
8
+ # preserved. NEVER rewrite progress.json as a full JSON blob — mode,
9
+ # team_state, and similar top-level fields will be lost.
10
+ #
11
+ # Example:
12
+ # bash scripts/harness-progress-set.sh . '.current_agent = "planner" | .agent_status = "running"'
13
+
14
+ set -uo pipefail
15
+
16
+ PROJECT_ROOT="${1:-.}"
17
+ FILTER="${2:-}"
18
+
19
+ if [ -z "$FILTER" ]; then
20
+ echo "[progress-set] usage: $0 <project-root> <jq_filter>" >&2
21
+ exit 2
22
+ fi
23
+
24
+ PROGRESS="$PROJECT_ROOT/.harness/progress.json"
25
+
26
+ if [ ! -f "$PROGRESS" ]; then
27
+ echo "[progress-set] not found: $PROGRESS" >&2
28
+ exit 1
29
+ fi
30
+
31
+ # Always add .updated_at = now so callers don't forget
32
+ FINAL_FILTER="$FILTER | .updated_at = (now | todate)"
33
+
34
+ TMP="${PROGRESS}.tmp.$$"
35
+ if jq "$FINAL_FILTER" "$PROGRESS" > "$TMP" 2>/dev/null; then
36
+ mv "$TMP" "$PROGRESS"
37
+ else
38
+ rm -f "$TMP"
39
+ echo "[progress-set] jq filter failed: $FILTER" >&2
40
+ exit 1
41
+ fi
@@ -27,6 +27,29 @@ next_agent=$(jq -r '.next_agent // "none"' "$PROGRESS" 2>/dev/null)
27
27
  agent_status=$(jq -r '.agent_status // "pending"' "$PROGRESS" 2>/dev/null)
28
28
  mode=$(jq -r '.mode // "solo"' "$PROGRESS" 2>/dev/null)
29
29
 
30
+ # ─────────────────────────────────────────
31
+ # Auto-heal mode drift — Team 상태 유실 복구
32
+ # feature-queue.json 에 활성 작업(in_progress)이 있는데 mode 가 solo/paused 면
33
+ # 누군가 progress.json 을 통째로 덮어써서 team_state 를 날린 것. mode=team 으로
34
+ # 자동 복원하고 경고 로그 남김.
35
+ # ─────────────────────────────────────────
36
+ FEATURE_QUEUE_HEAL="$PROJECT_ROOT/.harness/actions/feature-queue.json"
37
+ if [ -f "$FEATURE_QUEUE_HEAL" ] && [ "$mode" != "team" ]; then
38
+ active_count=$(jq -r '(.queue.in_progress | length) // 0' "$FEATURE_QUEUE_HEAL" 2>/dev/null || echo 0)
39
+ if [ "${active_count:-0}" -gt 0 ]; then
40
+ heal_teams=$active_count
41
+ [ "$heal_teams" -gt 3 ] && heal_teams=3
42
+ bash "$SCRIPT_DIR/harness-progress-set.sh" "$PROJECT_ROOT" \
43
+ ".mode = \"team\" | .team_state.active_teams = ${heal_teams} | .team_state.paused_at = null" \
44
+ 2>/dev/null
45
+ mode="team"
46
+ echo "# Harness: mode auto-healed to 'team' (feature-queue has ${active_count} active, but mode was drifted)" >&2
47
+ if [ -f "$PROJECT_ROOT/.harness/progress.log" ]; then
48
+ echo "$(date +'%Y-%m-%d %H:%M') | system | heal | mode | reset solo→team (queue had ${active_count} in_progress)" >> "$PROJECT_ROOT/.harness/progress.log"
49
+ fi
50
+ fi
51
+ fi
52
+
30
53
  # ─────────────────────────────────────────
31
54
  # Team Mode — 팀이 자율 실행 중이면 오케스트레이터 안내
32
55
  # ─────────────────────────────────────────
@@ -31,6 +31,24 @@ Planner 가 곧바로 plan.md / feature-list.json / api-contract.json 으로 변
31
31
  제공하거나 브레인스토밍 불필요를 선언하면 Dispatcher 는 곧바로 `next_agent = planner`
32
32
  로 라우팅한다.
33
33
 
34
+ ## progress.json 업데이트 규칙 (v5.6.3+)
35
+
36
+ ⚠️ **절대로 progress.json 을 통째로 재작성하지 마라**. `Write` 도구로 전체 파일을
37
+ 덮어쓰면 `mode` / `team_state` / 기타 top-level 필드가 누락되어 Team Mode 가 Solo 로
38
+ 되돌아가는 등 런타임 오류가 발생한다.
39
+
40
+ **올바른 방법** — 반드시 partial update 로 갱신:
41
+
42
+ ```bash
43
+ # 헬퍼 스크립트 (권장)
44
+ bash scripts/harness-progress-set.sh . '.current_agent = "planner" | .agent_status = "running"'
45
+
46
+ # 또는 직접 jq 로 partial update
47
+ jq '.agent_status = "completed" | .completed_agents += ["planner"]' .harness/progress.json > .harness/progress.json.tmp && mv .harness/progress.json.tmp .harness/progress.json
48
+ ```
49
+
50
+ 위 두 방식은 파일의 나머지 필드를 보존한다. Read → 수정 → Write 패턴은 사용 금지.
51
+
34
52
  ## Session Boundary Protocol
35
53
 
36
54
  ### On Start
@@ -6,6 +6,24 @@ disable-model-invocation: false
6
6
 
7
7
  # Dispatcher — Pipeline Selector + Gotcha Manager
8
8
 
9
+ ## progress.json 업데이트 규칙 (v5.6.3+)
10
+
11
+ ⚠️ **절대로 progress.json 을 통째로 재작성하지 마라**. `Write` 도구로 전체 파일을
12
+ 덮어쓰면 `mode` / `team_state` / 기타 top-level 필드가 누락되어 Team Mode 가 Solo 로
13
+ 되돌아가는 등 런타임 오류가 발생한다.
14
+
15
+ **올바른 방법** — 반드시 partial update 로 갱신:
16
+
17
+ ```bash
18
+ # 헬퍼 스크립트 (권장)
19
+ bash scripts/harness-progress-set.sh . '.current_agent = "planner" | .agent_status = "running"'
20
+
21
+ # 또는 직접 jq 로 partial update
22
+ jq '.agent_status = "completed" | .completed_agents += ["planner"]' .harness/progress.json > .harness/progress.json.tmp && mv .harness/progress.json.tmp .harness/progress.json
23
+ ```
24
+
25
+ 위 두 방식은 파일의 나머지 필드를 보존한다. Read → 수정 → Write 패턴은 사용 금지.
26
+
9
27
  ## Session Boundary Protocol
10
28
 
11
29
  ### On Start
@@ -9,6 +9,24 @@ disable-model-invocation: true
9
9
  > Functional/Visual 평가자보다 **먼저** 실행된다. 코드가 구조적으로 망가졌으면
10
10
  > 동작 테스트는 의미 없다. 이 게이트에서 FAIL 이면 Functional/Visual 은 아예 시작도 하지 않는다.
11
11
 
12
+ ## progress.json 업데이트 규칙 (v5.6.3+)
13
+
14
+ ⚠️ **절대로 progress.json 을 통째로 재작성하지 마라**. `Write` 도구로 전체 파일을
15
+ 덮어쓰면 `mode` / `team_state` / 기타 top-level 필드가 누락되어 Team Mode 가 Solo 로
16
+ 되돌아가는 등 런타임 오류가 발생한다.
17
+
18
+ **올바른 방법** — 반드시 partial update 로 갱신:
19
+
20
+ ```bash
21
+ # 헬퍼 스크립트 (권장)
22
+ bash scripts/harness-progress-set.sh . '.current_agent = "planner" | .agent_status = "running"'
23
+
24
+ # 또는 직접 jq 로 partial update
25
+ jq '.agent_status = "completed" | .completed_agents += ["planner"]' .harness/progress.json > .harness/progress.json.tmp && mv .harness/progress.json.tmp .harness/progress.json
26
+ ```
27
+
28
+ 위 두 방식은 파일의 나머지 필드를 보존한다. Read → 수정 → Write 패턴은 사용 금지.
29
+
12
30
  ## Session Boundary Protocol
13
31
 
14
32
  ### On Start
@@ -6,6 +6,24 @@ disable-model-invocation: true
6
6
 
7
7
  # Evaluator-Functional — Playwright MCP
8
8
 
9
+ ## progress.json 업데이트 규칙 (v5.6.3+)
10
+
11
+ ⚠️ **절대로 progress.json 을 통째로 재작성하지 마라**. `Write` 도구로 전체 파일을
12
+ 덮어쓰면 `mode` / `team_state` / 기타 top-level 필드가 누락되어 Team Mode 가 Solo 로
13
+ 되돌아가는 등 런타임 오류가 발생한다.
14
+
15
+ **올바른 방법** — 반드시 partial update 로 갱신:
16
+
17
+ ```bash
18
+ # 헬퍼 스크립트 (권장)
19
+ bash scripts/harness-progress-set.sh . '.current_agent = "planner" | .agent_status = "running"'
20
+
21
+ # 또는 직접 jq 로 partial update
22
+ jq '.agent_status = "completed" | .completed_agents += ["planner"]' .harness/progress.json > .harness/progress.json.tmp && mv .harness/progress.json.tmp .harness/progress.json
23
+ ```
24
+
25
+ 위 두 방식은 파일의 나머지 필드를 보존한다. Read → 수정 → Write 패턴은 사용 금지.
26
+
9
27
  ## Session Boundary Protocol
10
28
 
11
29
  ### On Start
@@ -6,6 +6,24 @@ disable-model-invocation: true
6
6
 
7
7
  # Evaluator-Visual — Design & Accessibility
8
8
 
9
+ ## progress.json 업데이트 규칙 (v5.6.3+)
10
+
11
+ ⚠️ **절대로 progress.json 을 통째로 재작성하지 마라**. `Write` 도구로 전체 파일을
12
+ 덮어쓰면 `mode` / `team_state` / 기타 top-level 필드가 누락되어 Team Mode 가 Solo 로
13
+ 되돌아가는 등 런타임 오류가 발생한다.
14
+
15
+ **올바른 방법** — 반드시 partial update 로 갱신:
16
+
17
+ ```bash
18
+ # 헬퍼 스크립트 (권장)
19
+ bash scripts/harness-progress-set.sh . '.current_agent = "planner" | .agent_status = "running"'
20
+
21
+ # 또는 직접 jq 로 partial update
22
+ jq '.agent_status = "completed" | .completed_agents += ["planner"]' .harness/progress.json > .harness/progress.json.tmp && mv .harness/progress.json.tmp .harness/progress.json
23
+ ```
24
+
25
+ 위 두 방식은 파일의 나머지 필드를 보존한다. Read → 수정 → Write 패턴은 사용 금지.
26
+
9
27
  ## Session Boundary Protocol
10
28
 
11
29
  ### On Start
@@ -6,6 +6,24 @@ disable-model-invocation: true
6
6
 
7
7
  # Generator-Backend — Adaptive (Stack-Agnostic)
8
8
 
9
+ ## progress.json 업데이트 규칙 (v5.6.3+)
10
+
11
+ ⚠️ **절대로 progress.json 을 통째로 재작성하지 마라**. `Write` 도구로 전체 파일을
12
+ 덮어쓰면 `mode` / `team_state` / 기타 top-level 필드가 누락되어 Team Mode 가 Solo 로
13
+ 되돌아가는 등 런타임 오류가 발생한다.
14
+
15
+ **올바른 방법** — 반드시 partial update 로 갱신:
16
+
17
+ ```bash
18
+ # 헬퍼 스크립트 (권장)
19
+ bash scripts/harness-progress-set.sh . '.current_agent = "planner" | .agent_status = "running"'
20
+
21
+ # 또는 직접 jq 로 partial update
22
+ jq '.agent_status = "completed" | .completed_agents += ["planner"]' .harness/progress.json > .harness/progress.json.tmp && mv .harness/progress.json.tmp .harness/progress.json
23
+ ```
24
+
25
+ 위 두 방식은 파일의 나머지 필드를 보존한다. Read → 수정 → Write 패턴은 사용 금지.
26
+
9
27
  ## Session Boundary Protocol
10
28
 
11
29
  ### On Start
@@ -6,6 +6,24 @@ disable-model-invocation: true
6
6
 
7
7
  # Generator-Frontend — Adaptive (Stack-Agnostic)
8
8
 
9
+ ## progress.json 업데이트 규칙 (v5.6.3+)
10
+
11
+ ⚠️ **절대로 progress.json 을 통째로 재작성하지 마라**. `Write` 도구로 전체 파일을
12
+ 덮어쓰면 `mode` / `team_state` / 기타 top-level 필드가 누락되어 Team Mode 가 Solo 로
13
+ 되돌아가는 등 런타임 오류가 발생한다.
14
+
15
+ **올바른 방법** — 반드시 partial update 로 갱신:
16
+
17
+ ```bash
18
+ # 헬퍼 스크립트 (권장)
19
+ bash scripts/harness-progress-set.sh . '.current_agent = "planner" | .agent_status = "running"'
20
+
21
+ # 또는 직접 jq 로 partial update
22
+ jq '.agent_status = "completed" | .completed_agents += ["planner"]' .harness/progress.json > .harness/progress.json.tmp && mv .harness/progress.json.tmp .harness/progress.json
23
+ ```
24
+
25
+ 위 두 방식은 파일의 나머지 필드를 보존한다. Read → 수정 → Write 패턴은 사용 금지.
26
+
9
27
  ## Session Boundary Protocol
10
28
 
11
29
  ### On Start
@@ -6,6 +6,24 @@ disable-model-invocation: true
6
6
 
7
7
  # Planner Agent
8
8
 
9
+ ## progress.json 업데이트 규칙 (v5.6.3+)
10
+
11
+ ⚠️ **절대로 progress.json 을 통째로 재작성하지 마라**. `Write` 도구로 전체 파일을
12
+ 덮어쓰면 `mode` / `team_state` / 기타 top-level 필드가 누락되어 Team Mode 가 Solo 로
13
+ 되돌아가는 등 런타임 오류가 발생한다.
14
+
15
+ **올바른 방법** — 반드시 partial update 로 갱신:
16
+
17
+ ```bash
18
+ # 헬퍼 스크립트 (권장)
19
+ bash scripts/harness-progress-set.sh . '.current_agent = "planner" | .agent_status = "running"'
20
+
21
+ # 또는 직접 jq 로 partial update
22
+ jq '.agent_status = "completed" | .completed_agents += ["planner"]' .harness/progress.json > .harness/progress.json.tmp && mv .harness/progress.json.tmp .harness/progress.json
23
+ ```
24
+
25
+ 위 두 방식은 파일의 나머지 필드를 보존한다. Read → 수정 → Write 패턴은 사용 금지.
26
+
9
27
  ## Session Boundary Protocol
10
28
 
11
29
  ### On Start