@chrono-meta/fh-gate 2.7.0 → 2.9.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/.claude/rules/fh_4axis_gate.md +33 -5
- package/.claude-plugin/marketplace.json +2 -2
- package/AGENTS.md +4 -0
- package/CLAUDE.md +169 -183
- package/README.ja.md +157 -53
- package/README.ko.md +147 -50
- package/README.md +136 -50
- package/README.zh.md +137 -46
- package/docs/ETHOS.md +20 -8
- package/docs/GATE_DAY.md +235 -0
- package/docs/OUTPUT_EVIDENCE.md +13 -2
- package/docs/codex-compat.md +10 -2
- package/knowledge/shared/dialogue/ai_dialogue_playbook.md +131 -0
- package/knowledge/shared/harness-core/agents_md_runtime_details.md +10 -3
- package/knowledge/shared/harness-core/claude_md_gate_details.md +90 -0
- package/knowledge/shared/harness-core/dispatch_conditional_prohibition.md +75 -0
- package/knowledge/shared/harness-core/fh_three_layer_canon.md +97 -5
- package/knowledge/shared/harness-core/field_verdict_crossfamily_gate.md +96 -5
- package/knowledge/shared/harness-core/harness_incubator_doctrine.md +6 -1
- package/knowledge/shared/harness-core/ship_readiness_gate.md +2 -2
- package/knowledge/shared/learnings/subagent_invocations_log.yaml +137 -0
- package/knowledge/shared/rules/multi_session_close_protocol.md +15 -4
- package/package.json +12 -2
- package/plugins/fh-commons/.claude-plugin/plugin.json +1 -1
- package/plugins/fh-meta/.claude-plugin/plugin.json +1 -1
- package/plugins/fh-meta/CHANGELOG.md +116 -0
- package/plugins/fh-meta/skills/cross-ecosystem-synergy-detection/SKILL.md +127 -0
- package/scripts/branch_claim.sh +3 -1
- package/scripts/chamber_candidate_collect.sh +71 -13
- package/scripts/listing_watch.sh +187 -0
- package/scripts/mapped_tracks.sh +113 -0
- package/scripts/package_coverage_check.sh +54 -0
- package/scripts/prior_art_prompt.sh +49 -2
- package/scripts/selfcheck.sh +44 -1
- package/scripts/session_close_check.sh +56 -3
- package/scripts/test_chamber_sig_lanes.sh +151 -0
- package/scripts/test_leak_scan_control_lanes.sh +163 -0
- package/scripts/test_listing_watch_lanes.sh +162 -0
- package/scripts/test_mapped_tracks_lanes.sh +162 -0
- package/scripts/test_peer_worktree_detect_lanes.sh +138 -0
- package/scripts/test_prepush_destructive_lanes.sh +366 -0
- package/scripts/test_prior_art_prompt_lanes.sh +48 -0
- package/scripts/test_regression_guard_ci_lanes.sh +124 -0
- package/scripts/test_wizard_snippet_merge_lanes.sh +40 -0
- package/templates/predelete_check.test.sh +56 -0
- package/templates/regression_guard.sh +75 -3
- package/templates/settings.PriorArt.snippet.json +41 -12
|
@@ -88,13 +88,64 @@ fi
|
|
|
88
88
|
|
|
89
89
|
# --- keyword signature per candidate (for dedup) ---
|
|
90
90
|
STOP='^(that|this|from|into|over|when|what|will|your|there|their|then|than|with|chamber|candidate|skill|agent|tool|does|done|after|before|which|about|through)$'
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
#
|
|
92
|
+
# 🟥 EVERY STAGE IS PINNED TO LC_ALL=C, AND THAT IS THE WHOLE REPAIR (2026-08-22 — known-pair
|
|
93
|
+
# calibration lives in scripts/test_chamber_sig_lanes.sh, which is where the measurements below
|
|
94
|
+
# are reproducible). The signature pipeline used to run under the ambient locale, and in a UTF-8
|
|
95
|
+
# locale THREE of its stages silently mis-handle Hangul:
|
|
96
|
+
# · `sort -u` — Hangul syllables collate as EQUAL to one another. Measured: 8 distinct Korean
|
|
97
|
+
# tokens → 2 survivors on macOS/BSD sort (grouped by syllable count, input-order dependent),
|
|
98
|
+
# → 1 survivor on GNU coreutils 9.7. The signature is not shortened, it is DELETED.
|
|
99
|
+
# · `comm -12` — inherits the same collation, so two entirely different Korean tokens are
|
|
100
|
+
# reported as a common line. Measured: comm -12 <(레인) <(발주) prints a line. The jaccard
|
|
101
|
+
# numerator was measuring a collation, not an overlap.
|
|
102
|
+
# · `awk length()` — BYTES on BSD awk, CHARACTERS on gawk in a UTF-8 locale. The same 2-syllable
|
|
103
|
+
# token passes the old `>=4` on macOS (6 bytes) and is DROPPED on Linux (2 chars): the two
|
|
104
|
+
# platforms did not even agree on the token set before comparing it.
|
|
105
|
+
# Live effect on this repo's 64-marker corpus: unrelated candidates folded into clusters of 11, 7,
|
|
106
|
+
# 7, 4 and 3, only each cluster's first member reached the queue, and the run still printed a
|
|
107
|
+
# healthy "deduped candidates: 31". A silent fold rendered as a clean number
|
|
108
|
+
# ([[feedback_not_found_is_not_zero_family]]).
|
|
109
|
+
#
|
|
110
|
+
# ⚠️ The threshold (MINJ) was NOT touched. The signatures were shredded; a threshold moved to
|
|
111
|
+
# compensate would have papered over the shredding and mis-scored the corpus in a new way.
|
|
112
|
+
#
|
|
113
|
+
# Tokenizer: one POSIX-awk pass over BYTES, no locale-sensitive character classes anywhere.
|
|
114
|
+
# _HANLEAD = UTF-8 lead bytes EA-ED → U+A000..U+DFFF, which contains the Hangul syllable block
|
|
115
|
+
# (U+AC00-D7A3). Deliberately a byte range and not `[가-힣]`: BSD tr reads that range
|
|
116
|
+
# as characters and GNU tr reads it as bytes 0x80-0xED, so the same pattern keeps the
|
|
117
|
+
# em-dash on Linux and drops it on macOS (measured, both).
|
|
118
|
+
# _HANCONT = UTF-8 continuation bytes 80-BF.
|
|
119
|
+
# Because the alternation matches ASCII-alnum runs and Hangul runs separately, every other byte —
|
|
120
|
+
# «»「」·—→…, CJK punctuation, fullwidth forms — is a SEPARATOR by construction, with no
|
|
121
|
+
# hand-maintained punctuation vocabulary to drift.
|
|
122
|
+
# Length is then counted in CHARACTERS on both platforms without asking awk about encoding: an
|
|
123
|
+
# ASCII run is 1 byte/char, a Hangul run is exactly 3.
|
|
124
|
+
# Thresholds preserve the pre-repair BSD semantics on purpose (ASCII ≥4 chars, Hangul ≥2 syllables
|
|
125
|
+
# for _sig; ≥2 / ≥1 for _ksig) — this commit fixes the collation, it does not re-tune the filter.
|
|
126
|
+
#
|
|
127
|
+
# Portability, ARGUED AND THEN MEASURED (not asserted): the awk program uses only match/substr/
|
|
128
|
+
# length/tolower and dynamic regexes built from -v byte ranges, all of which are byte-semantic in
|
|
129
|
+
# the C locale on every awk. Run on the same input: BSD awk 20200816 (macOS), mawk 1.3.4 and
|
|
130
|
+
# gawk 5 (debian:stable-slim, via docker) → BYTE-IDENTICAL token sets.
|
|
131
|
+
_HANLEAD=$(printf '\352-\355')
|
|
132
|
+
_HANCONT=$(printf '\200-\277')
|
|
133
|
+
_tok() { # $1=text $2=min ASCII chars $3=min Hangul syllables → sorted unique token list
|
|
134
|
+
printf '%s' "$1" | LC_ALL=C awk -v L="$_HANLEAD" -v C="$_HANCONT" -v MA="$2" -v MH="$3" '
|
|
135
|
+
{ s = tolower($0); pat = "[a-z0-9]+|([" L "][" C "][" C "])+"
|
|
136
|
+
while (match(s, pat)) {
|
|
137
|
+
t = substr(s, RSTART, RLENGTH)
|
|
138
|
+
if (t ~ ("^[" L "]")) { if (length(t) / 3 >= MH) print t }
|
|
139
|
+
else { if (length(t) >= MA) print t }
|
|
140
|
+
s = substr(s, RSTART + RLENGTH)
|
|
141
|
+
} }' \
|
|
142
|
+
| LC_ALL=C grep -vE "$STOP" | LC_ALL=C sort -u
|
|
143
|
+
}
|
|
144
|
+
_sig() { _tok "$1" 4 2; }
|
|
93
145
|
# kill-side signature for the seen-filter: keeps 2+ char tokens (a slug's meaningful short tokens like
|
|
94
146
|
# "qa"/"ui" are dropped by _sig's ≥4 filter → an all-short slug yields an EMPTY sig → kkn=0 → the old
|
|
95
147
|
# match never fired → a KILLed candidate re-entered the queue SILENTLY, Axis-2 MED-3b). Drops stopwords only.
|
|
96
|
-
_ksig() {
|
|
97
|
-
| awk 'length($0)>=2' | grep -vE "$STOP" | sort -u; }
|
|
148
|
+
_ksig() { _tok "$1" 2 1; }
|
|
98
149
|
|
|
99
150
|
# --- LAYER 2: dedup by greedy jaccard clustering ---
|
|
100
151
|
# cluster files: $WORK/cluster.N holds "source<TAB>desc" lines; $WORK/sig.N holds the union keyword sig.
|
|
@@ -106,12 +157,17 @@ while IFS=$'\t' read -r label desc; do
|
|
|
106
157
|
merged=0
|
|
107
158
|
c=1
|
|
108
159
|
while [ "$c" -le "$NC" ]; do
|
|
109
|
-
|
|
110
|
-
|
|
160
|
+
# LC_ALL=C on BOTH: `comm` requires its inputs sorted in the SAME collation it compares with,
|
|
161
|
+
# and _tok already emits C-collated lines. Under a UTF-8 locale this pair reported different
|
|
162
|
+
# Korean tokens as common (see the _sig header) — the numerator, not just the token list.
|
|
163
|
+
inter=$(LC_ALL=C comm -12 "$WORK/sig.$c" "$WORK/candsig.$idx" 2>/dev/null | grep -c . || true)
|
|
164
|
+
union=$(LC_ALL=C sort -u "$WORK/sig.$c" "$WORK/candsig.$idx" 2>/dev/null | grep -c . || true)
|
|
111
165
|
jac=0; [ "${union:-0}" -gt 0 ] && jac=$(( inter * 100 / union ))
|
|
112
166
|
if [ "$jac" -ge "$MINJ" ]; then
|
|
113
167
|
printf '%s\t%s\n' "$label" "$desc" >> "$WORK/cluster.$c"
|
|
114
|
-
|
|
168
|
+
# C-collated too: this file is a `comm` input on the next iteration. A UTF-8 sort here would
|
|
169
|
+
# re-break the ordering precondition one merge after it was established.
|
|
170
|
+
LC_ALL=C sort -u "$WORK/sig.$c" "$WORK/candsig.$idx" > "$WORK/sig.$c.tmp" && mv "$WORK/sig.$c.tmp" "$WORK/sig.$c"
|
|
115
171
|
merged=1; break
|
|
116
172
|
fi
|
|
117
173
|
c=$((c+1))
|
|
@@ -146,8 +202,8 @@ RANKED="$WORK/ranked"; : > "$RANKED"
|
|
|
146
202
|
c=1
|
|
147
203
|
while [ "$c" -le "$NC" ]; do
|
|
148
204
|
freq=$(grep -c . "$WORK/cluster.$c" 2>/dev/null); freq=${freq:-0}
|
|
149
|
-
ndiv=$(cut -f1 "$WORK/cluster.$c" | sort -u | grep -c . || true)
|
|
150
|
-
srcs=$(cut -f1 "$WORK/cluster.$c" | sort -u | paste -sd, -)
|
|
205
|
+
ndiv=$(cut -f1 "$WORK/cluster.$c" | LC_ALL=C sort -u | grep -c . || true)
|
|
206
|
+
srcs=$(cut -f1 "$WORK/cluster.$c" | LC_ALL=C sort -u | paste -sd, -)
|
|
151
207
|
rep=$(head -1 "$WORK/cluster.$c" | cut -f2-)
|
|
152
208
|
score=$(( ndiv * 2 + freq ))
|
|
153
209
|
# seen-filter: does this candidate match an already-KILLed ledger entry? Two decorrelated tests, either
|
|
@@ -159,15 +215,17 @@ while [ "$c" -le "$NC" ]; do
|
|
|
159
215
|
# catches a wrong match), whereas silent re-entry was invisible. Visible-imprecise ≻ silent-miss.
|
|
160
216
|
if [ "$NKILL" -gt 0 ]; then
|
|
161
217
|
_ksig "$rep" > "$WORK/repsig"
|
|
162
|
-
|
|
218
|
+
# C locale: `tr` ranges and case folding are byte-semantic here, so the flattened slug is the
|
|
219
|
+
# same string on BSD and GNU. Non-ASCII is dropped by design — this is the ASCII-slug fallback.
|
|
220
|
+
repflat=$(printf '%s' "$rep" | LC_ALL=C tr 'A-Z' 'a-z' | LC_ALL=C tr -cd 'a-z0-9')
|
|
163
221
|
seen_match=""
|
|
164
222
|
while IFS= read -r kname; do
|
|
165
223
|
[ -z "$kname" ] && continue
|
|
166
224
|
_ksig "$kname" > "$WORK/ksig"
|
|
167
225
|
kkn=$(grep -c . "$WORK/ksig" 2>/dev/null || true); kkn=${kkn:-0}
|
|
168
|
-
matched=0; [ "$kkn" -gt 0 ] && matched=$(comm -12 "$WORK/ksig" "$WORK/repsig" 2>/dev/null | grep -c . || true)
|
|
226
|
+
matched=0; [ "$kkn" -gt 0 ] && matched=$(LC_ALL=C comm -12 "$WORK/ksig" "$WORK/repsig" 2>/dev/null | grep -c . || true)
|
|
169
227
|
kpct=0; [ "$kkn" -gt 0 ] && kpct=$(( matched * 100 / kkn ))
|
|
170
|
-
kflat=$(printf '%s' "$kname" | tr '
|
|
228
|
+
kflat=$(printf '%s' "$kname" | LC_ALL=C tr 'A-Z' 'a-z' | LC_ALL=C tr -cd 'a-z0-9')
|
|
171
229
|
if [ "$kkn" -gt 0 ] && [ "$kpct" -ge 60 ]; then seen_match="$kname"; break; fi
|
|
172
230
|
if [ "${#kflat}" -ge 5 ] && printf '%s' "$repflat" | grep -qF "$kflat"; then seen_match="$kname"; break; fi
|
|
173
231
|
done < "$KILLED"
|
|
@@ -197,7 +255,7 @@ echo "deduped candidates: $NC (from $NRAW raw markers)"
|
|
|
197
255
|
echo ""
|
|
198
256
|
printf '%-5s %-6s %-24s %-18s %s\n' "SCORE" "SRCS" "SOURCES" "REINVENTION" "CANDIDATE"
|
|
199
257
|
printf '%-5s %-6s %-24s %-18s %s\n' "-----" "------" "------------------------" "------------------" "---------"
|
|
200
|
-
sort -rn "$RANKED" | while IFS=$'\t' read -r score ndiv srcs verdict rep; do
|
|
258
|
+
LC_ALL=C sort -rn "$RANKED" | while IFS=$'\t' read -r score ndiv srcs verdict rep; do
|
|
201
259
|
# drop leading zeros for display
|
|
202
260
|
printf '%-5d %-6d %-24s %-18s %s\n' "$((10#$score))" "$ndiv" "$srcs" "$verdict" "$rep"
|
|
203
261
|
done
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# listing_watch.sh — 외부 큐레이션 목록에 낸 제출의 «조용한 상태 전이»를 잡는다.
|
|
3
|
+
#
|
|
4
|
+
# 왜 있나 (실측 근거, 2026-08-19):
|
|
5
|
+
# `awesome-claude-code` #1961 이 2026-06-07 에 validation-PASSED 였다가, 우리가 아무것도
|
|
6
|
+
# 안 건드린 채 2026-08-15 에 **validation-FAILED 로 뒤집혔다** — 그쪽이 허용 카테고리
|
|
7
|
+
# 목록을 바꾸고 봇이 기존 이슈를 재검증하면서 떨어진 것이다. 아무도 안 알려줬고,
|
|
8
|
+
# `validation-failed` 는 «리뷰 대기열에서 빠진» 상태다. 4일 뒤 **우연히** 발견했다.
|
|
9
|
+
# ⇒ 통과는 영구적이지 않고, 알림은 오지 않는다. 그래서 이쪽에서 스냅샷을 떠서 대조한다.
|
|
10
|
+
#
|
|
11
|
+
# 설계 규율 (전부 이 저장소의 실측에서 나온 것):
|
|
12
|
+
# · **항상 exit 0 + stdout 보고** — 훅은 비영 종료 시 stdout 이 버려지고 stderr 도 안 온다
|
|
13
|
+
# (`feedback_hook_nonzero_exit_is_silent`). 이 스크립트는 판정을 «출력»하지 종료코드로
|
|
14
|
+
# 말하지 않는다.
|
|
15
|
+
# · **미측정을 0 으로 접지 않는다** — 상태는 넷이다: DISABLED / SKIPPED / FAILED / EXECUTED
|
|
16
|
+
# (`feedback_not_found_is_not_zero_family`). `gh` 가 없으면 «통과» 가 아니라 «SKIPPED» 다.
|
|
17
|
+
# · **파이프로 판정하지 않는다** — `out=$(cmd); rc=$?` 형태만 쓴다
|
|
18
|
+
# (`feedback_pipefail_fallback_disarms_guard`).
|
|
19
|
+
# · **부재 주장엔 컨트롤** — `--selftest` 가 known-positive/known-negative 를 돌린다
|
|
20
|
+
# (`feedback_absence_measurement_needs_control`).
|
|
21
|
+
# · bash 3.2 (macOS 기본) 호환 — 연관배열 안 쓴다.
|
|
22
|
+
#
|
|
23
|
+
# 채널 목록은 **이 파일에 안 박는다** — 운영자의 실제 제출은 사설 정보다.
|
|
24
|
+
# 매니페스트: tracks/_meta/listing_watch_channels.tsv (gitignored)
|
|
25
|
+
# 형식(TAB 구분, `#` 주석): owner/repo <TAB> number <TAB> pr|issue <TAB> 목록에서_찾을_문자열
|
|
26
|
+
#
|
|
27
|
+
# 사용: bash scripts/listing_watch.sh [--force] [--selftest]
|
|
28
|
+
|
|
29
|
+
HUB="${CLAUDE_PROJECT_DIR:-$(cd "$(dirname "$0")/.." && pwd)}"
|
|
30
|
+
MANIFEST="$HUB/tracks/_meta/listing_watch_channels.tsv"
|
|
31
|
+
STATE="$HUB/tracks/_meta/.listing_watch_state.tsv"
|
|
32
|
+
THROTTLE_H=24
|
|
33
|
+
FORCE=0; SELFTEST=0
|
|
34
|
+
for a in "$@"; do
|
|
35
|
+
case "$a" in --force) FORCE=1 ;; --selftest) SELFTEST=1 ;; esac
|
|
36
|
+
done
|
|
37
|
+
|
|
38
|
+
say() { printf '%s\n' "$*"; }
|
|
39
|
+
|
|
40
|
+
# 🟥 **`stat -f %m` 을 «먼저» 쓰면 리눅스에서 조용히 깨진다** — GNU stat 의 `-f` 는
|
|
41
|
+
# «파일시스템 정보»라 **실패가 아니라 성공하며 다른 값을 뱉고**, 그래서 `||` 폴백이 안 탄다.
|
|
42
|
+
# CI 가 실제로 그렇게 잡았다(`Type: ext2/ext3 … syntax error in expression`).
|
|
43
|
+
# ⇒ 순서를 뒤집는 것으로 끝내지 않고 **숫자인지 검증**한다. 순서만 바꾸면 반대 플랫폼에서
|
|
44
|
+
# 같은 얼굴이 다시 난다. `[[feedback_wiring_surfaces_hidden_failures]]`
|
|
45
|
+
_mtime() {
|
|
46
|
+
local m
|
|
47
|
+
m=$(stat -c %Y "$1" 2>/dev/null)
|
|
48
|
+
case "$m" in ''|*[!0-9]*) m=$(stat -f %m "$1" 2>/dev/null) ;; esac
|
|
49
|
+
case "$m" in ''|*[!0-9]*) m=0 ;; esac
|
|
50
|
+
printf '%s' "$m"
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
# 🟥 grep 패턴의 `\t` 는 **이식되지 않는다** — GNU grep 은 리터럴 `t` 로 읽어 0건이 되고,
|
|
54
|
+
# 그러면 「FAILED 를 매번 보고한다」는 규율이 리눅스에서만 조용히 죽는다(CI 적발).
|
|
55
|
+
# 실제 탭 문자를 만들어 `-F` 로 쓴다.
|
|
56
|
+
TAB=$(printf '\t')
|
|
57
|
+
|
|
58
|
+
# 🟥 테스트 seam: 레인이 «gh 없는 호스트» 를 흉내내려고 PATH 를 깎으면 호스트에 따라
|
|
59
|
+
# 결과가 갈린다(리눅스의 /usr/bin 에 gh 가 있을 수 있다 — cross-family 지목).
|
|
60
|
+
# 명령 이름을 주입 가능하게 두면 레인이 호스트와 무관해진다.
|
|
61
|
+
GH="${LISTING_WATCH_GH:-gh}"
|
|
62
|
+
|
|
63
|
+
# ── 도구 가용성: 없으면 «SKIPPED, not passed» ─────────────────────────────
|
|
64
|
+
if ! command -v "$GH" >/dev/null 2>&1; then
|
|
65
|
+
say " ⚠️ [listing-watch] SKIPPED (not passed) — \`$GH\` 없음. 등재 상태를 **확인하지 못했다**."
|
|
66
|
+
exit 0
|
|
67
|
+
fi
|
|
68
|
+
|
|
69
|
+
# ── 한 채널의 현재 상태를 한 줄로 (owner/repo#num<TAB>STATE<TAB>labels<TAB>listed) ──
|
|
70
|
+
probe() { # $1=repo $2=num $3=kind $4=needle
|
|
71
|
+
local repo="$1" num="$2" kind="$3" needle="$4" st lab listed out rc
|
|
72
|
+
# 🟥 라벨 «개수» 를 같이 싣는다 — join(",") 만으로는 ["a,b"](1개) 와 ["a","b"](2개) 가
|
|
73
|
+
# 구분이 안 돼 진짜 라벨 전이가 스냅샷에서 같게 비친다(cross-family 지목).
|
|
74
|
+
out=$($GH api "repos/$repo/issues/$num" --jq '"\(.state)|\(.pull_request.merged_at // "null")|\([.labels[].name]|length)|\([.labels[].name] | sort | join(","))"' 2>&1); rc=$?
|
|
75
|
+
if [ $rc -ne 0 ]; then printf '%s#%s\tFAILED\t-\t-\n' "$repo" "$num"; return 0; fi
|
|
76
|
+
st=$(printf '%s' "$out" | cut -d'|' -f1)
|
|
77
|
+
local merged n_lab; merged=$(printf '%s' "$out" | cut -d'|' -f2); n_lab=$(printf '%s' "$out" | cut -d'|' -f3)
|
|
78
|
+
lab=$(printf '%s' "$out" | cut -d'|' -f4-)
|
|
79
|
+
[ "$merged" != "null" ] && st="MERGED"
|
|
80
|
+
[ -z "$lab" ] && lab="-"
|
|
81
|
+
lab="${n_lab}:${lab}"
|
|
82
|
+
listed="unknown"
|
|
83
|
+
if [ -n "$needle" ] && [ "$needle" != "-" ]; then
|
|
84
|
+
local body brc dec
|
|
85
|
+
body=$($GH api "repos/$repo/contents/README.md" --jq '.content' 2>/dev/null); brc=$?
|
|
86
|
+
if [ $brc -eq 0 ] && [ -n "$body" ]; then
|
|
87
|
+
# base64 플래그가 갈린다: GNU/신 macOS 는 -d, 구 macOS 는 -D. 둘 다 시도한다.
|
|
88
|
+
dec=$(printf '%s' "$body" | base64 -d 2>/dev/null) || true
|
|
89
|
+
[ -z "$dec" ] && dec=$(printf '%s' "$body" | base64 -D 2>/dev/null) || true
|
|
90
|
+
if [ -z "$dec" ]; then
|
|
91
|
+
listed="unreadable" # 🟥 디코드 실패를 «absent» 로 접으면 계기 고장이 «미등재» 로 읽힌다
|
|
92
|
+
elif printf '%s' "$dec" | grep -qF -- "$needle"; then listed="LISTED"
|
|
93
|
+
else listed="absent"; fi
|
|
94
|
+
else
|
|
95
|
+
listed="unreadable" # ← «없음» 이 아니라 «못 읽었음». 접지 않는다
|
|
96
|
+
fi
|
|
97
|
+
fi
|
|
98
|
+
printf '%s#%s\t%s\t%s\t%s\n' "$repo" "$num" "$st" "$lab" "$listed"
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
# ── 컨트롤: 계기가 살아 있는지 (known-positive / known-negative) ──────────
|
|
102
|
+
if [ "$SELFTEST" = "1" ]; then
|
|
103
|
+
say "[listing-watch selftest] 컨트롤 2종"
|
|
104
|
+
kp=$(probe "walkinglabs/awesome-harness-engineering" 33 pr "forge-harness")
|
|
105
|
+
say " known-positive walkinglabs#33 (MERGED 로 알려짐): $kp"
|
|
106
|
+
case "$kp" in *MERGED*) say " ✅ 양성 검출" ;; *) say " ❌ 계기 고장 — 알려진 MERGED 를 못 읽었다" ;; esac
|
|
107
|
+
kn=$(probe "walkinglabs/awesome-harness-engineering" 99999999 pr "-")
|
|
108
|
+
say " known-negative 없는 번호 #99999999: $kn"
|
|
109
|
+
case "$kn" in *FAILED*) say " ✅ 없는 것을 «없다»로 (지어내지 않음)" ;; *) say " ❌ 없는 것에 상태를 만들어냈다" ;; esac
|
|
110
|
+
exit 0
|
|
111
|
+
fi
|
|
112
|
+
|
|
113
|
+
# ── 매니페스트 없으면 DISABLED (기능 자체가 안 켜진 것 — 실패가 아니다) ──
|
|
114
|
+
if [ ! -f "$MANIFEST" ]; then
|
|
115
|
+
say " ℹ️ [listing-watch] DISABLED — 채널 매니페스트 없음 ($MANIFEST)."
|
|
116
|
+
say " 켜려면 TAB 구분으로: owner/repo <TAB> 번호 <TAB> pr|issue <TAB> 목록에서_찾을_문자열"
|
|
117
|
+
exit 0
|
|
118
|
+
fi
|
|
119
|
+
|
|
120
|
+
# ── 스로틀: 24h 안에 돌았으면 조용히 넘어간다 ────────────────────────────
|
|
121
|
+
if [ "$FORCE" != "1" ] && [ -f "$STATE" ]; then
|
|
122
|
+
now=$(date +%s)
|
|
123
|
+
mt=$(_mtime "$STATE")
|
|
124
|
+
if [ $(( (now - mt) / 3600 )) -lt "$THROTTLE_H" ]; then exit 0; fi
|
|
125
|
+
fi
|
|
126
|
+
|
|
127
|
+
NEW=$(mktemp); CHANGED=0; ROWS=0
|
|
128
|
+
# 🟥 `IFS=$'\t' read` 를 쓰지 않는다 — 탭은 IFS 공백류라 **연속 탭이 합쳐져** 빈 칸이 있는
|
|
129
|
+
# 행에서 필드가 밀린다(cross-family 재현). 줄을 통째로 읽고 `cut` 으로 자른다.
|
|
130
|
+
# 🟥 `|| [ -n "$line" ]` 이 없으면 **개행 없는 마지막 행이 통째로 누락**된다(재현: 2행 중 1행).
|
|
131
|
+
while IFS= read -r line || [ -n "$line" ]; do
|
|
132
|
+
case "$line" in ''|\#*) continue ;; esac
|
|
133
|
+
repo=$(printf '%s' "$line" | cut -f1)
|
|
134
|
+
num=$(printf '%s' "$line" | cut -f2)
|
|
135
|
+
kind=$(printf '%s' "$line" | cut -f3)
|
|
136
|
+
needle=$(printf '%s' "$line" | cut -f4)
|
|
137
|
+
case "$repo" in ''|\#*) continue ;; esac
|
|
138
|
+
[ -z "$num" ] && continue
|
|
139
|
+
ROWS=$((ROWS+1))
|
|
140
|
+
line=$(probe "$repo" "$num" "${kind:-pr}" "${needle:--}")
|
|
141
|
+
printf '%s\n' "$line" >> "$NEW"
|
|
142
|
+
key=$(printf '%s' "$line" | cut -f1)
|
|
143
|
+
if [ -f "$STATE" ]; then
|
|
144
|
+
old=$(grep -F "$key " "$STATE" 2>/dev/null | head -1)
|
|
145
|
+
if [ -n "$old" ] && [ "$old" != "$line" ]; then
|
|
146
|
+
[ "$CHANGED" = "0" ] && say "" && say "🔔 [listing-watch] **등재 채널 상태가 바뀌었다** — 아무도 안 알려주는 종류다"
|
|
147
|
+
CHANGED=$((CHANGED+1))
|
|
148
|
+
say " $key"
|
|
149
|
+
say " 이전: $(printf '%s' "$old" | cut -f2-)"
|
|
150
|
+
say " 지금: $(printf '%s' "$line" | cut -f2-)"
|
|
151
|
+
fi
|
|
152
|
+
fi
|
|
153
|
+
done < "$MANIFEST"
|
|
154
|
+
|
|
155
|
+
if [ "$ROWS" = "0" ]; then
|
|
156
|
+
say " ℹ️ [listing-watch] DISABLED — 매니페스트에 유효한 채널 행이 0개다."
|
|
157
|
+
rm -f "$NEW"; exit 0
|
|
158
|
+
fi
|
|
159
|
+
|
|
160
|
+
# 🟥 **FAILED 는 «변화» 가 아니라 «상태» 로 매번 보고한다.** 안 그러면 인증 만료가 첫 실행에
|
|
161
|
+
# 스냅샷으로 굳고, 이후 FAILED==FAILED 라 **영구 무출력**이 된다 — 이 스크립트 헤더가
|
|
162
|
+
# 스스로 금지한 `not_found ≠ 0` 을 스크립트 자신이 저지르고 있었다(cross-family 지목, 재현됨).
|
|
163
|
+
# 🟥 `grep -c ... || echo 0` 을 쓰지 않는다: grep -c 는 무매치에서 **"0" 을 출력하고 exit 1** 이라
|
|
164
|
+
# 폴백이 "0\n0" 을 만들고 `[` 가 «integer expression expected» 로 죽는다(내 수리가 낸 결함).
|
|
165
|
+
# `[[feedback_pipefail_fallback_disarms_guard]]` 일가 — 값을 먼저 잡고 따로 판정한다.
|
|
166
|
+
NFAIL=$(grep -cF "${TAB}FAILED${TAB}" "$NEW" 2>/dev/null)
|
|
167
|
+
case "$NFAIL" in ''|*[!0-9]*) NFAIL=0 ;; esac
|
|
168
|
+
if [ "$NFAIL" -gt 0 ]; then
|
|
169
|
+
say ""
|
|
170
|
+
say " ⚠️ [listing-watch] 채널 $NFAIL 개를 **읽지 못했다**(FAILED) — «변화 없음» 이 아니다."
|
|
171
|
+
grep -F "${TAB}FAILED${TAB}" "$NEW" 2>/dev/null | while IFS= read -r l; do say " $(printf '%s' "$l" | cut -f1)"; done
|
|
172
|
+
say " 흔한 원인: gh 인증 만료(\`gh auth status\`) · 레포/번호 오타 · 비공개 전환."
|
|
173
|
+
say " 🟥 이 줄이 안 보일 때까지는 그 채널의 상태를 **모르는 것**이다."
|
|
174
|
+
fi
|
|
175
|
+
|
|
176
|
+
if [ ! -f "$STATE" ]; then
|
|
177
|
+
say " ℹ️ [listing-watch] 최초 실행 — 채널 $ROWS 개 스냅샷을 떴다. 다음 실행부터 «변화»를 낸다."
|
|
178
|
+
elif [ "$CHANGED" -gt 0 ]; then
|
|
179
|
+
say " ⚠️ 통과는 영구적이지 않다 — 남의 스키마가 바뀌면 과거 제출이 소급 무효가 된다."
|
|
180
|
+
say " 새로 내기 전에 라벨 이력부터: gh api repos/<r>/issues/<n>/timeline"
|
|
181
|
+
fi
|
|
182
|
+
if ! mv "$NEW" "$STATE" 2>/dev/null; then
|
|
183
|
+
say " ⚠️ [listing-watch] 스냅샷 **저장 실패** ($STATE) — 다음 실행이 이번 관측을 못 본다."
|
|
184
|
+
say " 변화 검출이 이 시점부터 **멈춘 것**이지 «변화 없음» 이 아니다."
|
|
185
|
+
rm -f "$NEW"
|
|
186
|
+
fi
|
|
187
|
+
exit 0
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# mapped_tracks.sh — the ONE mechanical answer to "how many field harnesses are mapped in this hub?"
|
|
3
|
+
#
|
|
4
|
+
# WHY THIS EXISTS (measured 2026-08-22, known-pair in one run):
|
|
5
|
+
# main checkout : 11 mapped tracks
|
|
6
|
+
# a worktree : 1
|
|
7
|
+
# The mapping signal is the PRESENCE of `tracks/<name>/`, and that signal cannot survive into a
|
|
8
|
+
# worktree for two independent reasons: (a) `tracks/**` is gitignored, and (b) at least one mapped
|
|
9
|
+
# track (`pmh-dev`) is an EMPTY directory, which git cannot carry even if it were tracked. So a
|
|
10
|
+
# worktree does not have a smaller count — it has a STRUCTURALLY BLIND one.
|
|
11
|
+
#
|
|
12
|
+
# WHY THAT WAS SILENT: the synergy skill's Step 3-b closes as `run(n pairs)` or
|
|
13
|
+
# `skipped(<2 mapped tracks)`, and BOTH are mandatory-pass values. A worktree run therefore closed
|
|
14
|
+
# GREEN while blind — the same shape as the ①-c peer-detection defect fixed the same day, on the
|
|
15
|
+
# instrument that grades identity ④ itself.
|
|
16
|
+
#
|
|
17
|
+
# MECHANIZED AT N=2 BY CLASS, NOT BY COUNT: `operations.md` allows mechanization at "N>=3 **or the
|
|
18
|
+
# same class recurring on another surface**". This class (a count over gitignored, un-committable
|
|
19
|
+
# state read from cwd instead of the repo's common root) hit two distinct surfaces on 2026-08-22 —
|
|
20
|
+
# ①-c peer placement and Step 3-b mapped-track counting. Recorded here so the threshold is not
|
|
21
|
+
# claimed loosely.
|
|
22
|
+
#
|
|
23
|
+
# NOT-FOUND IS NOT ZERO. If the root cannot be resolved or `tracks/` is not there, this exits 3 with
|
|
24
|
+
# status=UNMEASURED. It never prints `count=0` for a question it could not ask.
|
|
25
|
+
#
|
|
26
|
+
# Usage: bash scripts/mapped_tracks.sh [--count-only]
|
|
27
|
+
# Exit: 0 = measured · 3 = UNMEASURED (a NON-PASS; never fold into "0 mapped") · 2 = bad usage
|
|
28
|
+
|
|
29
|
+
set -uo pipefail
|
|
30
|
+
|
|
31
|
+
COUNT_ONLY=0
|
|
32
|
+
case "${1:-}" in
|
|
33
|
+
--count-only) COUNT_ONLY=1 ;;
|
|
34
|
+
"") ;;
|
|
35
|
+
*) echo "usage: $0 [--count-only]" >&2; exit 2 ;;
|
|
36
|
+
esac
|
|
37
|
+
|
|
38
|
+
_die_unmeasured() {
|
|
39
|
+
echo "status=UNMEASURED"
|
|
40
|
+
echo "reason=$1"
|
|
41
|
+
echo "# not-found != zero — do NOT read this as 'no mapped tracks'"
|
|
42
|
+
exit 3
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
command -v git >/dev/null 2>&1 || _die_unmeasured "git-absent"
|
|
46
|
+
|
|
47
|
+
# Resolve the hub root the way this repo already sanctions for worktree-reachable evidence
|
|
48
|
+
# (`templates/.git-hooks/pre-commit` §EVIDENCE_ROOT): `--git-common-dir` returns the MAIN tree's .git
|
|
49
|
+
# from inside any worktree.
|
|
50
|
+
# ⚠️ Deliberately NOT the `$(cmd || echo "")` form used there. Under a `cmd || fallback` the guard
|
|
51
|
+
# depends on the failing command leaving stdout empty; the canonical form separates the value from
|
|
52
|
+
# the status so a command that fails WHILE printing cannot be mistaken for a success.
|
|
53
|
+
_repo_root=$(git rev-parse --show-toplevel 2>/dev/null); _rc_root=$?
|
|
54
|
+
[ "$_rc_root" -eq 0 ] && [ -n "$_repo_root" ] || _die_unmeasured "not-in-a-git-repo"
|
|
55
|
+
|
|
56
|
+
_gcd=$(git rev-parse --git-common-dir 2>/dev/null); _rc_gcd=$?
|
|
57
|
+
if [ "$_rc_gcd" -ne 0 ] || [ -z "$_gcd" ]; then
|
|
58
|
+
HUB_ROOT="$_repo_root" # degraded but named below, not silently
|
|
59
|
+
ROOT_SRC="repo-root(common-dir-unresolved)"
|
|
60
|
+
else
|
|
61
|
+
case "$_gcd" in
|
|
62
|
+
# `--git-common-dir` returns a RELATIVE path ('.git') at a repo root and an ABSOLUTE one inside a
|
|
63
|
+
# worktree. Comparing or using it raw is exactly the bug this script exists to close.
|
|
64
|
+
/*) HUB_ROOT=$(dirname "$_gcd") ;;
|
|
65
|
+
*) HUB_ROOT=$(dirname "$_repo_root/$_gcd") ;;
|
|
66
|
+
esac
|
|
67
|
+
ROOT_SRC="git-common-dir"
|
|
68
|
+
fi
|
|
69
|
+
# Normalise both sides before comparing — a raw string compare would reproduce the defect.
|
|
70
|
+
HUB_ROOT=$(cd "$HUB_ROOT" 2>/dev/null && pwd -P) || _die_unmeasured "hub-root-unreadable"
|
|
71
|
+
CWD_ROOT=$(cd "$_repo_root" 2>/dev/null && pwd -P) || CWD_ROOT="$_repo_root"
|
|
72
|
+
|
|
73
|
+
IN_WORKTREE=no
|
|
74
|
+
[ "$HUB_ROOT" != "$CWD_ROOT" ] && IN_WORKTREE=yes
|
|
75
|
+
|
|
76
|
+
[ -d "$HUB_ROOT/tracks" ] || _die_unmeasured "no-tracks-dir-at:$HUB_ROOT"
|
|
77
|
+
|
|
78
|
+
# 🟥 존재만 보면 부족하다 — «못 읽었다» 가 «없다» 로 접힌다 (2026-08-23 실측, 4케이스).
|
|
79
|
+
# 이 파일 머리가 "not-found != zero" 를 이유로 존재하는데, 초판은 그 규율을 **존재 검사 한 분기에만**
|
|
80
|
+
# 적용했다: 디렉터리가 있는데 읽을 수 없으면 아래 글롭이 조용히 0건을 내고 `status=OK count=0` 이
|
|
81
|
+
# 나간다 — 진짜로 매핑이 0개인 경우와 **출력이 글자 하나 안 다르다.** 그리고 하류(Step 3-b)에서
|
|
82
|
+
# 그 0 은 `skipped(<2 mapped tracks)` = **pass 값**으로 접히므로, 권한 문제가 초록으로 닫힌다.
|
|
83
|
+
# chmod 755 → -r ✓ -x ✓ 글롭 1 chmod 111 → -r ✗ -x ✓ 글롭 0 ← `-x` 만 보면 통과시킨다
|
|
84
|
+
# chmod 500 → -r ✓ -x ✓ 글롭 1 chmod 000 → -r ✗ -x ✗ 글롭 0
|
|
85
|
+
# ⇒ 둘 다 요구한다. 이 조합이 «글롭이 셀 수 있는가» 와 네 케이스 전부에서 일치한다(레인 P-1·P-2).
|
|
86
|
+
{ [ -r "$HUB_ROOT/tracks" ] && [ -x "$HUB_ROOT/tracks" ]; } || _die_unmeasured "tracks-dir-unreadable-at:$HUB_ROOT"
|
|
87
|
+
|
|
88
|
+
# Count. Underscore-prefixed dirs are META (_meta/_audit/_contrib/_chamber…) and are not mapped
|
|
89
|
+
# projects — the test is a LEADING underscore only.
|
|
90
|
+
# ⚠️ Measured slip, kept as a comment because it cost a re-measure: a `case "$n" in *_*)` filter
|
|
91
|
+
# also eats `the_bible`, whose underscore is in the middle. Anchor the pattern.
|
|
92
|
+
NAMES=""; COUNT=0
|
|
93
|
+
for _d in "$HUB_ROOT"/tracks/*/; do
|
|
94
|
+
[ -d "$_d" ] || continue # unmatched glob stays literal in sh
|
|
95
|
+
_n=$(basename "$_d")
|
|
96
|
+
case "$_n" in _*) continue ;; esac
|
|
97
|
+
COUNT=$((COUNT + 1))
|
|
98
|
+
NAMES="$NAMES $_n"
|
|
99
|
+
done
|
|
100
|
+
|
|
101
|
+
if [ "$COUNT_ONLY" = "1" ]; then echo "$COUNT"; exit 0; fi
|
|
102
|
+
|
|
103
|
+
echo "status=OK"
|
|
104
|
+
echo "hub_root=$HUB_ROOT"
|
|
105
|
+
echo "root_source=$ROOT_SRC"
|
|
106
|
+
echo "in_worktree=$IN_WORKTREE"
|
|
107
|
+
echo "count=$COUNT"
|
|
108
|
+
echo "names=${NAMES# }"
|
|
109
|
+
if [ "$IN_WORKTREE" = "yes" ]; then
|
|
110
|
+
echo "# NOTE: running from a worktree; the count above is the MAIN tree's, resolved via"
|
|
111
|
+
echo "# --git-common-dir. The worktree's own tracks/ is NOT the answer to this question."
|
|
112
|
+
fi
|
|
113
|
+
exit 0
|
|
@@ -127,8 +127,62 @@ ACCEPTED_ABSENT=(
|
|
|
127
127
|
# 「출하된 레인의 **주체**가 출하되나」를 안 본다. 그 갭은 아직 안 닫혔다(명시 잔여).
|
|
128
128
|
"scripts/test_satellite_publish_gate_lanes.sh"
|
|
129
129
|
"scripts/test_satellite_profile_schema_lanes.sh"
|
|
130
|
+
# · 2026-08-22, 파괴적-op 앵커 배선이 만든 셋. **같은 선례의 재현이고, 이 검사기가 또 잡았다** —
|
|
131
|
+
# `test_prepush_destructive_lanes.sh` 를 files[] 에 넣고 `selfcheck.sh` 의 pair-표에 전체
|
|
132
|
+
# 경로 두 줄을 쓴 순간, 그 두 파일이 이름 대는 것들이 팬텀이 됐다. 위 블록이 예고한 그대로다.
|
|
133
|
+
# ⓐ test_prepush_destructive_liveness.sh — 일부러 안 싣는다. 7단계 중 둘이 **레포-개발 전용
|
|
134
|
+
# 컨트롤**이라 소비자 install 에서 정직할 수 없다: ⑥ orphan 은 주체
|
|
135
|
+
# `templates/predelete_check.test.sh` 가 미출하라 **부재로 FAIL**(옳지 않은 red), ⑦
|
|
136
|
+
# containment 는 소비자 트리가 보통 git work tree 가 아니라 **잴 게 없다**. 싣게 하려면
|
|
137
|
+
# 패키지-모드 라우팅을 그 두 단계에 심어야 하는데 그건 소비자에게 값이 없는 코드다.
|
|
138
|
+
# ⓑ 🟥 **철회 — 이 자리에 있던 `test_new_code_anchor_lanes.sh` 항목을 뺐다.** 그 항목이
|
|
139
|
+
# 필요했던 유일한 이유는 `test_prepush_destructive_lanes.sh` 의 한 주석이 그 파일을 경로로
|
|
140
|
+
# 인용했기 때문인데, **그 인용이 이번 라운드에 재조준됐다**(추적되는 선례로). 단독 착지
|
|
141
|
+
# 준비 중 발견 — 안 고쳤으면 **커밋되지 않는 파일을 가리키는 팬텀 참조**를 출하할 뻔했다.
|
|
142
|
+
# 인용이 사라지면 예외도 사라져야 한다. **소비되지 않는 예외는 다음 진짜 누락을 삼킨다.**
|
|
143
|
+
# ⓒ templates/predelete_check.test.sh — 주체 `templates/predelete_check.sh` 는 **출하되는데**
|
|
144
|
+
# 이 앵커는 안 나간다. 🟥 위 test_chamber_run_lanes 와 **같은 모양의 빚**이고, 클린한 답이
|
|
145
|
+
# 아니다. 여기 등재하는 이유도 같다: files[] 추가는 소비자-대면 변경이라 false-FAIL 이
|
|
146
|
+
# 없음을 tarball 모드로 따로 증명해야 하는데, 이 델타는 **배선 델타**다. 카드로 이월.
|
|
147
|
+
"scripts/test_prepush_destructive_liveness.sh"
|
|
148
|
+
# 🟥 ⓒ 는 **철회했다 — cross-family R2 지적이 맞았다.** 초판이
|
|
149
|
+
# `templates/predelete_check.test.sh` 를 여기 넣고 «위 chamber 건과 같은 빚» 이라고 적었는데,
|
|
150
|
+
# 그 둘은 같지 않다: chamber 는 «주체가 출하되는데 앵커가 안 나간다» 를 **빚으로 남긴** 것이고,
|
|
151
|
+
# 여기 등재는 그 빚을 **침묵시킨다**. 이 목록의 뜻은 「출하 안 하는 게 옳다」이지
|
|
152
|
+
# 「출하해야 하는데 아직 안 했다」가 아니다. 후자를 여기 넣으면 **다음 사람이 같은 누락을
|
|
153
|
+
# 만나도 이 예외에 걸려 안 보인다** — 지적 원문: *"A future shipped reference to this same
|
|
154
|
+
# missing anchor will also be accepted, not surfaced."*
|
|
155
|
+
# ⇒ `files[]` 에 실었다. 주체 `templates/predelete_check.sh` 가 이미 출하되므로 소비자는
|
|
156
|
+
# 자기 enumerate 도구를 검증할 수 있게 되고, 부수로 liveness stage ⑥ 의 오탐(주체 부재로
|
|
157
|
+
# ORPHANED)도 닫힌다.
|
|
158
|
+
# ⓓ 🟥 **그리고 ⓑ 의 사유를 쓰자 그 사유가 팬텀을 만들었다.** 위 주석이 주체 이름을
|
|
159
|
+
# 경로로 적는데 **이 파일 자신이 shipped 문서**라, 「안 싣는 이유」를 설명한 행위가
|
|
160
|
+
# 곧 「shipped 문서가 미출하 경로를 가리킴」이 됐다. 계기가 자기 수리를 잡은 것이고,
|
|
161
|
+
# 위 블록이 예고한 형태(*전체 경로를 shipped 파일에 쓰면 팬텀이 된다*)의 **3차 재현**이다.
|
|
162
|
+
# 주체 자신도 같은 사유로 등재한다 — 신규 게이트 둘은 **이 레포 전용**이다(추가 파일을
|
|
163
|
+
# 이 레포 레인 코퍼스에 대고 판정한다). 소비자 트리엔 판정 대상이 없다.
|
|
130
164
|
"scripts/residency_closure_scan.py"
|
|
131
165
|
"scripts/test_residency_closure_lanes.sh"
|
|
166
|
+
# ── caller-zero-ratchet, 2026-08-22. 셋 다 **싣는 것이 틀렸다** — 「아직 안 실었다」가 아니다 ──
|
|
167
|
+
# 이 게이트는 「production 스크립트에 디스패처가 있나」를 **이 레포의 러너 표면**에 대고 판정한다.
|
|
168
|
+
# 그 표면의 하나가 `.github/workflows/**` 이고, **워크플로 디렉터리는 files[] 에 없다.** 그러므로
|
|
169
|
+
# 소비자 트리에서 이 검사기를 돌리면 워크플로에서만 디스패치되는 스크립트들이 전부 caller 0 으로
|
|
170
|
+
# 떨어지고, 그것들은 소비자의 `caller_zero_baseline.txt` 에 선언돼 있지 않으므로 **UNDECLARED →
|
|
171
|
+
# exit 1**. 즉 출하하면 **모든 신선한 설치에서 100% 적색**이다 — CLAUDE.md 가 「모든 새 install 을
|
|
172
|
+
# 막는 게이트는 엄격한 게이트가 아니라 우회 훈련기」라고 못박은 그 형태이고, 바로 위
|
|
173
|
+
# outbound_query_guard 블록과 **같은 사유**다.
|
|
174
|
+
# 앵커도 같이 안 나간다. 주체 부재라는 짝 규칙 말고 **자기 자신의 사유가 하나 더 있다**: 마지막
|
|
175
|
+
# 레인(L27)이 `.github/workflows/caller-zero-ratchet.yml` 을 읽어 워크플로가 리졸버를 인라인으로
|
|
176
|
+
# 되돌리지 않았는지 본다. 그 파일이 없는 트리에서 그 레인은 **부재를 결함으로 읽어 적색**이 된다.
|
|
177
|
+
# 🟥 위 ⓒ 의 교훈은 여기 **해당하지 않는다**: 저건 「주체는 출하되는데 앵커만 빠진」 빚이었고,
|
|
178
|
+
# 여기는 주체·앵커·베이스리졸버가 **셋 다** 소비자에게 판정 대상이 없다. 침묵시키는 게 아니라
|
|
179
|
+
# 애초에 그쪽 트리에 질문이 없다.
|
|
180
|
+
# ⚠️ 명시 잔여: 그래서 이 게이트는 **이 레포에서만** 회귀를 막는다. 소비자 설치본의
|
|
181
|
+
# built-but-not-wired 는 이것으로 안 잡히고, 그걸 잡으려면 러너 표면 목록을 패키지 모드로
|
|
182
|
+
# 라우팅하는 별도 설계가 필요하다 — 안 했다.
|
|
183
|
+
"scripts/script_caller_ratchet.sh"
|
|
184
|
+
"scripts/ratchet_base_resolve.sh"
|
|
185
|
+
"scripts/test_script_caller_ratchet_lanes.sh"
|
|
132
186
|
# ── The two settings destinations, surfaced 2026-08-13 by fixing this file's own extractor ────
|
|
133
187
|
# These were invisible until the `js|json` alternation below was corrected: every `.json`
|
|
134
188
|
# reference in every shipped doc was being truncated to `.js`, a path that exists nowhere, so
|
|
@@ -129,9 +129,56 @@ esac
|
|
|
129
129
|
# 날짜로 degrade(침묵이 아니라 «덜 자주» 쪽).
|
|
130
130
|
_SID_SAFE=$(printf '%s' "${SID:-}" | tr -cd 'A-Za-z0-9_-')
|
|
131
131
|
STAMP="${CLAUDE_PROJECT_DIR:-.}/.claude/.prior_art_prompted_${_SID_SAFE:-$(date +%Y%m%d)}"
|
|
132
|
-
|
|
132
|
+
|
|
133
|
+
# ③-b 🟥 **세션당 1회로는 T2 를 구조적으로 못 잡는다** (실측 2026-08-22, 한 세션 전수 재생).
|
|
134
|
+
# 이 훅의 존재 이유는 이 파일 머리가 적어둔 «T2 = 컨텍스트가 길어진 뒤 **또** 새로 빌드업할 때» 인데,
|
|
135
|
+
# 스탬프가 세션 스코프면 그 «또» 가 영원히 억제된다. 한 세션(08:29~13:33)에서 새 메커니즘 3건이
|
|
136
|
+
# 08:38 · 13:06 · 13:07 에 났고, 세션당 1회는 **첫 건만** 띄웠다 — 억제된 둘이 정확히 T2 다.
|
|
137
|
+
# ⇒ 시간 재무장으로 바꾼다. 마지막 **발화** 시각에서 N초가 지나면 다시 무장한다.
|
|
138
|
+
#
|
|
139
|
+
# 🟥 N 은 임의로 골랐다. 이 값은 데이터가 정한 것이 아니다 — 같은 실측에서 **N=1h·2h·4h 가 전부
|
|
140
|
+
# 같은 결과(2 발화)** 를 냈다. 즉 **데이터가 N 을 판별하지 않았다**, n=1 세션이고, 그 세션의
|
|
141
|
+
# 간극이 4.5시간이라 임계에 둔감했을 뿐이다. §Mechanization Boundary 의 «오늘의 판단을 내일의
|
|
142
|
+
# 천장으로 굳히지 마라» 에 걸리는 자리라, 상수를 박는 대신 **아래 로그를 남겨서 다음 세션들이
|
|
143
|
+
# 실제 분포를 쌓게 한다.** N 재정은 그 로그 위에서만 해라 — 이 주석을 지우지 말고.
|
|
144
|
+
# 왜 «대상 파일당 1회» 가 아닌가: 같은 실측에서 13:06 `mapped_tracks.sh` 와 13:07 그 레인 스위트는
|
|
145
|
+
# **한 메커니즘**이다. 파일당이면 13:07 이 같은 메커니즘을 재질문하는 **오발화**가 된다. 이 파일
|
|
146
|
+
# 머리가 «오발화는 미발화보다 훨씬 비싸다(소음 = 자기무력화 경로)» 라고 못박은 방향과 반대다.
|
|
147
|
+
PRIOR_ART_REARM_SECONDS="${PRIOR_ART_REARM_SECONDS:-7200}" # 2h — 위 단락이 이 값의 출처이자 한계다
|
|
148
|
+
|
|
149
|
+
# 시계는 주입 가능하다 — 픽스처가 4.5시간을 실시간으로 기다릴 수는 없다. 테스트 시임일 뿐이고
|
|
150
|
+
# 억제를 **끄지는** 못한다(값을 넣어도 아래 산술을 그대로 통과해야 한다).
|
|
151
|
+
_NOW="${PRIOR_ART_NOW:-$(date +%s)}"
|
|
152
|
+
case "$_NOW" in ''|*[!0-9]*) _NOW=$(date +%s) ;; esac
|
|
153
|
+
|
|
154
|
+
_LAST=""
|
|
155
|
+
if [ -f "$STAMP" ]; then
|
|
156
|
+
_LAST=$(cat "$STAMP" 2>/dev/null | tr -cd '0-9')
|
|
157
|
+
fi
|
|
158
|
+
|
|
159
|
+
# 로그. 🟥 발화만이 아니라 **억제도** 남긴다 — 「몇 건 억제」만 세면 그것이 옳은 억제였는지 못
|
|
160
|
+
# 가른다. 그래서 무엇을(파일명) · 직전 발화로부터 얼마나(초) 를 같이 적는다.
|
|
161
|
+
# 실패해도 판정은 안 바뀐다(로깅은 게이트가 아니다).
|
|
162
|
+
_PA_LOG="${CLAUDE_PROJECT_DIR:-.}/.claude/.prior_art_events.tsv"
|
|
163
|
+
_pa_log() { # $1=FIRE|SUPPRESS $2=elapsed-or-dash
|
|
164
|
+
mkdir -p "$(dirname "$_PA_LOG")" 2>/dev/null || true
|
|
165
|
+
printf '%s\t%s\t%s\t%s\t%s\n' \
|
|
166
|
+
"$(date -u +%Y-%m-%dT%H:%M:%SZ 2>/dev/null)" "$1" "${_SID_SAFE:-nosid}" "$2" "$FILE" \
|
|
167
|
+
>> "$_PA_LOG" 2>/dev/null || true
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
if [ -n "$_LAST" ]; then
|
|
171
|
+
_ELAPSED=$(( _NOW - _LAST ))
|
|
172
|
+
if [ "$_ELAPSED" -lt "$PRIOR_ART_REARM_SECONDS" ]; then
|
|
173
|
+
_pa_log SUPPRESS "$_ELAPSED"
|
|
174
|
+
exit 0
|
|
175
|
+
fi
|
|
176
|
+
_pa_log FIRE "$_ELAPSED"
|
|
177
|
+
else
|
|
178
|
+
_pa_log FIRE -
|
|
179
|
+
fi
|
|
133
180
|
mkdir -p "$(dirname "$STAMP")" 2>/dev/null || true
|
|
134
|
-
|
|
181
|
+
printf '%s\n' "$_NOW" > "$STAMP" 2>/dev/null || true
|
|
135
182
|
|
|
136
183
|
MSG="🔎 새 메커니즘을 쓰려는 참이다 ($(basename "$FILE")). 짓기 전에 **책장부터, 없으면 도서관** —
|
|
137
184
|
안 했으면 지금 하고, 했으면 이 줄은 무시해라.
|