@chrono-meta/fh-gate 3.15.0 → 3.17.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-plugin/marketplace.json +4 -4
- package/AGENTS.md +27 -0
- package/CATALOG.md +60 -0
- package/CLAUDE.md +5 -0
- package/README.ja.md +2 -2
- package/README.ko.md +2 -2
- package/README.md +2 -2
- package/README.zh.md +2 -2
- package/docs/OUTPUT_EVIDENCE.md +1 -1
- package/docs/codex-compat.md +24 -0
- package/knowledge/shared/harness-core/checkout_layer_drift.md +301 -0
- package/knowledge/shared/learnings/subagent_invocations_log.yaml +66 -0
- package/package.json +13 -1
- 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 +42 -0
- package/plugins/fh-preprep/.claude-plugin/plugin.json +1 -1
- package/plugins/fh-preprep/skills/preprep/SKILL.md +5 -0
- package/plugins/fh-preprep/skills/preprep/lane_font_embed.py +235 -0
- package/plugins/fh-preprep/skills/preprep/ooxml/gate.py +67 -5
- package/plugins/fh-preprep/skills/preprep/ooxml/test_gate_exitcodes.py +136 -0
- package/plugins/fh-preprep/skills/preprep/preprep.py +16 -1
- package/plugins/fh-preprep/skills/preprep/presentation_checklist.md +108 -6
- package/plugins/fh-preprep/skills/preprep/safe_install.py +22 -3
- package/plugins/fh-preprep/skills/preprep/surfaces.example.yaml +11 -0
- package/plugins/fh-preprep/skills/preprep/test_lane_font_embed.py +117 -0
- package/plugins/fh-preprep/skills/preprep/test_safe_install_app_xml.py +77 -0
- package/plugins/fh-qp/.claude-plugin/plugin.json +1 -1
- package/scripts/count_check.sh +46 -14
- package/scripts/daily_report.sh +17 -1
- package/scripts/env_layer_fingerprint.sh +309 -0
- package/scripts/gate_bootstrap_ephemeral.sh +248 -0
- package/scripts/governor_board.sh +841 -0
- package/scripts/map_postprocess.py +89 -4
- package/scripts/multibyte_bracket_lint.sh +135 -0
- package/scripts/outbound_pr_gate.sh +12 -0
- package/scripts/package_coverage_check.sh +34 -0
- package/scripts/selfcheck.sh +263 -0
- package/scripts/session_close_check.sh +96 -1
- package/scripts/stale_ref_scan.py +511 -0
- package/scripts/test_count_check_decl_lanes.sh +176 -0
- package/scripts/test_env_layer_fingerprint_lanes.sh +192 -0
- package/scripts/test_gate_bootstrap_ephemeral_lanes.sh +262 -0
- package/scripts/test_locale_invariance_lanes.sh +581 -0
- package/scripts/test_map_postprocess_lanes.sh +84 -4
- package/scripts/test_marker_crossfamily_lanes.sh +5 -1
- package/scripts/test_marker_defense_lanes.sh +5 -1
- package/scripts/test_marker_standpoint_lanes.sh +5 -1
- package/scripts/test_marker_thirdparty_lanes.sh +5 -1
- package/scripts/test_multibyte_bracket_lint_lanes.sh +107 -0
- package/scripts/test_outbound_pr_gate_lanes.sh +133 -0
- package/scripts/test_preprep_drift_anchor.sh +34 -9
- package/scripts/test_preprep_drift_anchor_lanes.sh +64 -2
- package/scripts/test_session_close_chain_lanes.sh +45 -0
- package/scripts/test_stale_ref_close_lanes.sh +197 -0
- package/scripts/test_stale_ref_scan_lanes.sh +134 -0
- package/scripts/test_worktree_reclaim_lanes.sh +267 -1
- package/scripts/worktree_reclaim.sh +246 -11
- package/templates/.git-hooks/pre-commit +108 -27
- package/templates/settings.PreToolUse.snippet.json +54 -1
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
# test_map_postprocess_lanes.sh — scripts/map_postprocess.py 의
|
|
2
|
+
# test_map_postprocess_lanes.sh — scripts/map_postprocess.py 의 세 계약을 고정한다.
|
|
3
3
|
#
|
|
4
4
|
# WHY: 이 후처리는 발행되는 지도 HTML 의 «폭 하한»을 바꾸고 SVG 를 다시 만든다. 둘 다 조용히
|
|
5
5
|
# 실패하면 사람이 못 본다 — 패치가 안 붙어도 페이지는 뜨고(옛 폭), SVG 가 어긋나도 열리기는 한다.
|
|
6
6
|
# 그래서 ⓐ 리터럴 부재 = 드리프트 = 하드 정지(3), ⓑ SVG 는 «커밋된 두 장 바이트 동일 재현»을
|
|
7
7
|
# known-pair 로 잡는다. 컨트롤: 패치 문자열이 실제로 상수와 다르고 뷰포트를 참조하는가.
|
|
8
8
|
#
|
|
9
|
+
# ⓒ **깜빡임 억제 계약**(L10~L15 — L13b 포함 7 레인, 2026-09-21): 첫 페인트 전 테마 해소와 «게이트 없이 뛰는
|
|
10
|
+
# 펄스 없음» 둘이 재생성본에 아직 있나. 이 둘은 라이트 모드에서 **첫 프레임**에만 보이는 것이라
|
|
11
|
+
# 빠지면 아무 검사도 안 빨개지고, 다음에 사람이 눈을 댈 때까지 아무도 모른다.
|
|
12
|
+
# 🟥 레인은 «기록의 형태»만 잰다 — 실제로 안 깜빡이는지는 사람이 실물로 본다.
|
|
13
|
+
#
|
|
9
14
|
# 종료코드: 0 pass · 1 레인 실패 · 2 대상 부재 · 10 setup 실패
|
|
10
15
|
set -uo pipefail
|
|
11
16
|
cd "$(dirname "$0")/.." || exit 10
|
|
@@ -20,11 +25,25 @@ command -v python3 >/dev/null 2>&1 || { echo "ⓘ python3 absent — setup broke
|
|
|
20
25
|
TMP=$(mktemp -d) || exit 10
|
|
21
26
|
trap 'rm -rf "$TMP"' EXIT
|
|
22
27
|
|
|
23
|
-
|
|
28
|
+
# $1=out path · $2=reader-width literal(비어도 됨) · $3=두 번째 <style> 여부
|
|
29
|
+
# $4=깜빡임 계약 변형(기본 = 준수). 준수형을 기본값으로 둔 것이 L1·L2·L6·L8 의 known-positive 다.
|
|
30
|
+
mkfix() {
|
|
31
|
+
THEME_SCRIPT='<script>document.documentElement.setAttribute("data-theme", theme);</script>'
|
|
32
|
+
PULSE='.pulse-dot{animation: none;} html[data-motion-capable="true"] .pulse-dot{animation: pulse 2s infinite;}'
|
|
33
|
+
HTMLTAG='<html data-theme="dark">'
|
|
34
|
+
HEAD_PRE="$THEME_SCRIPT"; BODY_PRE=''
|
|
35
|
+
case "${4:-}" in
|
|
36
|
+
late-theme) HEAD_PRE=''; BODY_PRE="$THEME_SCRIPT" ;; # <body> 가 시작된 뒤에야 해소
|
|
37
|
+
no-theme-apply) HEAD_PRE='' ;;
|
|
38
|
+
ungated-pulse) PULSE='.pulse-dot{animation: pulse 2s infinite;}' ;;
|
|
39
|
+
renamed-gate) PULSE='.pulse-dot{animation: none;} html[data-motion-ready="true"] .pulse-dot{animation: pulse 2s infinite;}' ;;
|
|
40
|
+
mixed-list) PULSE='html[data-motion-capable="true"] .pulse-dot, .pulse-dot{animation: pulse 2s infinite;}' ;;
|
|
41
|
+
no-contract) HTMLTAG='<html>'; HEAD_PRE=''; PULSE='.c{color:green}' ;;
|
|
42
|
+
esac
|
|
24
43
|
{
|
|
25
|
-
printf '<
|
|
44
|
+
printf '%s<head>%s<style>.a{color:red} %s</style>' "$HTMLTAG" "$HEAD_PRE" "$PULSE"
|
|
26
45
|
[ -n "${3:-}" ] && printf '<style>.b{color:blue}</style>'
|
|
27
|
-
printf '</head><body
|
|
46
|
+
printf '</head><body>%s' "$BODY_PRE"
|
|
28
47
|
printf '<svg viewBox="0 0 10 10"><rect/></svg>'
|
|
29
48
|
printf '<script>%s</script></body></html>' "$2"
|
|
30
49
|
} > "$1"
|
|
@@ -138,6 +157,67 @@ else
|
|
|
138
157
|
ng "L9 a shipped map html is unpatched — re-run: python3 $S docs/map/*.html"
|
|
139
158
|
fi
|
|
140
159
|
|
|
160
|
+
# ── L10~L13 되돌림 프로브: 깜빡임 억제를 한 조각씩 빼면 rc=3 이고 아무것도 안 쓴다
|
|
161
|
+
# (L1 이 같은 픽스처의 «준수형»으로 초록이므로, 이 넷은 계약이 하중을 진다는 증거다)
|
|
162
|
+
probe_drift() { # $1=레인 이름 · $2=변형 키 · $3=한 줄 설명
|
|
163
|
+
mkfix "$TMP/$2.html" 'var MIN_READER_WIDTH = 960;' '' "$2"
|
|
164
|
+
B=$(shasum "$TMP/$2.html" | awk '{print $1}')
|
|
165
|
+
python3 "$S" "$TMP/$2.html" >"$TMP/o_$2" 2>&1; RC=$?
|
|
166
|
+
A=$(shasum "$TMP/$2.html" | awk '{print $1}')
|
|
167
|
+
if [ $RC -eq 3 ] && [ "$B" = "$A" ] && [ ! -f "$TMP/$2.svg" ]; then
|
|
168
|
+
ok "$1 $3 -> rc=3, file untouched, no svg"
|
|
169
|
+
else
|
|
170
|
+
ng "$1 $3 not caught (rc=$RC, sha changed=$([ "$B" = "$A" ] && echo no || echo yes))"
|
|
171
|
+
fi
|
|
172
|
+
}
|
|
173
|
+
probe_drift L10 late-theme "theme resolved only after <body> starts"
|
|
174
|
+
probe_drift L11 no-theme-apply "<html data-theme> declared but never applied"
|
|
175
|
+
probe_drift L12 ungated-pulse "pulse runs with no data-motion-capable gate"
|
|
176
|
+
probe_drift L13 renamed-gate "gate attribute renamed - pulse runs ungated"
|
|
177
|
+
# L13b 는 내가 초판에서 실제로 열어 둔 구멍이다 — 한 셀렉터 목록 안에 게이트 있는 조각과
|
|
178
|
+
# 없는 조각이 같이 있으면, «첫 조각만 보는» 판독은 통과시킨다. 조각을 전부 본다.
|
|
179
|
+
probe_drift L13b mixed-list "one selector list mixes a gated and a bare .pulse-dot"
|
|
180
|
+
|
|
181
|
+
# ── L14 과차단 금지: 계약 대상이 아예 없는 문서(테마 선언 없음 · 점 없음)는 통과한다
|
|
182
|
+
# 없는 것을 요구하면 다른 archify 다이어그램 종류를 막고, 과차단은 override 를 훈련시킨다
|
|
183
|
+
mkfix "$TMP/nc.html" 'var MIN_READER_WIDTH = 960;' '' no-contract
|
|
184
|
+
python3 "$S" "$TMP/nc.html" >"$TMP/o14" 2>&1; RC=$?
|
|
185
|
+
if [ $RC -eq 0 ] && [ -f "$TMP/nc.svg" ]; then
|
|
186
|
+
ok "L14 no theme declaration and no pulse rule -> contract N/A, passes (no over-block)"
|
|
187
|
+
else
|
|
188
|
+
ng "L14 over-blocked a document with nothing to suppress (rc=$RC)"
|
|
189
|
+
fi
|
|
190
|
+
|
|
191
|
+
# ── L15 실물 되돌림: 픽스처가 아니라 **발행되는 지도 한 장**에서 한 줄을 빼도 빨개지는가
|
|
192
|
+
# (픽스처만으로는 «내가 만든 모양만 잰다» 를 못 벗어난다 — 계기≠대상)
|
|
193
|
+
REAL=docs/map/fh_process.workflow.html
|
|
194
|
+
if [ ! -f "$REAL" ]; then
|
|
195
|
+
ng "L15 $REAL absent - nothing measured (NOT a pass)"
|
|
196
|
+
else
|
|
197
|
+
python3 - "$REAL" "$TMP/real_cut.html" <<'REALCUT'
|
|
198
|
+
import sys
|
|
199
|
+
s = open(sys.argv[1], encoding='utf-8').read()
|
|
200
|
+
cut = s.replace("document.documentElement.setAttribute('data-theme', theme);", '', 1)
|
|
201
|
+
if cut == s:
|
|
202
|
+
sys.exit(9) # 리터럴이 없다 = 잘라낼 것이 없다 = 계기 고장
|
|
203
|
+
open(sys.argv[2], 'w', encoding='utf-8').write(cut)
|
|
204
|
+
REALCUT
|
|
205
|
+
SETUP=$?
|
|
206
|
+
if [ $SETUP -eq 0 ]; then
|
|
207
|
+
python3 "$S" --check "$TMP/real_cut.html" >"$TMP/o15" 2>&1; RC=$?
|
|
208
|
+
python3 "$S" --check "$REAL" >"$TMP/o15c" 2>&1; RCC=$?
|
|
209
|
+
if [ $RC -eq 3 ] && [ $RCC -eq 0 ]; then
|
|
210
|
+
ok "L15 real shipped map: pre-paint theme line removed -> rc=3 (control: intact -> rc=0)"
|
|
211
|
+
else
|
|
212
|
+
ng "L15 real shipped map: cut=$RC (expected 3), control=$RCC (expected 0)"
|
|
213
|
+
fi
|
|
214
|
+
elif [ $SETUP -eq 9 ]; then
|
|
215
|
+
ng "L15 the pre-paint theme line is already gone from $REAL - instrument had nothing to cut"
|
|
216
|
+
else
|
|
217
|
+
ng "L15 setup failed while mutating $REAL (rc=$SETUP)"
|
|
218
|
+
fi
|
|
219
|
+
fi
|
|
220
|
+
|
|
141
221
|
echo "── map_postprocess lanes: PASS=$PASS FAIL=$FAIL"
|
|
142
222
|
[ "$FAIL" -eq 0 ] || exit 1
|
|
143
223
|
exit 0
|
|
@@ -30,7 +30,11 @@ REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
|
30
30
|
HOOK="$REPO_ROOT/templates/.git-hooks/pre-commit"
|
|
31
31
|
T=$(mktemp -d); trap 'rm -rf "$T"' EXIT
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
# 🟥 레그가 `_charlen` 을 쓴다 — **의존 함수를 같이 뽑지 않으면 «command not found» 로
|
|
34
|
+
# 조용히 다른 판정이 난다**(2026-09-21 실측: 이 스위트 넷이 그렇게 빨개졌다).
|
|
35
|
+
# 레인은 훅의 일부만 소싱하므로, 뽑는 쪽이 의존성을 같이 져야 한다.
|
|
36
|
+
sed -n '/^_charlen()/,/^}/p' "$HOOK" > "$T/fn.sh"
|
|
37
|
+
sed -n '/^validate_crossfamily_leg()/,/^}/p' "$HOOK" >> "$T/fn.sh"
|
|
34
38
|
|
|
35
39
|
# Instrument calibration: an empty extraction would let every fixture "pass" against
|
|
36
40
|
# nothing. Assert the function body actually arrived before measuring anything.
|
|
@@ -21,7 +21,11 @@ REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
|
21
21
|
HOOK="$REPO_ROOT/templates/.git-hooks/pre-commit"
|
|
22
22
|
T=$(mktemp -d); trap 'rm -rf "$T"' EXIT
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
# 🟥 레그가 `_charlen` 을 쓴다 — **의존 함수를 같이 뽑지 않으면 «command not found» 로
|
|
25
|
+
# 조용히 다른 판정이 난다**(2026-09-21 실측: 이 스위트 넷이 그렇게 빨개졌다).
|
|
26
|
+
# 레인은 훅의 일부만 소싱하므로, 뽑는 쪽이 의존성을 같이 져야 한다.
|
|
27
|
+
sed -n '/^_charlen()/,/^}/p' "$HOOK" > "$T/fn.sh"
|
|
28
|
+
sed -n '/^validate_defense_leg()/,/^}/p' "$HOOK" >> "$T/fn.sh"
|
|
25
29
|
|
|
26
30
|
# Instrument calibration BEFORE any fixture runs. An empty extraction would let every BLOCK
|
|
27
31
|
# fixture "pass" against nothing and every PASS fixture fail — and the suite would still print a
|
|
@@ -33,7 +33,11 @@ REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
|
33
33
|
HOOK="$REPO_ROOT/templates/.git-hooks/pre-commit"
|
|
34
34
|
T=$(mktemp -d); trap 'rm -rf "$T"' EXIT
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
# 🟥 레그가 `_charlen` 을 쓴다 — **의존 함수를 같이 뽑지 않으면 «command not found» 로
|
|
37
|
+
# 조용히 다른 판정이 난다**(2026-09-21 실측: 이 스위트 넷이 그렇게 빨개졌다).
|
|
38
|
+
# 레인은 훅의 일부만 소싱하므로, 뽑는 쪽이 의존성을 같이 져야 한다.
|
|
39
|
+
sed -n '/^_charlen()/,/^}/p' "$HOOK" > "$T/fn.sh"
|
|
40
|
+
sed -n '/^validate_standpoint_leg()/,/^}/p' "$HOOK" >> "$T/fn.sh"
|
|
37
41
|
|
|
38
42
|
# Instrument calibration — an empty extraction would let every fixture "pass" against nothing.
|
|
39
43
|
if ! grep -q 'DEGRADED_NO_TARGET_ACCESS' "$T/fn.sh"; then
|
|
@@ -29,7 +29,11 @@ set -uo pipefail
|
|
|
29
29
|
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
30
30
|
HOOK="$REPO_ROOT/templates/.git-hooks/pre-commit"
|
|
31
31
|
T=$(mktemp -d); trap 'rm -rf "$T"' EXIT
|
|
32
|
-
|
|
32
|
+
# 🟥 레그가 `_charlen` 을 쓴다 — **의존 함수를 같이 뽑지 않으면 «command not found» 로
|
|
33
|
+
# 조용히 다른 판정이 난다**(2026-09-21 실측: 이 스위트 넷이 그렇게 빨개졌다).
|
|
34
|
+
# 레인은 훅의 일부만 소싱하므로, 뽑는 쪽이 의존성을 같이 져야 한다.
|
|
35
|
+
sed -n '/^_charlen()/,/^}/p' "$HOOK" > "$T/fn.sh"
|
|
36
|
+
sed -n '/^validate_thirdparty_leg()/,/^}/p' "$HOOK" >> "$T/fn.sh"
|
|
33
37
|
if ! grep -q 'DEGRADED_NO_ACCESS' "$T/fn.sh"; then
|
|
34
38
|
echo "❌ HARNESS-ERROR — validate_thirdparty_leg did not extract from $HOOK."
|
|
35
39
|
echo " Fixtures below would measure an empty function. Aborting rather than reporting green."
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# test_multibyte_bracket_lint_lanes.sh — scripts/multibyte_bracket_lint.sh 의 앵커.
|
|
3
|
+
#
|
|
4
|
+
# 🟥 왜 린트의 «내장 자가검정» 으로 충분하지 않은가. `_calibrate` 의 known pair 는 **린트 파일
|
|
5
|
+
# 안에** 산다 — 정규식이 약해져도 자기 픽스처는 계속 통과할 수 있고, 실제로 이 결함 클래스를
|
|
6
|
+
# 전수 열거하려던 첫 계기가 정확히 그렇게 **11 중 1 을 놓쳤다**(`[:alnum:]` 의 첫 `]` 에서
|
|
7
|
+
# 끊겨서). 그래서 이 스위트는 **실물 훅의 사본을 되돌려** 잡히는지를 본다 — 내장 자가검정이
|
|
8
|
+
# 구조적으로 못 하는 팔이다.
|
|
9
|
+
#
|
|
10
|
+
# 🟥 트래킹 파일은 절대 안 건드린다. 모든 변이는 $T 안의 사본에서 일어난다.
|
|
11
|
+
#
|
|
12
|
+
# Usage: bash scripts/test_multibyte_bracket_lint_lanes.sh
|
|
13
|
+
# Exit: 0 = 전부 통과 · 1 = 회귀 · 2 = 계기 오류
|
|
14
|
+
set -uo pipefail
|
|
15
|
+
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
16
|
+
LINT="$REPO_ROOT/scripts/multibyte_bracket_lint.sh"
|
|
17
|
+
HOOK="$REPO_ROOT/templates/.git-hooks/pre-commit"
|
|
18
|
+
T=$(mktemp -d) || exit 2; trap 'rm -rf "$T"' EXIT
|
|
19
|
+
FAIL=0
|
|
20
|
+
_t(){ printf ' %-58s' "$1"; }
|
|
21
|
+
_ok(){ echo "ok"; }
|
|
22
|
+
_no(){ echo "FAIL — $1"; FAIL=1; }
|
|
23
|
+
|
|
24
|
+
echo "── multibyte-bracket lint lanes ──"
|
|
25
|
+
[ -r "$LINT" ] || { echo "❌ HARNESS-ERROR — 린트를 못 읽는다: $LINT"; echo " 🟥 부재는 통과가 아니다."; exit 2; }
|
|
26
|
+
[ -r "$HOOK" ] || { echo "❌ HARNESS-ERROR — 훅을 못 읽는다: $HOOK"; echo " 🟥 부재는 통과가 아니다."; exit 2; }
|
|
27
|
+
|
|
28
|
+
_rc(){ bash "$LINT" "$@" >/dev/null 2>&1; echo $?; }
|
|
29
|
+
|
|
30
|
+
_t "L0 내장 자가검정이 살아 있다 (--selftest)"
|
|
31
|
+
[ "$(bash "$LINT" --selftest >/dev/null 2>&1; echo $?)" = "0" ] && _ok \
|
|
32
|
+
|| _no "린트가 자기 known-pair 를 분리 못 한다 — 아래 팔들의 값이 의미 없다"
|
|
33
|
+
|
|
34
|
+
# ── L1/L2 — 실물 훅의 사본. 내장 자가검정이 구조적으로 못 가지는 팔 ──────────────
|
|
35
|
+
cp "$HOOK" "$T/clean" || exit 2
|
|
36
|
+
_NEW='"[^"]{2,}"|“.{2,}”'
|
|
37
|
+
_OLD='"[^"]{2,}"|“[^”]{2,}”'
|
|
38
|
+
_LR_F="$_NEW" _LR_R="$_OLD" awk '
|
|
39
|
+
BEGIN { f = ENVIRON["_LR_F"]; r = ENVIRON["_LR_R"] }
|
|
40
|
+
{ while ((p = index($0, f)) > 0) $0 = substr($0, 1, p-1) r substr($0, p+length(f)); print }
|
|
41
|
+
' "$T/clean" > "$T/reverted"
|
|
42
|
+
|
|
43
|
+
_t "L1 되돌린 실물 훅 사본에서 그 자리를 잡는다"
|
|
44
|
+
if ! grep -q '“\[\^”\]{2,}”' "$T/reverted"; then
|
|
45
|
+
_no "되돌림 변이가 안 먹었다 — 훅의 가드 형태가 바뀌었다(계기 확인 불가)"
|
|
46
|
+
elif [ "$(_rc "$T/reverted")" = "1" ]; then _ok
|
|
47
|
+
else _no "되돌렸는데 rc=$(_rc "$T/reverted") (1 이어야) — 린트가 실물 결함을 못 잡는다"; fi
|
|
48
|
+
|
|
49
|
+
_t "L2 컨트롤 — 손 안 댄 같은 사본은 깨끗하다"
|
|
50
|
+
[ "$(_rc "$T/clean")" = "0" ] && _ok \
|
|
51
|
+
|| _no "rc=$(_rc "$T/clean") — 지금의 훅에서 오탐이 난다(L1 의 원인이 되돌림이 아니다)"
|
|
52
|
+
|
|
53
|
+
# ── L3 — 11 중 1 을 놓치게 만든 바로 그 형태. 회귀 자물쇠 ──────────────────────
|
|
54
|
+
printf '%s\n' 'b=$(printf %s "$l" | sed -E "s/^[[:space:]]*(①영혼|soul)[^[:alnum:]«]*//")' > "$T/posixclass"
|
|
55
|
+
_t 'L3 POSIX 클래스가 든 브래킷도 잡는다 — [^[:alnum:]«] 형태'
|
|
56
|
+
[ "$(_rc "$T/posixclass")" = "1" ] && _ok \
|
|
57
|
+
|| _no "rc=$(_rc "$T/posixclass") (1 이어야) — 정규식이 `[:alnum:]` 의 첫 `]` 에서 끊겼다. 이게 11 중 1 을 놓친 형태다"
|
|
58
|
+
|
|
59
|
+
# ── L4 — 오탐 픽스처. 「무엇이든 잡는」 린트는 린트가 아니다 ────────────────────
|
|
60
|
+
{
|
|
61
|
+
printf '%s\n' '# 주석 안의 [^—-] 와 [^”] 는 코드가 아니다'
|
|
62
|
+
printf '%s\n' 'x=$(printf %s "$l" | sed -E "s/^(:|—|-)*//")'
|
|
63
|
+
printf '%s\n' 'y=$(printf %s "$l" | grep -oE "[A-Za-z0-9_]+")'
|
|
64
|
+
printf '%s\n' 'z=$(printf %s "$l" | sed -E "s/[[:space:]]+$//")'
|
|
65
|
+
printf '%s\n' 'w="멀티바이트가 브래킷 밖에 있는 것은 — 해당 없다"'
|
|
66
|
+
} > "$T/fp"
|
|
67
|
+
_t "L4 오탐 픽스처 — 주석·교차·순ASCII·브래킷 밖 멀티바이트"
|
|
68
|
+
[ "$(_rc "$T/fp")" = "0" ] && _ok \
|
|
69
|
+
|| _no "rc=$(_rc "$T/fp") (0 이어야) — 정당한 형태에서 빨개진다. 과차단은 override 를 훈련시킨다"
|
|
70
|
+
|
|
71
|
+
_t "L4b 컨트롤 — 같은 파일에 결함 한 줄을 더하면 빨개진다"
|
|
72
|
+
cp "$T/fp" "$T/fp_plus"; printf '%s\n' 'v=$(printf %s "$l" | sed -E "s/^[^:—-]*[:—-]//")' >> "$T/fp_plus"
|
|
73
|
+
[ "$(_rc "$T/fp_plus")" = "1" ] && _ok \
|
|
74
|
+
|| _no "rc=$(_rc "$T/fp_plus") (1 이어야) — L4 의 초록이 «못 잡아서» 일 수 있다(분리능 없음)"
|
|
75
|
+
|
|
76
|
+
# ── L5 — degrade 방향. 못 읽는 것은 통과가 아니다 ───────────────────────────────
|
|
77
|
+
_t "L5 없는 경로는 rc=2 (계기 오류지 통과가 아니다)"
|
|
78
|
+
[ "$(_rc "$T/does-not-exist.sh")" = "2" ] && _ok \
|
|
79
|
+
|| _no "rc=$(_rc "$T/does-not-exist.sh") (2 여야) — 부재가 초록으로 읽힌다"
|
|
80
|
+
|
|
81
|
+
# ── L6 — 실물 데이터로 주석 건너뛰기가 실제로 실행되는지 ────────────────────────
|
|
82
|
+
# 🟥 2026-09-22 — 이 계수기가 **플랫폼마다 다른 것을 쟀고, CI 는 «틀린 이유로» 초록이었다.**
|
|
83
|
+
# 옛 패턴은 브래킷 안에 `[^\x00-\x7F]` 를 썼다. POSIX 브래킷은 `\xNN` 을 «이스케이프» 로
|
|
84
|
+
# 안 읽는다 — BSD grep(macOS)은 `invalid character range` 로 **죽고**(rc=2), GNU grep 은
|
|
85
|
+
# 그것을 리터럴 `\`·`x`·`0`-`7`·`F` 로 읽어 **유효한 범위**로 받아 넘어간다.
|
|
86
|
+
# ⇒ 같은 레인이 macOS 에서는 계기 오류, CI 에서는 «다른 질문» 에 답하고 있었다.
|
|
87
|
+
# 🟥 **더 나쁜 것은 `|| echo 0` 이었다** — 계기가 죽은 것(rc=2)을 «0줄» 이라는 **측정값**으로
|
|
88
|
+
# 접었다. 「안 쟀다」가 「0 이었다」로 렌더되는 오늘의 그 일가다. 이제 rc 를 먼저 잡고
|
|
89
|
+
# 2 이상이면 **HARNESS-ERROR 로 이름을 붙인다.**
|
|
90
|
+
# 이식성 있는 형태: `LC_ALL=C` 에서 `[^ -~]` = ASCII 인쇄 가능 범위의 여집합.
|
|
91
|
+
# 실측으로 파이썬 기준값(10)과 **정확히 일치**하고, 탭 오탐은 0 이다.
|
|
92
|
+
_ncmt=$(LC_ALL=C grep -c '^[[:space:]]*#.*\[[^]]*[^ -~][^]]*\]' "$HOOK" 2>/dev/null); _ncmt_rc=$?
|
|
93
|
+
_t "L6 실물 훅의 주석에 그 형태가 실재하고, 그런데도 깨끗하다"
|
|
94
|
+
if [ "$_ncmt_rc" -ge 2 ]; then
|
|
95
|
+
_no "계수기 자신이 rc=$_ncmt_rc 로 죽었다 — HARNESS-ERROR. «0줄» 로 접지 않는다"
|
|
96
|
+
elif [ "${_ncmt:-0}" -ge 1 ] && [ "$(_rc "$HOOK")" = "0" ]; then _ok
|
|
97
|
+
elif [ "${_ncmt:-0}" -lt 1 ]; then _no "훅 주석에 브래킷+멀티바이트가 0줄 — 이 팔은 아무것도 안 잰다(UNMEASURED)"
|
|
98
|
+
else _no "주석 $_ncmt 줄이 있는데 rc=$(_rc "$HOOK") — 주석 건너뛰기가 안 돈다"; fi
|
|
99
|
+
|
|
100
|
+
# ── L6b — 계수기가 «이 플랫폼에서» 실제로 도는가. L6 의 컨트롤이다 ─────────────
|
|
101
|
+
# L6 이 초록이어도 그것이 «세었다» 인지 «못 셌는데 접혔다» 인지 구분되지 않던 자리를 못박는다.
|
|
102
|
+
_t "L6b 계수기가 이 플랫폼에서 실행 가능하다(rc<2) — 옛 \\xNN 형태였다면 여기서 적색"
|
|
103
|
+
[ "$_ncmt_rc" -lt 2 ] && _ok \
|
|
104
|
+
|| _no "rc=$_ncmt_rc — 브래킷 패턴이 이 grep 에서 안 돈다. 이식성 결함이지 «0줄» 이 아니다"
|
|
105
|
+
|
|
106
|
+
echo "── $([ "$FAIL" -eq 0 ] && echo 'all lanes ok' || echo 'FAILURES above') ──"
|
|
107
|
+
exit "$FAIL"
|
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
# templates/.git-hooks/pre-commit and fails if the gate classifies neither strong nor weak — so a
|
|
9
9
|
# new enum member cannot be added without deciding what it means on the outbound surface.
|
|
10
10
|
# L9 is the REVERT probe: neuter the strong-rung allow-list and L1 must go red.
|
|
11
|
+
# L6b/L6c cover the COLD START (zero record FILES — rec() always writes one, so L6 is the
|
|
12
|
+
# empty-record branch, a different path) and anchor its skeleton with a second revert probe.
|
|
13
|
+
# L17/L17b are the WIRING arms: the snippet must register this hook, and the gate must finish
|
|
14
|
+
# inside the timeout the snippet configures — a hook killed by its own timeout is fail-OPEN.
|
|
11
15
|
set -uo pipefail
|
|
12
16
|
HERE="$(cd "$(dirname "$0")" && pwd)"
|
|
13
17
|
REPO="$(cd "$HERE/.." && pwd)"
|
|
@@ -42,6 +46,11 @@ rec() { # $1 = standpoint value, $2 = generated-path, $3 = fixture-carries (""
|
|
|
42
46
|
[ -n "${3:-}" ] && printf 'fixture-carries: %s\n' "$3" >> "$f"
|
|
43
47
|
return 0
|
|
44
48
|
}
|
|
49
|
+
norec() { # zero record FILES. rec() always CREATES the file, so rec "" "" "" is an EMPTY
|
|
50
|
+
# record, not an absent one — a different branch of the gate.
|
|
51
|
+
rm -f "$FHROOT/tracks/_meta"/outbound_pr_*.md
|
|
52
|
+
return 0
|
|
53
|
+
}
|
|
45
54
|
FULL_SP='tier2(archify) — ran `node scripts/export.mjs` there, output: wrote 3 files, input intact'
|
|
46
55
|
FULL_GP='none-found(grepped package.json scripts and every *.mjs for a writer of that path)'
|
|
47
56
|
FULL_AR='asserted(`node t.mjs` with dest symlinked to the input, output: input bytes unchanged)'
|
|
@@ -88,6 +97,53 @@ run "L5b gh pr merge is not create" silent "gh pr merge 12 --squash"
|
|
|
88
97
|
rec "" "" ""
|
|
89
98
|
run "L6 non-owned + no record at all" deny "gh pr create -R tt-a1i/archify --title x"
|
|
90
99
|
|
|
100
|
+
# ── L6b COLD START: zero record FILES, which L6 above does NOT cover ───────────────────────
|
|
101
|
+
# rec "" "" "" writes an EMPTY file, so L6 exercises the per-field "line absent" branches. The
|
|
102
|
+
# _records=0 branch had NO lane at all, and it was the one a first-time session actually hits:
|
|
103
|
+
# it printed a path and nothing else, because the three field syntaxes live in the per-field
|
|
104
|
+
# branches that are unreachable when there is no file. Assert the skeleton by FIELD NAME.
|
|
105
|
+
norec
|
|
106
|
+
run "L6b zero record files (not an empty one)" deny "gh pr create -R tt-a1i/archify --title x"
|
|
107
|
+
_cold_out() { # $1 = gate to run
|
|
108
|
+
norec
|
|
109
|
+
printf '{"tool_name":"Bash","tool_input":{"command":"gh pr create -R tt-a1i/archify --title x"}}' \
|
|
110
|
+
| CLAUDE_PROJECT_DIR="$FHROOT" FH_OUTBOUND_TODAY="$TODAY" \
|
|
111
|
+
FH_OUTBOUND_RECDIR="$FHROOT/tracks/_meta" bash "$1" 2>&1
|
|
112
|
+
}
|
|
113
|
+
_COLD=$(_cold_out "$GATE")
|
|
114
|
+
for _f in standpoint generated-path fixture-carries; do
|
|
115
|
+
n=$((n+1))
|
|
116
|
+
if printf '%s' "$_COLD" | grep -q "^ *$_f:"; then
|
|
117
|
+
echo "PASS L6b cold start names the field '$_f'"
|
|
118
|
+
else
|
|
119
|
+
echo "FAIL L6b cold start does NOT name '$_f' — a first-time session gets a path and nothing else"
|
|
120
|
+
fail=1
|
|
121
|
+
fi
|
|
122
|
+
done
|
|
123
|
+
|
|
124
|
+
# ── L6c REVERT PROBE for L6b: strip the skeleton; the three field names must disappear ───────
|
|
125
|
+
# Without this, L6b would also pass on output that names the fields for some OTHER reason.
|
|
126
|
+
n=$((n+1))
|
|
127
|
+
COLDMUT="$TMP/coldmutant.sh"
|
|
128
|
+
sed -E '/^ (standpoint|generated-path|fixture-carries): /d' "$GATE" > "$COLDMUT"
|
|
129
|
+
_removed=$(( $(grep -cE '^ (standpoint|generated-path|fixture-carries): ' "$GATE") \
|
|
130
|
+
- $(grep -cE '^ (standpoint|generated-path|fixture-carries): ' "$COLDMUT") ))
|
|
131
|
+
if [ "$_removed" -ne 3 ]; then
|
|
132
|
+
echo "FAIL L6c INSTRUMENT ERROR — mutation removed $_removed skeleton lines, expected 3; the probe would pass vacuously"
|
|
133
|
+
fail=1
|
|
134
|
+
elif ! bash -n "$COLDMUT" 2>/dev/null; then
|
|
135
|
+
echo "FAIL L6c INSTRUMENT ERROR — the mutant does not parse, so its silence means nothing"
|
|
136
|
+
fail=1
|
|
137
|
+
else
|
|
138
|
+
_hits=$(_cold_out "$COLDMUT" | grep -cE "^ *(standpoint|generated-path|fixture-carries):" || true)
|
|
139
|
+
if [ "$_hits" -eq 0 ]; then
|
|
140
|
+
echo "PASS L6c revert probe: stripping the skeleton takes all three field names off the cold-start deny"
|
|
141
|
+
else
|
|
142
|
+
echo "FAIL L6c revert probe: $_hits field name(s) survived the strip — L6b is not anchored to the skeleton"
|
|
143
|
+
fail=1
|
|
144
|
+
fi
|
|
145
|
+
fi
|
|
146
|
+
|
|
91
147
|
# ── L7 vacuous grounds ────────────────────────────────────────────────────────────────────────
|
|
92
148
|
rec "$FULL_SP" 'none-found()' "$FULL_AR"
|
|
93
149
|
run "L7 generated-path with empty grounds" deny "gh pr create -R tt-a1i/archify --title x"
|
|
@@ -210,5 +266,82 @@ run "L16 gh pr edit 는 여전히 NAMED GAP" silent "gh pr edit --body x -R tt-a
|
|
|
210
266
|
rec "$FULL_SP" "$FULL_GP" "$FULL_AR"
|
|
211
267
|
run "L16b gh pr list 는 트리거 아님" silent "gh pr list -R tt-a1i/archify"
|
|
212
268
|
|
|
269
|
+
# ── L17 WIRING: does the shipped snippet actually register this hook? ────────────────────
|
|
270
|
+
# Shipping (package.json files[]) and WIRING (a settings snippet) are different propositions —
|
|
271
|
+
# v3.13.0 shipped this script and registered it nowhere, and nothing anywhere went red for it.
|
|
272
|
+
# install-wizard globs templates/settings.*.snippet.json and merges keyed on scripts/<name>.sh,
|
|
273
|
+
# so the snippet entry IS the wiring for every install; dropping it is a silent un-wiring.
|
|
274
|
+
SNIP="$REPO/templates/settings.PreToolUse.snippet.json"
|
|
275
|
+
_SNIP_TO=$(python3 -c '
|
|
276
|
+
import json,sys
|
|
277
|
+
d=json.load(open(sys.argv[1]))
|
|
278
|
+
for m in d["project_settings_json"]["hooks"]["PreToolUse"]:
|
|
279
|
+
if m.get("matcher")=="Bash":
|
|
280
|
+
for h in m.get("hooks",[]):
|
|
281
|
+
if "outbound_pr_gate.sh" in h.get("command",""):
|
|
282
|
+
print(h.get("timeout","")); sys.exit(0)
|
|
283
|
+
' "$SNIP" 2>/dev/null)
|
|
284
|
+
n=$((n+1))
|
|
285
|
+
if [ -n "$_SNIP_TO" ]; then
|
|
286
|
+
echo "PASS L17 스니펫의 Bash matcher 가 outbound_pr_gate.sh 를 등록한다 (timeout=${_SNIP_TO}s)"
|
|
287
|
+
else
|
|
288
|
+
echo "FAIL L17 스니펫에 이 훅이 없다 — 출하되지만 배선 0 이면 게이트가 아니라 파일이다"
|
|
289
|
+
fail=1
|
|
290
|
+
fi
|
|
291
|
+
|
|
292
|
+
# L17a known-NEGATIVE for L17: strip the entry from a COPY and the extractor must come back empty.
|
|
293
|
+
# Without this arm, an extractor that silently matched anything would pass L17 vacuously.
|
|
294
|
+
n=$((n+1))
|
|
295
|
+
SNIPMUT="$TMP/snippet_unwired.json"
|
|
296
|
+
python3 -c '
|
|
297
|
+
import json,sys
|
|
298
|
+
d=json.load(open(sys.argv[1]))
|
|
299
|
+
for m in d["project_settings_json"]["hooks"]["PreToolUse"]:
|
|
300
|
+
if m.get("matcher")=="Bash":
|
|
301
|
+
m["hooks"]=[h for h in m.get("hooks",[]) if "outbound_pr_gate.sh" not in h.get("command","")]
|
|
302
|
+
json.dump(d,open(sys.argv[2],"w"))
|
|
303
|
+
' "$SNIP" "$SNIPMUT" 2>/dev/null
|
|
304
|
+
_MUT_TO=$(python3 -c '
|
|
305
|
+
import json,sys
|
|
306
|
+
d=json.load(open(sys.argv[1]))
|
|
307
|
+
for m in d["project_settings_json"]["hooks"]["PreToolUse"]:
|
|
308
|
+
if m.get("matcher")=="Bash":
|
|
309
|
+
for h in m.get("hooks",[]):
|
|
310
|
+
if "outbound_pr_gate.sh" in h.get("command",""):
|
|
311
|
+
print(h.get("timeout","")); sys.exit(0)
|
|
312
|
+
' "$SNIPMUT" 2>/dev/null)
|
|
313
|
+
if [ ! -s "$SNIPMUT" ]; then
|
|
314
|
+
echo "FAIL L17a INSTRUMENT ERROR — the un-wired copy was not produced; the arm would pass vacuously"
|
|
315
|
+
fail=1
|
|
316
|
+
elif [ -z "$_MUT_TO" ]; then
|
|
317
|
+
echo "PASS L17a un-wiring the snippet makes L17's extractor come back empty (it measures, not generates)"
|
|
318
|
+
else
|
|
319
|
+
echo "FAIL L17a the extractor still found a timeout ($_MUT_TO) in a snippet with the entry removed"
|
|
320
|
+
fail=1
|
|
321
|
+
fi
|
|
322
|
+
|
|
323
|
+
# ── L17b the gate must SURVIVE the timeout the snippet configures ──────────────────────
|
|
324
|
+
# A PreToolUse hook killed by its own timeout is a non-blocking error — the tool RUNS. So a deny
|
|
325
|
+
# that is too slow is fail-OPEN, with no override and no log. Measured once already on the sixth
|
|
326
|
+
# guard (10KB took 47s under bash 3.2 against a "timeout": 5). Read the budget FROM the snippet:
|
|
327
|
+
# a lane that allowed more than production does would pass a hook production lets through.
|
|
328
|
+
n=$((n+1))
|
|
329
|
+
[ -n "$_SNIP_TO" ] || _SNIP_TO=5
|
|
330
|
+
norec
|
|
331
|
+
_PAY=$(python3 -c 'import json;print(json.dumps({"tool_name":"Bash","tool_input":{"command":"gh pr create -R tt-a1i/archify --body "+"x"*20000}}))')
|
|
332
|
+
printf '%s' "$_PAY" \
|
|
333
|
+
| CLAUDE_PROJECT_DIR="$FHROOT" FH_OUTBOUND_TODAY="$TODAY" \
|
|
334
|
+
FH_OUTBOUND_RECDIR="$FHROOT/tracks/_meta" timeout "$_SNIP_TO" bash "$GATE" >/dev/null 2>&1
|
|
335
|
+
_rc=$?
|
|
336
|
+
if [ "$_rc" -eq 124 ]; then
|
|
337
|
+
echo "FAIL L17b 20KB 페이로드가 스니펫 timeout(${_SNIP_TO}s) 에 죽었다 — 죽은 훅은 fail-OPEN 이다"
|
|
338
|
+
fail=1
|
|
339
|
+
elif [ "$_rc" -eq 2 ]; then
|
|
340
|
+
echo "PASS L17b 20KB 페이로드도 스니펫 timeout(${_SNIP_TO}s) 안에 deny 로 끝난다"
|
|
341
|
+
else
|
|
342
|
+
echo "FAIL L17b 20KB 페이로드가 deny 가 아니다 (rc=$_rc) — 길다고 스캔을 건너뛰면 안 된다"
|
|
343
|
+
fail=1
|
|
344
|
+
fi
|
|
345
|
+
|
|
213
346
|
echo "── $n lanes, $( [ $fail -eq 0 ] && echo 'all green' || echo 'FAILURES above' ) ──"
|
|
214
347
|
exit $fail
|
|
@@ -43,8 +43,11 @@ missing=""
|
|
|
43
43
|
for f in SKILL.md README.md surfaces.example.yaml preprep.py; do
|
|
44
44
|
[ -f "$SRC/$f" ] || missing="$missing $f"
|
|
45
45
|
done
|
|
46
|
+
# 🟥 D2 와 같은 범위여야 한다 — 한쪽만 재귀로 고치면 D1 이 «20파일»이라 말하고
|
|
47
|
+
# D2 가 «24파일»이라 말해서, 같은 대상에 대해 두 숫자가 나온다(반쪽 수리).
|
|
48
|
+
PY_FILES=$(find "$SRC" -name '*.py' -not -path '*/__pycache__/*' -not -path '*/.pytest_cache/*' | sort)
|
|
46
49
|
PYN=0
|
|
47
|
-
for f in
|
|
50
|
+
for f in $PY_FILES; do [ -f "$f" ] && PYN=$((PYN+1)); done
|
|
48
51
|
if [ -n "$missing" ]; then ng "D1 단일 소스 결손:$missing"
|
|
49
52
|
elif [ "$PYN" -lt 5 ]; then
|
|
50
53
|
ng "D1 python 파일이 $PYN 개뿐 — 스킬이 헐었거나 SRC 가 틀린 곳을 가리킨다"
|
|
@@ -52,9 +55,9 @@ elif ! command -v python3 >/dev/null 2>&1; then
|
|
|
52
55
|
sk "D1 구문 검사 — python3 부재라 «돌 수 있나»를 못 쟀다(UNMEASURED)"
|
|
53
56
|
else
|
|
54
57
|
synerr=""
|
|
55
|
-
for f in
|
|
58
|
+
for f in $PY_FILES; do
|
|
56
59
|
python3 -c "import ast,sys;ast.parse(open(sys.argv[1],encoding='utf-8').read())" "$f" 2>/dev/null \
|
|
57
|
-
|| synerr="$synerr $
|
|
60
|
+
|| synerr="$synerr ${f#$SRC/}"
|
|
58
61
|
done
|
|
59
62
|
[ -z "$synerr" ] && ok "D1 필수 문서 3 + preprep.py 실재 · python ${PYN}파일 전부 구문 통과(디렉터리에서 뽑음)" \
|
|
60
63
|
|| ng "D1 구문 실패:$synerr"
|
|
@@ -68,13 +71,35 @@ elif [ ! -d "$DIST" ]; then
|
|
|
68
71
|
else
|
|
69
72
|
# 🟥 같은 정정 — 여기도 목록이 박혀 있었고, 게다가 **네 개를 돌면서 「5파일」이라고 출력**했다.
|
|
70
73
|
# 라벨이 자기 루프에 대해서도 거짓말한 셈이라, 세는 것과 말하는 것을 한 변수로 묶는다.
|
|
74
|
+
# 🟥 2026-09-21 — 범위가 «$SRC/*.py» 뿐이라 **하위 디렉터리를 통째로 안 봤다.**
|
|
75
|
+
# 그 사각에 `ooxml/gate.py` 가 있고, 바로 그 파일을 고치는 세션이 이 구멍을 발견했다
|
|
76
|
+
# (고친 뒤 배포본에 반영 안 해도 앵커가 초록이었다). 「목록이 조용히 낡는다」의
|
|
77
|
+
# 디렉터리판이고, D1 이 이미 같은 이유로 목록 박기를 버렸다.
|
|
78
|
+
# ⇒ 소스 트리에서 **재귀로** 뽑는다. 새 하위 디렉터리를 만들어도 자동으로 걸린다.
|
|
79
|
+
# 🟥 2026-09-22 — 범위가 «*.py» 뿐이라 **정본 41파일 중 15개(37%)를 아예 안 봤다.**
|
|
80
|
+
# 실측으로 드러났다: 배포본을 합류된 main 에서 다시 뽑으니 실제로 갈려 있던 파일이
|
|
81
|
+
# fixtures/fixture_R3_negative.pptx 923b8f23…(25,278B) ↔ 3107ff54…(25,229B)
|
|
82
|
+
# fixtures/fixture_R3_positive.pptx 64e8c545…(25,157B) ↔ 21d9d19a…(25,109B)
|
|
83
|
+
# 🟥 **R3 레인의 known-pair 짝 그 자체**다 — 배포본에서 R3 를 돌렸다면 틀린 짝으로
|
|
84
|
+
# 교정하고 있었다. 그런데 이 앵커는 여태 초록이었다.
|
|
85
|
+
# 사각의 구성: SKILL.md · presentation_checklist.md · README.md(스킬의 «행동») ·
|
|
86
|
+
# surfaces/canon/jargon 예시 · c1_baseline.txt(판정 기준선) · fixtures/*.md ×6 ·
|
|
87
|
+
# fixtures/*.pptx ×2(known-pair 의 짝). **문서·기준선·픽스처가 전부 그 안에 있었다.**
|
|
88
|
+
# ⇒ 교리가 «사본이 둘이면 갈린다» 인데 «무엇이 사본인가» 가 확장자로 좁혀져 있었다.
|
|
89
|
+
# 바로 위 재귀 정정과 **같은 얼굴, 축만 다르다**(그땐 디렉터리, 이번엔 확장자).
|
|
90
|
+
# 🟥 **PASS 문구의 «출처 토큰을 괄호 맨 앞 + 뒤에 공백» 형태로 유지해라.** 레인 L4 는
|
|
91
|
+
# 「어느 출처가 이겼나」를 그 모양으로 잡는다. 2026-09-21 에 한 번 깨졌고(`· 하위 디렉터리
|
|
92
|
+
# 포함` 을 더하면서), 2026-09-22 에 내가 또 깼다 — 출처를 괄호 끝으로 옮겼더니 L4 가 적색.
|
|
93
|
+
# 문구를 바꿀 거면 L4 와 **같은 호출에서** 바꿔라. 레인을 코드에 맞추는 게 아니다.
|
|
94
|
+
# ⚠️ **한 방향이다** — 정본에 있는 것이 배포본에 같게 있나만 본다. 배포본 «전용» 파일
|
|
95
|
+
# (surfaces.yaml 등 운영 설정)은 이 검사의 대상이 아니고, 초록이 그것들을 승인하지 않는다.
|
|
71
96
|
drift=""; n=0
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
if [ ! -f "$DIST/$
|
|
75
|
-
elif ! cmp -s "$f" "$DIST/$
|
|
76
|
-
done
|
|
77
|
-
[ -z "$drift" ] && ok "D2 standalone
|
|
97
|
+
while IFS= read -r f; do
|
|
98
|
+
rel="${f#$SRC/}"; n=$((n+1))
|
|
99
|
+
if [ ! -f "$DIST/$rel" ]; then drift="$drift $rel(부재)"
|
|
100
|
+
elif ! cmp -s "$f" "$DIST/$rel"; then drift="$drift $rel(갈림)"; fi
|
|
101
|
+
done < <(find "$SRC" -type f -not -path '*/__pycache__/*' -not -path '*/.pytest_cache/*' -not -name '*.pyc' | sort)
|
|
102
|
+
[ -z "$drift" ] && ok "D2 standalone ${n}파일이 단일 소스와 바이트 동일 ($DIST_SRC · 확장자 무관 · 하위 디렉터리 포함). 🟥 정본→배포본 한 방향이라 배포본 전용 파일은 이 초록의 대상이 아니다" \
|
|
78
103
|
|| ng "D2 드리프트($n 중):$drift ⇒ 사본이 둘이 됐다. 단일 소스에서 다시 뽑아라"
|
|
79
104
|
fi
|
|
80
105
|
|
|
@@ -12,7 +12,25 @@ SRC="$HERE/plugins/fh-preprep/skills/preprep"; T=$(mktemp -d); pass=0; fail=0
|
|
|
12
12
|
chk(){ if [ "$1" = 0 ]; then echo " ✅ $2"; pass=$((pass+1)); else echo " ❌ $2"; fail=$((fail+1)); fi; }
|
|
13
13
|
# 🟥 2026-09-11: 앵커(D2)는 «디렉터리의 *.py 전부» 를 돈다(2026-09-10 덱 세션 정정). 여기 목록이 5개로 박혀 있어
|
|
14
14
|
# 새 레인 파일(lane_attr_consistency 등)이 «부재 드리프트» 로 읽혀 L2/L4 가 CI 에서 빨개졌다 — 앵커와 같은 규칙으로.
|
|
15
|
-
|
|
15
|
+
# 🟥 **앵커와 같은 규칙으로 뽑는다.** 이 함수는 원래 `"$SRC"/*.py` 최상위만 평평하게 복사했다.
|
|
16
|
+
# 2026-09-21 에 앵커 D2 가 `find` 재귀로 바뀌면서 `ooxml/gate.py` 등 하위 파일을 요구하게
|
|
17
|
+
# 됐는데 픽스처가 안 따라가 **부재 드리프트**로 읽혔고 L2·L4 가 CI 에서 빨개졌다.
|
|
18
|
+
# 🟥 **이 파일이 이미 한 번 겪은 사고다** — 이 스크립트 머리말(2026-09-11)이 같은 형태를
|
|
19
|
+
# 적고 있고 처방도 「앵커와 같은 규칙으로」였다. 앵커만 고치고 짝을 안 고친 것이라
|
|
20
|
+
# `[[feedback_half_fix_propagation_boundary]]` 정통이다.
|
|
21
|
+
# ⇒ 상대경로를 보존해 재귀 복사한다. 앵커가 규칙을 또 바꾸면 여기도 같이 바꿔야 한다.
|
|
22
|
+
mk(){
|
|
23
|
+
mkdir -p "$1"
|
|
24
|
+
while IFS= read -r f; do
|
|
25
|
+
rel="${f#$SRC/}"
|
|
26
|
+
mkdir -p "$1/$(dirname "$rel")"
|
|
27
|
+
cp "$f" "$1/$rel"
|
|
28
|
+
done < <(find "$SRC" -type f -not -path '*/__pycache__/*' -not -path '*/.pytest_cache/*' -not -name '*.pyc' | sort)
|
|
29
|
+
}
|
|
30
|
+
# 🟥 2026-09-22 — 위 `find` 가 «*.py» 였고 앵커 D2 도 그랬다. 앵커를 확장자 무관으로 넓히면서
|
|
31
|
+
# **여기도 같이 넓혔다.** 이 파일은 이 실수를 이미 두 번 겪었다(머리말 2026-09-11 · 2026-09-21):
|
|
32
|
+
# 앵커만 고치고 픽스처를 안 고치면 L2/L4 가 «부재 드리프트» 로 빨개진다.
|
|
33
|
+
# ⇒ 앵커가 범위 규칙을 또 바꾸면 이 줄도 **같은 호출에서** 바꿔라.
|
|
16
34
|
echo "[preprep-drift-anchor] D2 known pairs"
|
|
17
35
|
# L1 nothing set → D2 SKIP (skip != pass), rc 0 (D2 is not a FAIL)
|
|
18
36
|
out=$(env -u PREPREP_STANDALONE_DIR FH_COMPANION_STORE="$T/nostore" bash "$A" 2>&1); printf '%s' "$out" | grep -q "D2 .*SKIPPED"; chk $? "L1 var unset + no companion preprep → D2 SKIPPED (not PASS)"
|
|
@@ -21,5 +39,49 @@ mk "$T/be/preprep"; out=$(env -u PREPREP_STANDALONE_DIR FH_COMPANION_STORE="$T/b
|
|
|
21
39
|
# L3 companion copy drifted → D2 FAIL, rc 1 (the accident class)
|
|
22
40
|
printf '\n# drift\n' >> "$T/be/preprep/preprep.py"; env -u PREPREP_STANDALONE_DIR FH_COMPANION_STORE="$T/be" bash "$A" >"$T/l3.out" 2>&1; rc=$?; [ "$rc" -ne 0 ] && grep -q "D2 드리프트.*preprep.py(갈림)" "$T/l3.out"; chk $? "L3 fallback copy drifted → D2 FAIL rc=$rc (known-positive)"
|
|
23
41
|
# L4 explicit var wins over companion
|
|
24
|
-
|
|
42
|
+
# ── L5 🟥 «하위 디렉터리» 드리프트를 잡나 — 재귀를 지키는 유일한 레인 ──────────────
|
|
43
|
+
# 2026-09-21: 앵커 D2 를 최상위 전용 → `find` 재귀로 바꿨는데(그 사각에 `ooxml/gate.py` 가
|
|
44
|
+
# 있었고 실제로 회귀가 초록으로 통과했다), **그 변경을 지키는 레인이 하나도 없었다.**
|
|
45
|
+
# 되돌림 프로브로 확인했다: 앵커를 최상위 전용으로 되돌려도 L1~L4 가 전부 초록이다.
|
|
46
|
+
# 🟥 즉 그 수리는 장식이 될 뻔했다(`[[feedback_anchor_can_be_decorative]]`).
|
|
47
|
+
# L3 는 최상위 `preprep.py` 를 갈라서 재귀 여부와 무관하게 잡힌다 — 이 레인이 그 짝이다.
|
|
48
|
+
mk "$T/be2/preprep"
|
|
49
|
+
_sub=$(cd "$SRC" && find . -mindepth 2 -name '*.py' -not -path '*/__pycache__/*' | head -1 | sed 's|^\./||')
|
|
50
|
+
if [ -z "$_sub" ]; then
|
|
51
|
+
echo " ⛔ L5 INSTRUMENT ERROR — 소스에 하위 디렉터리 .py 가 없다. 이 레인은 그 전제 위에 선다"
|
|
52
|
+
fail=$((fail+1))
|
|
53
|
+
else
|
|
54
|
+
printf '\n# drift\n' >> "$T/be2/preprep/$_sub"
|
|
55
|
+
out=$(env -u PREPREP_STANDALONE_DIR FH_COMPANION_STORE="$T/be2" bash "$A" 2>&1); rc=$?
|
|
56
|
+
{ [ "$rc" -ne 0 ] && printf '%s' "$out" | grep -q "D2 드리프트.*$(basename "$_sub")(갈림)"; }
|
|
57
|
+
chk $? "L5 하위 디렉터리 드리프트($_sub) → D2 FAIL rc=$rc (재귀가 하중을 진다)"
|
|
58
|
+
fi
|
|
59
|
+
|
|
60
|
+
# ── L6 🟥 «.py 가 아닌 파일» 드리프트를 잡나 — 앵커의 37% 사각 ────────────────────
|
|
61
|
+
# 2026-09-22, 배포본을 합류된 main 에서 다시 뽑던 세션이 실측으로 냈다:
|
|
62
|
+
# fixtures/fixture_R3_negative.pptx 배포본 923b8f23…(25,278B) ↔ 정본 3107ff54…(25,229B)
|
|
63
|
+
# fixtures/fixture_R3_positive.pptx 배포본 64e8c545…(25,157B) ↔ 정본 21d9d19a…(25,109B)
|
|
64
|
+
# 🟥 **R3 레인의 known-positive/known-negative 짝 그 자체가 갈려 있었다** — 배포본에서
|
|
65
|
+
# R3 를 돌렸다면 «틀린 짝으로» 교정하고 있었다. 그런데 앵커는 여태 초록이었다.
|
|
66
|
+
# 정본 41파일 중 `.py` 가 아닌 것이 **15개(37%)**: SKILL.md · checklist · README ·
|
|
67
|
+
# surfaces/canon/jargon 예시 · c1_baseline.txt · fixtures/*.md ×6 · fixtures/*.pptx ×2.
|
|
68
|
+
# ⇒ 앵커 교리는 «사본이 둘이면 갈린다» 인데, **무엇이 «사본»인지가 확장자로 좁혀져 있었다.**
|
|
69
|
+
# L5(디렉터리 축)와 같은 얼굴이고 축만 다르다.
|
|
70
|
+
mk "$T/be3/preprep"
|
|
71
|
+
_nonpy=$(cd "$SRC" && find . -type f ! -name '*.py' -not -path '*/__pycache__/*' -not -path '*/.pytest_cache/*' | head -1 | sed 's|^\./||')
|
|
72
|
+
if [ -z "$_nonpy" ]; then
|
|
73
|
+
echo " ⛔ L6 INSTRUMENT ERROR — 소스에 .py 아닌 파일이 없다. 이 레인은 그 전제 위에 선다"
|
|
74
|
+
fail=$((fail+1))
|
|
75
|
+
else
|
|
76
|
+
printf '\n<!-- drift -->\n' >> "$T/be3/preprep/$_nonpy"
|
|
77
|
+
out=$(env -u PREPREP_STANDALONE_DIR FH_COMPANION_STORE="$T/be3" bash "$A" 2>&1); rc=$?
|
|
78
|
+
{ [ "$rc" -ne 0 ] && printf '%s' "$out" | grep -q "D2 드리프트.*$(basename "$_nonpy")(갈림)"; }
|
|
79
|
+
chk $? "L6 .py 아닌 파일 드리프트($_nonpy) → D2 FAIL rc=$rc (확장자 사각이 닫혔다)"
|
|
80
|
+
fi
|
|
81
|
+
|
|
82
|
+
# 🟥 이 레인은 «어느 출처가 이겼나» 를 본다. 초판은 `(PREPREP_STANDALONE_DIR)` 로 **닫는 괄호까지**
|
|
83
|
+
# 붙여 잡았는데, 앵커가 PASS 문구에 `· 하위 디렉터리 포함` 을 더하자 그 리터럴이 사라져 깨졌다.
|
|
84
|
+
# ⇒ 출처 토큰 **뒤의 공백까지만** 본다 — 괄호 안에 무엇이 더 붙어도 살아남고,
|
|
85
|
+
# 다른 출처(`FH_COMPANION_STORE/preprep (자동 후보)`)와는 여전히 갈린다.
|
|
86
|
+
mk "$T/explicit"; out=$(PREPREP_STANDALONE_DIR="$T/explicit" FH_COMPANION_STORE="$T/be" bash "$A" 2>&1); printf '%s' "$out" | grep -q "✅ D2 .*(PREPREP_STANDALONE_DIR "; chk $? "L4 explicit PREPREP_STANDALONE_DIR wins over drifted companion copy"
|
|
25
87
|
rm -rf "$T"; echo "[preprep-drift-anchor] $pass passed, $fail failed"; [ "$fail" -eq 0 ]
|