@walwal-harness/cli 6.0.5 → 6.1.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.
- package/CHANGELOG.md +42 -0
- package/commands/harness-solo.md +20 -20
- package/commands/harness-team.md +1 -1
- package/package.json +1 -1
- package/scripts/conductor-tick.sh +382 -0
- package/scripts/harness-archive.sh +123 -0
- package/scripts/harness-dashboard-up.sh +72 -0
- package/scripts/harness-dashboard.sh +509 -0
- package/scripts/harness-goal-init.sh +72 -0
- package/scripts/harness-goal-show.sh +37 -0
- package/scripts/harness-gotcha-memory.sh +348 -0
- package/scripts/harness-gotcha-register.sh +393 -0
- package/scripts/harness-meeting-doc.sh +153 -0
- package/scripts/harness-monitor.sh +398 -0
- package/scripts/harness-next.sh +577 -0
- package/scripts/harness-progress-set.sh +41 -0
- package/scripts/harness-prompt-history.sh +164 -0
- package/scripts/harness-queue-manager.sh +694 -0
- package/scripts/harness-session-start.sh +140 -0
- package/scripts/harness-statusline.sh +139 -0
- package/scripts/harness-task-session.sh +48 -0
- package/scripts/harness-tmux.sh +372 -0
- package/scripts/harness-user-prompt-submit.sh +123 -0
- package/scripts/init-agents-md.sh +337 -0
- package/scripts/init-ref-docs.sh +262 -0
- package/scripts/lib/harness-audit.sh +113 -0
- package/scripts/lib/harness-guardrail.sh +148 -0
- package/scripts/lib/harness-keywait.sh +57 -0
- package/scripts/lib/harness-render-progress.sh +346 -0
- package/scripts/scan-project.sh +367 -0
- package/skills/brainstorming/SKILL.md +4 -4
- package/skills/conductor/SKILL.md +12 -16
- package/skills/cqo/SKILL.md +7 -0
- package/skills/cto/SKILL.md +7 -0
- package/skills/dispatcher/SKILL.md +17 -28
- package/skills/evaluator-code-quality/SKILL.md +1 -1
- package/skills/evaluator-functional/SKILL.md +1 -1
- package/skills/evaluator-visual/SKILL.md +1 -1
- package/skills/generator-backend/SKILL.md +1 -1
- package/skills/generator-frontend/SKILL.md +1 -1
- package/skills/meeting-manager/SKILL.md +33 -1
- package/skills/planner/SKILL.md +23 -9
- package/skills/service-ops/SKILL.md +19 -4
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# harness-goal-show.sh — 현재 active GOAL + 적합도 요약 출력
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
|
|
5
|
+
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
6
|
+
PROGRESS="$ROOT/.harness/progress.json"
|
|
7
|
+
GOAL_FILE="$ROOT/.harness/actions/goals.md"
|
|
8
|
+
|
|
9
|
+
if [ ! -f "$PROGRESS" ]; then
|
|
10
|
+
echo "progress.json 없음. bash init.sh 먼저 실행." >&2; exit 1
|
|
11
|
+
fi
|
|
12
|
+
|
|
13
|
+
ACTIVE_ID=$(jq -r '.goals.active_id // ""' "$PROGRESS")
|
|
14
|
+
ADHERENCE=$(jq -r '.goals.current_adherence // "n/a"' "$PROGRESS")
|
|
15
|
+
|
|
16
|
+
if [ -z "$ACTIVE_ID" ]; then
|
|
17
|
+
echo "Active GOAL 없음. CEO(Dispatcher)가 첫 발화에서 발급."
|
|
18
|
+
echo " bash scripts/harness-goal-init.sh \"<title>\""
|
|
19
|
+
exit 0
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
echo "Active GOAL: $ACTIVE_ID"
|
|
23
|
+
echo "Adherence: $ADHERENCE"
|
|
24
|
+
echo ""
|
|
25
|
+
|
|
26
|
+
# progress.json 의 GOAL 메타 출력
|
|
27
|
+
jq -r --arg id "$ACTIVE_ID" '
|
|
28
|
+
.goals.list[] | select(.id == $id) |
|
|
29
|
+
"title: \(.title)",
|
|
30
|
+
"status: \(.status)",
|
|
31
|
+
"owner_confirmed: \(.owner_confirmed)",
|
|
32
|
+
"cto_feasibility: \(.cto_feasibility // "pending")",
|
|
33
|
+
"created_at: \(.created_at // "?")"
|
|
34
|
+
' "$PROGRESS"
|
|
35
|
+
|
|
36
|
+
echo ""
|
|
37
|
+
echo "본문: $GOAL_FILE 에서 ## $ACTIVE_ID 섹션 참조"
|
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# harness-gotcha-memory.sh — Gotcha · Memory · Conventions pane (index view)
|
|
3
|
+
# 활성 에이전트의 gotcha를 최상단으로, 나머지는 요약(최근 3항목+총개수)으로 표시
|
|
4
|
+
# + Shared Memory 요약 + Conventions 요약 (shared + 활성 에이전트별)
|
|
5
|
+
#
|
|
6
|
+
# Usage:
|
|
7
|
+
# bash scripts/harness-gotcha-memory.sh [project-root] # 전체 (legacy)
|
|
8
|
+
# bash scripts/harness-gotcha-memory.sh [project-root] --mode gotcha # gotcha 만
|
|
9
|
+
# bash scripts/harness-gotcha-memory.sh [project-root] --mode conventions # conventions 만
|
|
10
|
+
# bash scripts/harness-gotcha-memory.sh [project-root] --mode memory # memory 만
|
|
11
|
+
#
|
|
12
|
+
# tmux 분할 환경에서는 각 sub-pane 이 한 mode 만 렌더 → 좁은 창에서도 잘리지 않음.
|
|
13
|
+
# tmux copy-mode (prefix + [) 로 각 pane 독립 스크롤.
|
|
14
|
+
|
|
15
|
+
set -uo pipefail
|
|
16
|
+
|
|
17
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
18
|
+
source "$SCRIPT_DIR/lib/harness-render-progress.sh"
|
|
19
|
+
source "$SCRIPT_DIR/lib/harness-keywait.sh"
|
|
20
|
+
|
|
21
|
+
# Args parsing — first non-flag = project root, --mode = view mode
|
|
22
|
+
PROJECT_ROOT=""
|
|
23
|
+
MODE="all"
|
|
24
|
+
while [ $# -gt 0 ]; do
|
|
25
|
+
case "$1" in
|
|
26
|
+
--mode) MODE="$2"; shift 2 ;;
|
|
27
|
+
--mode=*) MODE="${1#--mode=}"; shift ;;
|
|
28
|
+
*) [ -z "$PROJECT_ROOT" ] && PROJECT_ROOT="$1"; shift ;;
|
|
29
|
+
esac
|
|
30
|
+
done
|
|
31
|
+
|
|
32
|
+
if [ -z "$PROJECT_ROOT" ]; then
|
|
33
|
+
PROJECT_ROOT="$(resolve_harness_root ".")" || { echo "[gotcha] .harness/ not found."; exit 1; }
|
|
34
|
+
fi
|
|
35
|
+
|
|
36
|
+
case "$MODE" in
|
|
37
|
+
all|gotcha|conventions|memory) ;;
|
|
38
|
+
*) echo "[gotcha] unknown mode: $MODE" >&2; exit 1 ;;
|
|
39
|
+
esac
|
|
40
|
+
|
|
41
|
+
MEMORY_FILE="$PROJECT_ROOT/.harness/memory.md"
|
|
42
|
+
GOTCHAS_DIR="$PROJECT_ROOT/.harness/gotchas"
|
|
43
|
+
CONVENTIONS_DIR="$PROJECT_ROOT/.harness/conventions"
|
|
44
|
+
PROGRESS="$PROJECT_ROOT/.harness/progress.json"
|
|
45
|
+
|
|
46
|
+
BOLD="\033[1m"
|
|
47
|
+
DIM="\033[2m"
|
|
48
|
+
GREEN="\033[32m"
|
|
49
|
+
YELLOW="\033[33m"
|
|
50
|
+
RED="\033[31m"
|
|
51
|
+
CYAN="\033[36m"
|
|
52
|
+
MAGENTA="\033[35m"
|
|
53
|
+
RESET="\033[0m"
|
|
54
|
+
BG_YELLOW="\033[43m"
|
|
55
|
+
|
|
56
|
+
REFRESH_SEC="${HARNESS_REFRESH:-5}"
|
|
57
|
+
# 단독 mode 패널은 전체 표시 (충분한 세로 공간), 통합 뷰만 최근 3 개로 압축.
|
|
58
|
+
if [ "$MODE" = "all" ]; then
|
|
59
|
+
RECENT_N="${HARNESS_GOTCHA_RECENT:-3}"
|
|
60
|
+
else
|
|
61
|
+
RECENT_N="${HARNESS_GOTCHA_RECENT:-9999}"
|
|
62
|
+
fi
|
|
63
|
+
|
|
64
|
+
# 렌더 캐시 — 내용이 바뀌지 않으면 redraw 스킵
|
|
65
|
+
LAST_SIG=""
|
|
66
|
+
|
|
67
|
+
# 입력 시그니처: gotchas + memory + 활성 에이전트의 mtime/size 해시
|
|
68
|
+
compute_signature() {
|
|
69
|
+
{
|
|
70
|
+
[ -f "$PROGRESS" ] && stat -f '%m %z' "$PROGRESS" 2>/dev/null
|
|
71
|
+
[ -f "$MEMORY_FILE" ] && stat -f '%m %z' "$MEMORY_FILE" 2>/dev/null
|
|
72
|
+
if [ -d "$GOTCHAS_DIR" ]; then
|
|
73
|
+
for f in "$GOTCHAS_DIR"/*.md; do
|
|
74
|
+
[ -e "$f" ] || continue
|
|
75
|
+
stat -f '%N %m %z' "$f" 2>/dev/null
|
|
76
|
+
done
|
|
77
|
+
fi
|
|
78
|
+
if [ -d "$CONVENTIONS_DIR" ]; then
|
|
79
|
+
for f in "$CONVENTIONS_DIR"/*.md; do
|
|
80
|
+
[ -e "$f" ] || continue
|
|
81
|
+
stat -f '%N %m %z' "$f" 2>/dev/null
|
|
82
|
+
done
|
|
83
|
+
fi
|
|
84
|
+
} | md5 -q 2>/dev/null || echo "$RANDOM"
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
# 활성 에이전트 결정: current_agent > next_agent
|
|
88
|
+
get_active_agent() {
|
|
89
|
+
[ -f "$PROGRESS" ] || { echo ""; return; }
|
|
90
|
+
command -v jq &>/dev/null || { echo ""; return; }
|
|
91
|
+
local cur nxt
|
|
92
|
+
cur=$(jq -r '.current_agent // ""' "$PROGRESS" 2>/dev/null)
|
|
93
|
+
nxt=$(jq -r '.next_agent // ""' "$PROGRESS" 2>/dev/null)
|
|
94
|
+
if [ -n "$cur" ] && [ "$cur" != "null" ] && [ "$cur" != "none" ]; then
|
|
95
|
+
echo "$cur"
|
|
96
|
+
elif [ -n "$nxt" ] && [ "$nxt" != "null" ] && [ "$nxt" != "none" ]; then
|
|
97
|
+
echo "$nxt"
|
|
98
|
+
else
|
|
99
|
+
echo ""
|
|
100
|
+
fi
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
# gotcha 파일에서 '### ' 헤딩 개수 = 항목 총수
|
|
104
|
+
count_items() {
|
|
105
|
+
local f="$1"
|
|
106
|
+
local n
|
|
107
|
+
n=$(grep -c '^### ' "$f" 2>/dev/null)
|
|
108
|
+
echo "${n:-0}"
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
# 최근 N개 항목 제목 추출 (### 헤딩 — 파일 하단부가 최신이라 tail)
|
|
112
|
+
# rule_id 마커 주석(<!-- rule_id: ... -->) 은 시각적 노이즈라 제거
|
|
113
|
+
recent_titles() {
|
|
114
|
+
local f="$1" n="$2"
|
|
115
|
+
grep '^### ' "$f" 2>/dev/null \
|
|
116
|
+
| tail -n "$n" \
|
|
117
|
+
| sed -E 's/^### //; s/[[:space:]]*<!--[[:space:]]*rule_id:[[:space:]]*[^>]*-->[[:space:]]*$//'
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
# agent 이름 → 파일 basename 매핑 (정확/접두 일치)
|
|
121
|
+
file_for_agent() {
|
|
122
|
+
local agent="$1"
|
|
123
|
+
local f="$GOTCHAS_DIR/${agent}.md"
|
|
124
|
+
[ -f "$f" ] && { echo "$f"; return; }
|
|
125
|
+
# 접두 일치 (예: current_agent=generator → generator-backend/frontend 중 하나)
|
|
126
|
+
for cand in "$GOTCHAS_DIR"/*.md; do
|
|
127
|
+
[ -e "$cand" ] || continue
|
|
128
|
+
local base
|
|
129
|
+
base=$(basename "$cand" .md)
|
|
130
|
+
[ "$base" = "README" ] && continue
|
|
131
|
+
case "$base" in
|
|
132
|
+
"$agent"*|*"$agent"*) echo "$cand"; return ;;
|
|
133
|
+
esac
|
|
134
|
+
done
|
|
135
|
+
echo ""
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
render_gotcha_entry() {
|
|
139
|
+
local f="$1" active="$2"
|
|
140
|
+
local name count
|
|
141
|
+
name=$(basename "$f" .md)
|
|
142
|
+
count=$(count_items "$f")
|
|
143
|
+
if [ "$active" = "true" ]; then
|
|
144
|
+
echo -e "${BOLD}${BG_YELLOW} ▸ ${name} ${RESET} ${DIM}(${count} items · ACTIVE)${RESET}"
|
|
145
|
+
else
|
|
146
|
+
echo -e "${BOLD}${GREEN}▸ ${name}${RESET} ${DIM}(${count} items)${RESET}"
|
|
147
|
+
fi
|
|
148
|
+
if [ "$count" -eq 0 ]; then
|
|
149
|
+
echo -e " ${DIM}(항목 없음)${RESET}"
|
|
150
|
+
else
|
|
151
|
+
recent_titles "$f" "$RECENT_N" | while IFS= read -r t; do
|
|
152
|
+
echo -e " ${DIM}·${RESET} $t"
|
|
153
|
+
done
|
|
154
|
+
fi
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
render_conventions_summary() {
|
|
158
|
+
if [ ! -d "$CONVENTIONS_DIR" ]; then
|
|
159
|
+
echo -e "${DIM}(conventions/ 없음)${RESET}"
|
|
160
|
+
return
|
|
161
|
+
fi
|
|
162
|
+
|
|
163
|
+
local active="$1"
|
|
164
|
+
local any=false
|
|
165
|
+
|
|
166
|
+
# Shared 먼저, 그다음 활성 에이전트, 그다음 나머지
|
|
167
|
+
local ordered_files=()
|
|
168
|
+
[ -f "$CONVENTIONS_DIR/shared.md" ] && ordered_files+=("$CONVENTIONS_DIR/shared.md")
|
|
169
|
+
if [ -n "$active" ] && [ -f "$CONVENTIONS_DIR/${active}.md" ]; then
|
|
170
|
+
ordered_files+=("$CONVENTIONS_DIR/${active}.md")
|
|
171
|
+
fi
|
|
172
|
+
for cand in "$CONVENTIONS_DIR"/*.md; do
|
|
173
|
+
[ -e "$cand" ] || continue
|
|
174
|
+
local base; base=$(basename "$cand" .md)
|
|
175
|
+
[ "$base" = "README" ] && continue
|
|
176
|
+
[ "$cand" = "$CONVENTIONS_DIR/shared.md" ] && continue
|
|
177
|
+
[ -n "$active" ] && [ "$cand" = "$CONVENTIONS_DIR/${active}.md" ] && continue
|
|
178
|
+
ordered_files+=("$cand")
|
|
179
|
+
done
|
|
180
|
+
|
|
181
|
+
for f in "${ordered_files[@]}"; do
|
|
182
|
+
[ -e "$f" ] || continue
|
|
183
|
+
local name count
|
|
184
|
+
name=$(basename "$f" .md)
|
|
185
|
+
count=$(count_items "$f")
|
|
186
|
+
if [ "$name" = "shared" ]; then
|
|
187
|
+
echo -e "${BOLD}${CYAN}▸ ${name}${RESET} ${DIM}(${count} items · shared)${RESET}"
|
|
188
|
+
elif [ -n "$active" ] && [ "$name" = "$active" ]; then
|
|
189
|
+
echo -e "${BOLD}${BG_YELLOW} ▸ ${name} ${RESET} ${DIM}(${count} items · ACTIVE)${RESET}"
|
|
190
|
+
else
|
|
191
|
+
echo -e "${BOLD}${GREEN}▸ ${name}${RESET} ${DIM}(${count} items)${RESET}"
|
|
192
|
+
fi
|
|
193
|
+
if [ "$count" -eq 0 ]; then
|
|
194
|
+
echo -e " ${DIM}(항목 없음)${RESET}"
|
|
195
|
+
else
|
|
196
|
+
recent_titles "$f" "$RECENT_N" | while IFS= read -r t; do
|
|
197
|
+
echo -e " ${DIM}·${RESET} $t"
|
|
198
|
+
done
|
|
199
|
+
fi
|
|
200
|
+
any=true
|
|
201
|
+
done
|
|
202
|
+
|
|
203
|
+
[ "$any" = "false" ] && echo -e "${DIM}(항목 없음)${RESET}"
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
render_memory_summary() {
|
|
207
|
+
if [ ! -f "$MEMORY_FILE" ]; then
|
|
208
|
+
echo -e "${DIM}(memory.md 없음)${RESET}"
|
|
209
|
+
return
|
|
210
|
+
fi
|
|
211
|
+
local count
|
|
212
|
+
count=$(grep -c '^### ' "$MEMORY_FILE" 2>/dev/null)
|
|
213
|
+
count="${count:-0}"
|
|
214
|
+
echo -e "${BOLD}${CYAN}▣ SHARED MEMORY${RESET} ${DIM}(${count} items · memory.md)${RESET}"
|
|
215
|
+
if [ "$count" -eq 0 ]; then
|
|
216
|
+
echo -e " ${DIM}(항목 없음)${RESET}"
|
|
217
|
+
else
|
|
218
|
+
grep '^### ' "$MEMORY_FILE" | tail -n "$RECENT_N" | sed 's/^### //' | while IFS= read -r t; do
|
|
219
|
+
echo -e " ${DIM}·${RESET} $t"
|
|
220
|
+
done
|
|
221
|
+
fi
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
render_header() {
|
|
225
|
+
local title="$1"
|
|
226
|
+
local cols hr
|
|
227
|
+
cols=$(tput cols 2>/dev/null || echo 80)
|
|
228
|
+
hr=$(printf '─%.0s' $(seq 1 "$cols"))
|
|
229
|
+
echo -e "${BOLD}${MAGENTA}${title}${RESET} ${DIM}$(date +%H:%M:%S) · recent=${RECENT_N} · refresh ${REFRESH_SEC}s${RESET}"
|
|
230
|
+
local active="$1_active"
|
|
231
|
+
[ -n "${2:-}" ] && echo -e "${DIM}active agent:${RESET} ${BOLD}${YELLOW}$2${RESET}"
|
|
232
|
+
echo -e "${DIM}${hr}${RESET}"
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
render_gotcha_section() {
|
|
236
|
+
local active="$1" active_file="$2"
|
|
237
|
+
local cols hr
|
|
238
|
+
cols=$(tput cols 2>/dev/null || echo 80)
|
|
239
|
+
hr=$(printf '─%.0s' $(seq 1 "$cols"))
|
|
240
|
+
echo -e "${BOLD}${MAGENTA}▣ GOTCHAS${RESET} ${DIM}(.harness/gotchas) · $(date +%H:%M:%S) · refresh ${REFRESH_SEC}s${RESET}"
|
|
241
|
+
if [ -n "$active" ]; then
|
|
242
|
+
echo -e "${DIM}active agent:${RESET} ${BOLD}${YELLOW}${active}${RESET}"
|
|
243
|
+
fi
|
|
244
|
+
echo -e "${DIM}${hr}${RESET}"
|
|
245
|
+
|
|
246
|
+
if [ -n "$active_file" ]; then
|
|
247
|
+
render_gotcha_entry "$active_file" "true"
|
|
248
|
+
echo ""
|
|
249
|
+
fi
|
|
250
|
+
if [ -d "$GOTCHAS_DIR" ]; then
|
|
251
|
+
for f in "$GOTCHAS_DIR"/*.md; do
|
|
252
|
+
[ -e "$f" ] || continue
|
|
253
|
+
[ "$f" = "$active_file" ] && continue
|
|
254
|
+
local base; base=$(basename "$f" .md)
|
|
255
|
+
[ "$base" = "README" ] && continue
|
|
256
|
+
render_gotcha_entry "$f" "false"
|
|
257
|
+
done
|
|
258
|
+
fi
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
render_conventions_section() {
|
|
262
|
+
local active="$1"
|
|
263
|
+
local cols hr
|
|
264
|
+
cols=$(tput cols 2>/dev/null || echo 80)
|
|
265
|
+
hr=$(printf '─%.0s' $(seq 1 "$cols"))
|
|
266
|
+
echo -e "${BOLD}${CYAN}▣ CONVENTIONS${RESET} ${DIM}(.harness/conventions) · $(date +%H:%M:%S) · refresh ${REFRESH_SEC}s${RESET}"
|
|
267
|
+
echo -e "${DIM}${hr}${RESET}"
|
|
268
|
+
render_conventions_summary "$active"
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
render_memory_section() {
|
|
272
|
+
local cols hr
|
|
273
|
+
cols=$(tput cols 2>/dev/null || echo 80)
|
|
274
|
+
hr=$(printf '─%.0s' $(seq 1 "$cols"))
|
|
275
|
+
echo -e "${BOLD}${CYAN}▣ SHARED MEMORY${RESET} ${DIM}(memory.md) · $(date +%H:%M:%S) · refresh ${REFRESH_SEC}s${RESET}"
|
|
276
|
+
echo -e "${DIM}${hr}${RESET}"
|
|
277
|
+
render_memory_summary
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
render() {
|
|
281
|
+
# clear 대신 커서 홈 + 화면 끝까지 지우기 — 깜빡임 최소화
|
|
282
|
+
printf '\033[H\033[2J\033[3J'
|
|
283
|
+
|
|
284
|
+
local active active_file
|
|
285
|
+
active=$(get_active_agent)
|
|
286
|
+
active_file=""
|
|
287
|
+
[ -n "$active" ] && active_file=$(file_for_agent "$active")
|
|
288
|
+
|
|
289
|
+
case "$MODE" in
|
|
290
|
+
gotcha)
|
|
291
|
+
render_gotcha_section "$active" "$active_file"
|
|
292
|
+
;;
|
|
293
|
+
conventions)
|
|
294
|
+
render_conventions_section "$active"
|
|
295
|
+
;;
|
|
296
|
+
memory)
|
|
297
|
+
render_memory_section
|
|
298
|
+
;;
|
|
299
|
+
all)
|
|
300
|
+
local cols hr
|
|
301
|
+
cols=$(tput cols 2>/dev/null || echo 80)
|
|
302
|
+
hr=$(printf '─%.0s' $(seq 1 "$cols"))
|
|
303
|
+
echo -e "${BOLD}${MAGENTA}RULES INDEX${RESET} ${DIM}Gotcha · Memory · Conventions · $(date +%H:%M:%S) · recent=${RECENT_N} · refresh ${REFRESH_SEC}s${RESET}"
|
|
304
|
+
if [ -n "$active" ]; then
|
|
305
|
+
echo -e "${DIM}active agent:${RESET} ${BOLD}${YELLOW}${active}${RESET}"
|
|
306
|
+
else
|
|
307
|
+
echo -e "${DIM}active agent: (none)${RESET}"
|
|
308
|
+
fi
|
|
309
|
+
echo -e "${DIM}${hr}${RESET}"
|
|
310
|
+
|
|
311
|
+
if [ -n "$active_file" ]; then
|
|
312
|
+
render_gotcha_entry "$active_file" "true"
|
|
313
|
+
echo ""
|
|
314
|
+
fi
|
|
315
|
+
if [ -d "$GOTCHAS_DIR" ]; then
|
|
316
|
+
for f in "$GOTCHAS_DIR"/*.md; do
|
|
317
|
+
[ -e "$f" ] || continue
|
|
318
|
+
[ "$f" = "$active_file" ] && continue
|
|
319
|
+
local base; base=$(basename "$f" .md)
|
|
320
|
+
[ "$base" = "README" ] && continue
|
|
321
|
+
render_gotcha_entry "$f" "false"
|
|
322
|
+
done
|
|
323
|
+
fi
|
|
324
|
+
echo ""
|
|
325
|
+
echo -e "${DIM}${hr}${RESET}"
|
|
326
|
+
echo -e "${BOLD}${CYAN}▣ CONVENTIONS${RESET} ${DIM}(.harness/conventions)${RESET}"
|
|
327
|
+
render_conventions_summary "$active"
|
|
328
|
+
echo ""
|
|
329
|
+
echo -e "${DIM}${hr}${RESET}"
|
|
330
|
+
render_memory_summary
|
|
331
|
+
;;
|
|
332
|
+
esac
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
trap 'exit 0' INT TERM
|
|
336
|
+
|
|
337
|
+
while true; do
|
|
338
|
+
sig=$(compute_signature)
|
|
339
|
+
if [ "$sig" != "$LAST_SIG" ]; then
|
|
340
|
+
render
|
|
341
|
+
printf "${DIM} [r] refresh [q] quit${RESET}\033[K\n"
|
|
342
|
+
LAST_SIG="$sig"
|
|
343
|
+
fi
|
|
344
|
+
if ! wait_or_refresh "$REFRESH_SEC"; then
|
|
345
|
+
# 'r' 키 → 캐시 무효화해서 다음 루프에서 강제 렌더
|
|
346
|
+
LAST_SIG=""
|
|
347
|
+
fi
|
|
348
|
+
done
|