@chrono-meta/fh-gate 3.16.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.
Files changed (60) hide show
  1. package/.claude-plugin/marketplace.json +4 -4
  2. package/AGENTS.md +27 -0
  3. package/CATALOG.md +60 -0
  4. package/CLAUDE.md +5 -0
  5. package/README.ja.md +2 -2
  6. package/README.ko.md +2 -2
  7. package/README.md +2 -2
  8. package/README.zh.md +2 -2
  9. package/docs/OUTPUT_EVIDENCE.md +1 -1
  10. package/docs/codex-compat.md +24 -0
  11. package/knowledge/shared/harness-core/checkout_layer_drift.md +301 -0
  12. package/knowledge/shared/learnings/subagent_invocations_log.yaml +25 -0
  13. package/package.json +11 -1
  14. package/plugins/fh-commons/.claude-plugin/plugin.json +1 -1
  15. package/plugins/fh-meta/.claude-plugin/plugin.json +1 -1
  16. package/plugins/fh-meta/CHANGELOG.md +42 -0
  17. package/plugins/fh-preprep/.claude-plugin/plugin.json +1 -1
  18. package/plugins/fh-preprep/skills/preprep/SKILL.md +5 -0
  19. package/plugins/fh-preprep/skills/preprep/lane_font_embed.py +235 -0
  20. package/plugins/fh-preprep/skills/preprep/ooxml/gate.py +67 -5
  21. package/plugins/fh-preprep/skills/preprep/ooxml/test_gate_exitcodes.py +136 -0
  22. package/plugins/fh-preprep/skills/preprep/preprep.py +16 -1
  23. package/plugins/fh-preprep/skills/preprep/presentation_checklist.md +108 -6
  24. package/plugins/fh-preprep/skills/preprep/safe_install.py +22 -3
  25. package/plugins/fh-preprep/skills/preprep/surfaces.example.yaml +11 -0
  26. package/plugins/fh-preprep/skills/preprep/test_lane_font_embed.py +117 -0
  27. package/plugins/fh-preprep/skills/preprep/test_safe_install_app_xml.py +77 -0
  28. package/plugins/fh-qp/.claude-plugin/plugin.json +1 -1
  29. package/scripts/count_check.sh +46 -14
  30. package/scripts/daily_report.sh +17 -1
  31. package/scripts/env_layer_fingerprint.sh +309 -0
  32. package/scripts/gate_bootstrap_ephemeral.sh +248 -0
  33. package/scripts/governor_board.sh +841 -0
  34. package/scripts/map_postprocess.py +89 -4
  35. package/scripts/multibyte_bracket_lint.sh +135 -0
  36. package/scripts/outbound_pr_gate.sh +12 -0
  37. package/scripts/package_coverage_check.sh +34 -0
  38. package/scripts/selfcheck.sh +245 -0
  39. package/scripts/session_close_check.sh +96 -1
  40. package/scripts/stale_ref_scan.py +2 -1
  41. package/scripts/test_count_check_decl_lanes.sh +176 -0
  42. package/scripts/test_env_layer_fingerprint_lanes.sh +192 -0
  43. package/scripts/test_gate_bootstrap_ephemeral_lanes.sh +262 -0
  44. package/scripts/test_locale_invariance_lanes.sh +581 -0
  45. package/scripts/test_map_postprocess_lanes.sh +84 -4
  46. package/scripts/test_marker_crossfamily_lanes.sh +5 -1
  47. package/scripts/test_marker_defense_lanes.sh +5 -1
  48. package/scripts/test_marker_standpoint_lanes.sh +5 -1
  49. package/scripts/test_marker_thirdparty_lanes.sh +5 -1
  50. package/scripts/test_multibyte_bracket_lint_lanes.sh +107 -0
  51. package/scripts/test_outbound_pr_gate_lanes.sh +133 -0
  52. package/scripts/test_preprep_drift_anchor.sh +34 -9
  53. package/scripts/test_preprep_drift_anchor_lanes.sh +64 -2
  54. package/scripts/test_session_close_chain_lanes.sh +45 -0
  55. package/scripts/test_stale_ref_close_lanes.sh +197 -0
  56. package/scripts/test_stale_ref_scan_lanes.sh +6 -1
  57. package/scripts/test_worktree_reclaim_lanes.sh +267 -1
  58. package/scripts/worktree_reclaim.sh +246 -11
  59. package/templates/.git-hooks/pre-commit +108 -27
  60. package/templates/settings.PreToolUse.snippet.json +54 -1
@@ -280,6 +280,51 @@ _gap "①-b gh ERROR is silent (indistinguishable from zero PRs)" "$_g" \
280
280
  The sweep 'not run' and the sweep 'found nothing' look identical. Advisory surface, so not \
281
281
  fail-closed — but it should print 'sweep UNAVAILABLE' rather than nothing."
282
282
 
283
+ # AUTHOR UNION. `--author "@me"` resolves to the LOCAL user; a PR opened by a cloud session is
284
+ # authored by the GitHub App `app/claude`, so a sweep filtered on "@me" alone reports 0 while
285
+ # cloud PRs are open — and the close then passes as "no open PRs". Measured 2026-09-21 on this
286
+ # repo with a known pair over MERGED PRs (the open set was empty that day, so the 0-case could
287
+ # not calibrate it): `--author app/claude` returned #785 #784 #783 #782 #781 and `--author @me`
288
+ # returned #779 #773 #772 ... — DISJOINT sets. These two lanes are the known pair for the fix.
289
+ _ghstub_author() { # $1=repo $2=json for @me $3=json for app/claude
290
+ mkdir -p "$1/bin"
291
+ {
292
+ printf '%s\n' '#!/usr/bin/env bash'
293
+ printf '%s\n' '_a=""'
294
+ printf '%s\n' 'while [ $# -gt 0 ]; do case "$1" in --author) _a="$2"; shift 2 ;; *) shift ;; esac; done'
295
+ printf '%s\n' 'case "$_a" in'
296
+ printf ' "@me") printf %s%s%s "%s" ;;\n' "'" '%s\n' "'" "$2"
297
+ printf ' "app/claude") printf %s%s%s "%s" ;;\n' "'" '%s\n' "'" "$3"
298
+ printf '%s\n' ' *) printf "[]\n" ;;'
299
+ printf '%s\n' 'esac'
300
+ printf '%s\n' 'exit 0'
301
+ } > "$1/bin/gh"
302
+ chmod +x "$1/bin/gh"
303
+ }
304
+
305
+ # known-POSITIVE: the cloud-only case the old line was blind to. Pre-fix this printed NOTHING.
306
+ T=$(_repo b_bot); _artifacts "$T"
307
+ _ghstub_author "$T" '[]' '[{\"number\":782},{\"number\":785}]'
308
+ _run_with_gh "$T"
309
+ _line "①-b-P4 cloud-only PRs (app/claude) → sweep says 2" '①-b 2 open PR' 1 "$OUT"
310
+
311
+ # OVER-COUNT CONTROL: if the two author filters ever return the SAME PR, the union must dedup by
312
+ # number and say 1 — not 2. A union that concatenates without `sort -u` passes P4 and fails here,
313
+ # which is why the pair is two lanes and not one.
314
+ T=$(_repo b_overlap); _artifacts "$T"
315
+ _ghstub_author "$T" '[{\"number\":777}]' '[{\"number\":777}]'
316
+ _run_with_gh "$T"
317
+ _line "①-b-P5 same PR under both authors → deduped to 1 (over-count control)" '①-b 1 open PR' 1 "$OUT"
318
+
319
+ # JSON SHAPE. `gh` emits compact JSON when piped today, but the extractor must not depend on that:
320
+ # a naive '"number":[0-9]*' matches zero digits on `{"number": 782}` and the count silently becomes
321
+ # 0 — the same fail-open direction (toward "no open PRs") this step exists to close. Known pair:
322
+ # this lane is the spaced body, and ①-b-P3 above is the compact body that must stay green.
323
+ T=$(_repo b_spaced); _artifacts "$T"
324
+ _ghstub_author "$T" '[]' '[{\"number\": 782},{\"number\": 785}]'
325
+ _run_with_gh "$T"
326
+ _line "①-b-P6 pretty-printed JSON (space after colon) → still says 2" '①-b 2 open PR' 1 "$OUT"
327
+
283
328
  echo
284
329
  echo "══ ④-log real-time completion log (the exit-1 FAIL path) ══"
285
330
  # NOTE the label: this is NOT CLAUDE.md's ④ (memory hygiene, deliberately unmechanized — see
@@ -0,0 +1,197 @@
1
+ #!/usr/bin/env bash
2
+ # test_stale_ref_close_lanes.sh — known pairs + revert probes for the ①-g STALE REF advisory
3
+ # block in `scripts/session_close_check.sh`.
4
+ #
5
+ # WHY THIS EXISTS
6
+ # #770 built `scripts/stale_ref_scan.py` and #773 shipped it with its own residual written down:
7
+ # «배선 안 함 — 이 계기는 지금 아무도 안 부른다». Measured 2026-09-21: its only call sites were
8
+ # its own lane suite and that suite's selfcheck wiring, and BOTH pass `--offline-fixture`. The
9
+ # tool was fully anchored and had never once been pointed at the real corpus. ①-g is that call
10
+ # site. Without these lanes the block can be deleted, or quietly turned into a silent pass, with
11
+ # every gate still green — the decoration class `new_code_anchor_check` exists to catch.
12
+ #
13
+ # SCOPE, stated honestly: these lanes exercise the CALLER CONTRACT — what ①-g does with each
14
+ # verdict shape the scanner can produce (defect · unreadable · no verdict at all · scanner absent)
15
+ # and that it never blocks. The scanner's own verdicts are anchored separately by
16
+ # `scripts/test_stale_ref_scan_lanes.sh`. The block is EXTRACTED from the subject rather than
17
+ # restated here: a restated copy drifts from the thing it claims to verify.
18
+ # 🟥 No network. The subject under test is the caller, so the scanner is a stub whose verdict
19
+ # line is the lane's input — a live scan would make these lanes depend on Zenodo's state.
20
+ set -uo pipefail
21
+
22
+ REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
23
+ cd "$REPO_ROOT" || exit 10
24
+ pass=0; fail=0
25
+ ok() { printf ' \342\234\205 %s\n' "$1"; pass=$((pass+1)); }
26
+ bad() { printf ' \342\235\214 %s\n' "$1"; fail=$((fail+1)); }
27
+
28
+ SUBJECT="$REPO_ROOT/scripts/session_close_check.sh"
29
+ if [ ! -f "$SUBJECT" ]; then
30
+ printf '\360\237\237\245 HARNESS ERROR — session_close_check.sh 가 없다. 「0 실패」가 아니라 계기 부재다.\n'
31
+ exit 10
32
+ fi
33
+
34
+ BLOCK=$(awk '/^# ── ①-g STALE REF \(advisory\)/,/^echo "── close check:/' "$SUBJECT" | sed '$d')
35
+ if [ -z "$BLOCK" ] || ! printf '%s' "$BLOCK" | grep -q '_SR_SCAN'; then
36
+ bad "①-g 블록을 subject 에서 못 찾았다 — 못 찾는 것을 검증할 수는 없다"
37
+ echo "----"; echo "stale-ref close lanes: $pass passed, $fail failed"; exit 1
38
+ fi
39
+
40
+ if ! command -v git >/dev/null 2>&1; then
41
+ printf '\360\237\237\245 HARNESS ERROR — git 이 없다. 픽스처 트리를 못 만든다(「0 실패」가 아니다).\n'
42
+ exit 10
43
+ fi
44
+
45
+ TMP="$(mktemp -d)"; trap 'rm -rf "$TMP"' EXIT
46
+
47
+ # make_tree <stub-body|NOSCAN> — a minimal tracked tree carrying one Zenodo reference
48
+ make_tree() {
49
+ local t; t="$(mktemp -d "$TMP/tree.XXXXXX")"
50
+ ( cd "$t" && git init -q . && git config user.email t@t && git config user.name t ) || return 1
51
+ mkdir -p "$t/scripts" "$t/tracks"
52
+ printf 'see 10.5281/zenodo.20397566 for the method\n' > "$t/DOC.md"
53
+ # a tracks/ file that MUST be excluded from the scanned set
54
+ printf 'old record 10.5281/zenodo.11111111\n' > "$t/tracks/old_note.md"
55
+ if [ "$1" != "NOSCAN" ]; then
56
+ printf '%s\n' "$1" > "$t/scripts/stale_ref_scan.py"
57
+ chmod +x "$t/scripts/stale_ref_scan.py"
58
+ fi
59
+ ( cd "$t" && git add -A >/dev/null 2>&1 ) || return 1
60
+ printf '%s' "$t"
61
+ }
62
+
63
+ # run_block <tree> [block-override] — echoes the block's output, then a FAIL= line
64
+ run_block() {
65
+ local tree="$1" blk="${2:-$BLOCK}"
66
+ FH="$tree" BLK="$blk" bash -c '
67
+ set -uo pipefail
68
+ FH="$FH"; FAIL=0
69
+ eval "$BLK"
70
+ echo "FAILVAR=$FAIL"
71
+ ' 2>&1
72
+ }
73
+
74
+ STUB_HEAD='#!/usr/bin/env python3
75
+ import sys
76
+ print("stale-ref-scan · stub")'
77
+
78
+ stub_with() { # stub_with <verdict-tail> [extra-detail-line]
79
+ printf '%s\n' "$STUB_HEAD"
80
+ [ -n "${2:-}" ] && printf 'print(%s)\n' "\"$2\""
81
+ printf 'print("stale-ref verdict: %s")\n' "$1"
82
+ printf 'sys.exit(1)\n'
83
+ }
84
+
85
+ # ── L0 dead control — an all-clean verdict must produce the ✅ line ───────────
86
+ t=$(make_tree "$(stub_with 'SUPERSEDED=0 UNRESOLVED=0 UNSCANNABLE=0 CONCEPT=1 CURRENT=2 CHANGELOG-EXCLUDED=0 rc=0')")
87
+ out=$(run_block "$t")
88
+ case "$out" in
89
+ *"✅ ①-g"*) ok "L0 dead-control — 깨끗한 판정에서 ✅ 가 난다 (블록이 실제로 돈다)" ;;
90
+ *) bad "L0 dead-control — 깨끗한 판정에서도 ✅ 가 없다. 아래 판정은 무의미하다: $out"
91
+ echo "----"; echo "stale-ref close lanes: $pass passed, $fail failed"; exit 1 ;;
92
+ esac
93
+
94
+ # ── L1 known-POS defect — SUPERSEDED>0 surfaces, and the detail line rides along
95
+ t=$(make_tree "$(stub_with 'SUPERSEDED=2 UNRESOLVED=0 UNSCANNABLE=0 CONCEPT=0 CURRENT=1 CHANGELOG-EXCLUDED=0 rc=1' ' 🟥 SUPERSEDED [20397566] cited ×3 — DOC.md:1')")
96
+ out=$(run_block "$t")
97
+ if printf '%s' "$out" | grep -q '①-g stale-ref: 2 개 id' && printf '%s' "$out" | grep -q 'SUPERSEDED \[20397566\]'; then
98
+ ok "L1 known-POS — 폐기 인용이 개수와 자리까지 표면화된다"
99
+ else
100
+ bad "L1 known-POS — 폐기 인용이 안 나왔다: $out"
101
+ fi
102
+
103
+ # ── L2 advisory — a defect must NOT raise FAIL (reversible surface) ──────────
104
+ case "$out" in
105
+ *"FAILVAR=0"*) ok "L2 advisory — 결함을 찾아도 FAIL 을 안 올린다 (막지 않는다)" ;;
106
+ *) bad "L2 advisory — 결함에서 FAIL 이 올라갔다. 과차단은 --no-verify 를 학습시킨다: $out" ;;
107
+ esac
108
+
109
+ # ── L3 못 읽음 ≠ 깨끗함 — UNRESOLVED>0 must read UNMEASURED, never ✅ ─────────
110
+ t=$(make_tree "$(stub_with 'SUPERSEDED=0 UNRESOLVED=7 UNSCANNABLE=0 CONCEPT=0 CURRENT=0 CHANGELOG-EXCLUDED=0 rc=1')")
111
+ out=$(run_block "$t")
112
+ if printf '%s' "$out" | grep -q 'UNMEASURED' && ! printf '%s' "$out" | grep -q '✅ ①-g'; then
113
+ ok "L3 못 읽음 ≠ 깨끗함 — UNRESOLVED 가 UNMEASURED 로 나오고 ✅ 는 안 난다"
114
+ else
115
+ bad "L3 UNRESOLVED 를 깨끗함으로 읽었다: $out"
116
+ fi
117
+
118
+ # ── L4 계기 오류 — no verdict line at all is UNMEASURED, not silence ─────────
119
+ t=$(make_tree '#!/usr/bin/env python3
120
+ import sys
121
+ sys.stderr.write("boom\n"); sys.exit(2)')
122
+ out=$(run_block "$t")
123
+ if printf '%s' "$out" | grep -q '판정 줄을 안 냈다'; then
124
+ ok "L4 계기 오류 — 판정 줄이 없으면 UNMEASURED 로 말한다 (침묵 아님)"
125
+ else
126
+ bad "L4 판정 줄 부재가 조용히 지나갔다: $out"
127
+ fi
128
+
129
+ # ── L5 부재≠통과 — scanner missing must say skipped-not-passed ───────────────
130
+ t=$(make_tree NOSCAN)
131
+ out=$(run_block "$t")
132
+ if printf '%s' "$out" | grep -q 'skipped, not passed'; then
133
+ ok "L5 계기 부재 — skipped, not passed (UNMEASURED) 로 말한다"
134
+ else
135
+ bad "L5 계기 부재가 통과처럼 지나갔다: $out"
136
+ fi
137
+
138
+ # ── L6 scope — tracks/** must not reach the scanner ──────────────────────────
139
+ # 🟥 The block swallows the scanner's stdout into a variable, so the argv must be observed on
140
+ # a side channel — asserting on stdout here would have measured nothing.
141
+ t=$(make_tree '#!/usr/bin/env python3
142
+ import sys
143
+ args=[a for a in sys.argv[1:] if not a.startswith("-")]
144
+ open("ARGV_SEEN.txt","w").write(",".join(args))
145
+ print("stale-ref verdict: SUPERSEDED=0 UNRESOLVED=0 UNSCANNABLE=0 CONCEPT=0 CURRENT=0 CHANGELOG-EXCLUDED=0 rc=0")
146
+ sys.exit(0)')
147
+ out=$(run_block "$t")
148
+ seen=$(cat "$t/ARGV_SEEN.txt" 2>/dev/null || echo "__NOFILE__")
149
+ if [ "$seen" = "__NOFILE__" ]; then
150
+ bad "L6 HARNESS ERROR — 스텁이 argv 를 안 남겼다. 스코프를 잰 적이 없다"
151
+ elif printf '%s' "$seen" | grep -q 'DOC.md' && ! printf '%s' "$seen" | grep -q 'tracks/'; then
152
+ ok "L6 스코프 — 추적 파일은 넘기고 tracks/** 는 제외한다"
153
+ else
154
+ bad "L6 스코프 — 스캐너가 받은 파일 집합이 틀렸다: $seen"
155
+ fi
156
+
157
+ # ── L7 revert probe: drop the SUPERSEDED branch → L1 must go silent ──────────
158
+ MUT=$(printf '%s' "$BLOCK" | sed 's/if \[ "${_sr_sup:-0}" -gt 0 \] 2>\/dev\/null; then/if false; then/')
159
+ if [ "$MUT" = "$BLOCK" ]; then
160
+ bad "L7 HARNESS ERROR — 뮤턴트 생성 실패 (치환 대상 없음). 「안 빨개졌다」와 구별이 안 된다"
161
+ else
162
+ t=$(make_tree "$(stub_with 'SUPERSEDED=2 UNRESOLVED=0 UNSCANNABLE=0 CONCEPT=0 CURRENT=1 CHANGELOG-EXCLUDED=0 rc=1' ' 🟥 SUPERSEDED [20397566] cited ×3 — DOC.md:1')")
163
+ out=$(run_block "$t" "$MUT")
164
+ if printf '%s' "$out" | grep -q '①-g stale-ref: 2 개 id'; then
165
+ bad "L7 되돌림 — 분기를 죽였는데도 L1 이 초록이다. L1 은 그 분기 덕분이 아닐 수 있다"
166
+ else
167
+ ok "L7 되돌림 — SUPERSEDED 분기를 죽이자 표면화가 사라진다 (앵커가 장식이 아니다)"
168
+ fi
169
+ fi
170
+
171
+ # ── L8 revert probe: treat a missing verdict as clean → L4 must go silent ────
172
+ MUT=$(printf '%s' "$BLOCK" | sed 's/UNMEASURED — 스캐너가 판정 줄을 안 냈다 (0 으로 읽지 마라)/(quiet)/')
173
+ if [ "$MUT" = "$BLOCK" ]; then
174
+ bad "L8 HARNESS ERROR — 뮤턴트 생성 실패 (치환 대상 없음)"
175
+ else
176
+ t=$(make_tree '#!/usr/bin/env python3
177
+ import sys
178
+ sys.exit(2)')
179
+ out=$(run_block "$t" "$MUT")
180
+ if printf '%s' "$out" | grep -q '판정 줄을 안 냈다'; then
181
+ bad "L8 되돌림 — 문구를 지웠는데도 L4 가 초록이다"
182
+ else
183
+ ok "L8 되돌림 — 계기-오류 보고를 지우자 L4 가 침묵한다 (그 줄이 L4 를 지고 있다)"
184
+ fi
185
+ fi
186
+
187
+ # ── L9 containment — the real repo was not touched ───────────────────────────
188
+ # 🟥 초판은 여기서 `git diff --quiet … || true` 를 불렀다 — 항상 참이라 아무것도 안 재는
189
+ # 장식이었다. 실제 단언은 픽스처 위치 하나다.
190
+ case "$TMP" in
191
+ "$REPO_ROOT"*) bad "L9 containment — 픽스처가 실제 레포 안에 있다" ;;
192
+ *) ok "L9 containment — 픽스처는 레포 밖 임시 트리다 (실제 레포 미변경)" ;;
193
+ esac
194
+
195
+ echo "----"
196
+ echo "stale-ref close lanes: $pass passed, $fail failed"
197
+ [ "$fail" -eq 0 ]
@@ -13,7 +13,12 @@
13
13
  # network arms here go through `--offline-fixture`, and the shapes are copied byte-for-byte from
14
14
  # the real corpus (fixture shape from the artifact, not a mental model):
15
15
  # · `10.5281/<wbr>zenodo.<wbr>20397566` paper/forge_harness_v1.0.3.html:159
16
- # · `[Zenodo](https://zenodo.org/records/22542168)` README.md:418
16
+ # · `[Zenodo](https://zenodo.org/records/22542168)` README.md:418 **as of c4b4ffa**
17
+ # 🟥 That README line has since moved to the v1.0.2 id (`22843702`), so the pointer is
18
+ # pinned to a commit rather than to HEAD. The fixture KEEPS the superseded id on
19
+ # purpose — a stale-ref lane needs a stale ref — so this is a provenance note, not a
20
+ # value to sync. The lane is synthetic and stays green either way, which is exactly
21
+ # why the drift would otherwise be silent.
17
22
  # · `# forge-harness (fh-meta) Changelog` plugins/fh-meta/CHANGELOG.md:1
18
23
  #
19
24
  # THE TWO-SIGNALS RULE
@@ -61,8 +61,274 @@ OUT="$(bash "$SUT" "$M" 2>&1)"; RC=$?; [ "$RC" -eq 2 ] && ok "W5 main checkout a
61
61
  OUT="$(bash "$SUT" "$T" 2>&1)"; RC=$?; [ "$RC" -eq 2 ] && ok "W5b non-repo dir → rc=2" || ng "W5b rc=$RC (기대 2)"
62
62
  OUT="$(bash "$SUT" "$W" --bogus 2>&1)"; RC=$?; [ "$RC" -eq 2 ] && ok "W5c unknown flag → rc=2" || ng "W5c rc=$RC (기대 2)"
63
63
  OUT="$(bash "$SUT" 2>&1)"; RC=$?; [ "$RC" -eq 2 ] && ok "W5d no argument → rc=2" || ng "W5d rc=$RC (기대 2)"
64
+ # 🟥 W5e 는 2026-09-21 에 기대값이 뒤집혔다. 종전 판은 «tracks/ 없음 → rc=0 회수할 것 없음» 을
65
+ # **옳은 동작으로 박아** 뒀는데, 그게 결함이다 — 스크립트가 tracks/ 만 보던 시절의 기대값이
66
+ # 레인에 화석으로 남아 거짓 초록을 인증하고 있었다. tracks/ 가 없으면 «그 구역이 빈» 것이지
67
+ # «워크트리에 아무것도 없는» 것이 아니다. 지금은 진짜로 비어 있을 때만 rc=0 이다.
64
68
  mk_pair "$T/c"; rm -rf "$T/c/wt/tracks"; OUT="$(bash "$SUT" "$T/c/wt" 2>&1)"; RC=$?
65
- [ "$RC" -eq 0 ] && ok "W5e worktree without tracks/ → rc=0 nothing to reclaim" || ng "W5e rc=$RC (기대 0)"
69
+ [ "$RC" -eq 0 ] && ok "W5e worktree with no tracks/ AND no other artifact → rc=0" || ng "W5e rc=$RC (기대 0)"
70
+
71
+ echo "── W6 범위: «안 본 것» 을 «없는 것» 으로 렌더하나 (2026-09-21 실측) ──"
72
+ # WHY: 정책렌즈 워크트리가 `scripts/fixtures/…`(52파일)과 `scripts/score_policy_lens.sh` 를
73
+ # untracked 로만 들고 있었다. tracks/ 만 보던 스크립트는 «only-in-worktree: 0» 을 내고
74
+ # **«✅ safe to: git worktree remove»** 를 찍었다 — 비가역 표면에서 파괴를 «승인» 한 것이다.
75
+
76
+ mk_pair "$T/f"; M="$T/f/main"; W="$T/f/wt"
77
+ mkdir -p "$W/tracks/_meta" "$W/scripts/fixtures/kp" # tracks/ 는 있고 «비어 있다» = 순수 얼굴
78
+ echo scorer > "$W/scripts/score_policy_lens.sh"; echo fx > "$W/scripts/fixtures/kp/a.txt"
79
+ OUT="$(bash "$SUT" "$W" 2>&1)"; RC=$?
80
+ case "$RC:$OUT" in
81
+ 0:*"safe to"*) ng "W6 tracks/ 밖 산출 2건인데 «safe to remove» 를 찍었다 — 거짓 초록" ;;
82
+ 0:*) ng "W6 rc=0 (기대 비영) — 제거를 막지 않는다" ;;
83
+ *"score_policy_lens.sh"*) ok "W6 tracks/ 밖 untracked 산출을 이름으로 세우고 제거를 안 승인한다 (rc=$RC)" ;;
84
+ *) ng "W6 rc=$RC 인데 출력에 파일명이 없다 — 왜 막는지 안 알려준다" ;;
85
+ esac
86
+ [ ! -e "$M/scripts/score_policy_lens.sh" ] \
87
+ && ok "W6b OUTSIDE 는 자동 복사 «안» 한다 (목적지는 판단이지 기본값이 아니다)" \
88
+ || ng "W6b OUTSIDE 를 본 체크아웃에 멋대로 옮겼다"
89
+
90
+ mk_pair "$T/g"; W="$T/g/wt"; rm -rf "$W/tracks"; echo art > "$W/leftover.md"
91
+ OUT="$(bash "$SUT" "$W" 2>&1)"; RC=$?
92
+ case "$RC:$OUT" in
93
+ 0:*"nothing to reclaim"*) ng "W6c tracks/ 부재를 «회수할 것 없음» 으로 읽었다 (:42 조기 exit)" ;;
94
+ 0:*) ng "W6c rc=0 — leftover.md 가 있는데 제거를 승인했다" ;;
95
+ *"leftover.md"*) ok "W6c tracks/ 가 없어도 다른 산출을 본다 (rc=$RC)" ;;
96
+ *) ng "W6c rc=$RC / 출력에 leftover.md 없음" ;;
97
+ esac
98
+
99
+ # 🟥 과차단 컨트롤 — 재생성 가능한 것으로 막으면 override 를 훈련시킨다(= 게이트 무장해제).
100
+ mk_pair "$T/h"; W="$T/h/wt"; mkdir -p "$W/tracks/_meta" "$W/node_modules/x" "$W/__pycache__" "$W/dist"
101
+ printf 'tracks/\nnode_modules/\n__pycache__/\ndist/\n.DS_Store\n*.pyc\n' > "$W/.gitignore"
102
+ echo j > "$W/node_modules/x/p.js"; echo c > "$W/__pycache__/m.pyc"; echo d > "$W/dist/out.js"
103
+ echo s > "$W/.DS_Store"; echo y > "$W/stale.pyc"
104
+ OUT="$(bash "$SUT" "$W" 2>&1)"; RC=$?
105
+ [ "$RC" -eq 0 ] && ok "W6d 과차단 컨트롤: node_modules·__pycache__·dist·.DS_Store·*.pyc 는 안 막는다" \
106
+ || ng "W6d 재생성 가능한 것으로 막았다 (rc=$RC) — override 훈련 방향"
107
+ # 🟥 그 컨트롤이 «아무거나 다 통과» 라서 초록인 게 아님을 같이 증명한다(죽은 컨트롤 방지).
108
+ echo real > "$W/keepme.md"; OUT="$(bash "$SUT" "$W" 2>&1)"; RC=$?
109
+ [ "$RC" -ne 0 ] && printf '%s' "$OUT" | grep -q "keepme.md" \
110
+ && ok "W6e 같은 트리에 진짜 산출 1개를 더하면 막는다 — W6d 가 죽은 컨트롤이 아니다" \
111
+ || ng "W6e rc=$RC — 제외 목록이 전부를 삼키고 있다"
112
+
113
+ # --apply 로도 OUTSIDE 는 안 사라진다: tracks/ 는 회수하고, 밖의 것은 여전히 사람 몫.
114
+ mk_pair "$T/i"; M="$T/i/main"; W="$T/i/wt"; mkdir -p "$W/tracks/_meta"
115
+ echo sig > "$W/tracks/_meta/sig.md"; echo out > "$W/outside.md"
116
+ OUT="$(bash "$SUT" "$W" --apply 2>&1)"; RC=$?
117
+ if [ -f "$M/tracks/_meta/sig.md" ] && [ ! -e "$M/outside.md" ] && [ "$RC" -ne 0 ]; then
118
+ ok "W6f --apply: tracks/ 는 회수, OUTSIDE 는 안 옮기고 제거 승인도 안 한다 (rc=$RC)"
119
+ else
120
+ ng "W6f copied=$([ -f "$M/tracks/_meta/sig.md" ] && echo 1 || echo 0) leaked=$([ -e "$M/outside.md" ] && echo 1 || echo 0) rc=$RC"
121
+ fi
122
+
123
+ echo "── W7 cross-family 가 잡은 것들 (2026-09-21, 적대검증 S1·A3) ──"
124
+ # 🟥 W6 가 전부 초록이었는데도 아래 넷이 살아 있었다. 원인 하나: mk_pair 의 .gitignore 가
125
+ # `tracks/` 한 줄뿐이라 픽스처에 ⓐ `!!` 접두 ⓑ ignored 디렉터리 ⓒ tracked-modified 줄 이
126
+ # **원리적으로 존재하지 않았다.** 계기가 대상과 다른 형태였다([[feedback_instrument_blindspot_correlated_with_arm]]).
127
+
128
+ # W7a 🟥 S-1 — 열거기가 죽으면 «빈 결과» 가 «깨끗함» 으로 읽히나. 실측 재현: git rc=128 · script rc=0 · «safe to».
129
+ mk_pair "$T/j"; W="$T/j/wt"; mkdir -p "$W/tracks/_meta"
130
+ G="$(git -C "$W" rev-parse --git-dir 2>/dev/null)"; printf 'garbage' > "$G/index"
131
+ OUT="$(bash "$SUT" "$W" 2>&1)"; RC=$?
132
+ if printf '%s' "$OUT" | grep -q "safe to"; then
133
+ ng "W7a 열거기가 죽었는데 «safe to remove» 를 찍었다 (rc=$RC) — 이 스크립트 자신의 병"
134
+ elif [ "$RC" -eq 10 ]; then ok "W7a git status 실패 → rc=10 harness-error (빈 결과를 «깨끗함» 으로 안 읽는다)"
135
+ else ng "W7a rc=$RC (기대 10)"; fi
136
+
137
+ # W7b 🟥 A-1 — `${_l#?? }` 의 `?` 가 glob 이라 모든 상태줄을 먹었다. tracked-modified 가 OUTSIDE 로 샜다.
138
+ mk_pair "$T/k"; W="$T/k/wt"; mkdir -p "$W/tracks/_meta"; echo more >> "$W/README.md"
139
+ OUT="$(bash "$SUT" "$W" 2>&1)"; RC=$?
140
+ if printf '%s' "$OUT" | grep -q "OUTSIDE README.md"; then
141
+ ng "W7b tracked 파일(README.md)이 «git will not carry this» 로 찍혔다 — 거짓 라벨 + 과차단"
142
+ elif [ "$RC" -eq 0 ]; then ok "W7b tracked-modified 는 OUTSIDE 가 아니다 (커밋하면 살아남는다)"
143
+ else ng "W7b rc=$RC (기대 0) — tracked 변경만 있는데 막았다"; fi
144
+
145
+ # W7c 🟥 A-3 — ignored(«규칙을 일부러 쓴 것») 은 나열하되 막지 않는다. 안 그러면 실제 레포에서 rc=1 이 영구가 되고
146
+ # «치울 수 없는 게이트» 가 `--force` 를 훈련시킨다(실측: fod 워크트리 `!!` 6줄, FH 본체는 세션마다 늘어난다).
147
+ mk_pair "$T/l"; W="$T/l/wt"; mkdir -p "$W/tracks/_meta" "$W/.claude"
148
+ # 🟥 초판 픽스처는 `.claude/.sentinel_abc` 라는 «지어낸 이름» 이었고, 그게 S-2 를 «옳음» 으로
149
+ # 동결했다 — 이름은 실물에서 뽑는다([[feedback_fixture_shape_from_artifact_not_mental_model]]).
150
+ printf 'tracks/\n.claude/.prior_art_prompted_*\n' > "$W/.gitignore"
151
+ echo s > "$W/.claude/.prior_art_prompted_abc123"
152
+ OUT="$(bash "$SUT" "$W" 2>&1)"; RC=$?
153
+ if [ "$RC" -eq 0 ] && printf '%s' "$OUT" | grep -q "SKIP .claude/.prior_art_prompted_abc123"; then
154
+ ok "W7c 세션 런타임 센티널은 «이름으로 나열하되 안 막는다» (rc=0)"
155
+ elif [ "$RC" -ne 0 ]; then ng "W7c 런타임 센티널로 막았다 (rc=$RC) — 영구 rc=1 · --force 훈련 방향"
156
+ else ng "W7c rc=0 인데 SKIP 목록에 이름이 없다 — 조용히 버렸다"; fi
157
+
158
+ # W7d 컨트롤 — W7c 가 «ignored 면 다 통과» 로 새지 않았나. 같은 트리에 untracked 를 하나 더하면 막아야 한다.
159
+ echo real > "$W/keep_me.md"; OUT="$(bash "$SUT" "$W" 2>&1)"; RC=$?
160
+ [ "$RC" -ne 0 ] && printf '%s' "$OUT" | grep -q "OUTSIDE keep_me.md" \
161
+ && ok "W7d untracked 는 여전히 막는다 — W7c 가 차단을 통째로 끄지 않았다" \
162
+ || ng "W7d rc=$RC — ignored 완화가 untracked 차단까지 껐다"
163
+
164
+ # W7e 🟥 A-2 — 제외 목록의 «과소차단» 방향이 무음이었다. 이제 SKIP 으로 세고 목록 파일에 남긴다.
165
+ mk_pair "$T/m"; M="$T/m/main"; W="$T/m/wt"; mkdir -p "$W/tracks/_meta" "$W/node_modules/x"
166
+ printf 'tracks/\nnode_modules/\n' > "$W/.gitignore" # 🟥 ignored 여야 SKIP (B-7: untracked 는 막는다)
167
+ echo j > "$W/node_modules/x/p.js"
168
+ OUT="$(bash "$SUT" "$W" 2>&1)"; RC=$?
169
+ L="$(ls -t "$M"/tracks/_meta/dispatch/reclaim_wt_*.txt 2>/dev/null | head -1)"
170
+ if [ "$RC" -eq 0 ] && printf '%s' "$OUT" | grep -q "non-blocking: skipped 1" \
171
+ && [ -n "$L" ] && grep -q "^SKIP node_modules/x/p.js" "$L"; then
172
+ ok "W7e 제외분은 «버리는» 게 아니라 «세고 목록에 남긴다» — 과소차단 방향이 더는 무음이 아니다"
173
+ else
174
+ ng "W7e rc=$RC · 요약에 skipped-regenerable 없음 또는 리스트에 SKIP 줄 없음"
175
+ fi
176
+
177
+ # W7f 🟥 B-4 — bash 3.2 호환 주장에 실행 팔이 0개였다. 빈 배열 경로를 /bin/bash 로 한 번 민다.
178
+ if [ -x /bin/bash ]; then
179
+ mk_pair "$T/n"; W="$T/n/wt"; rm -rf "$W/tracks"
180
+ OUT="$(/bin/bash "$SUT" "$W" 2>&1)"; RC=$?
181
+ [ "$RC" -eq 0 ] && ok "W7f /bin/bash(3.2) 로 빈 배열 전 경로 통과 — 주장이 실행으로 선다" \
182
+ || ng "W7f /bin/bash rc=$RC: $(printf '%s' "$OUT" | head -2)"
183
+ else
184
+ ng "W7f /bin/bash 가 없다 — 3.2 주장은 이 머신에서 미측정(NOT a pass)"
185
+ fi
186
+
187
+ # W7g 🟥 S-2 — ignored 인데 «지우면 아픈» 내용물. 1차 수리(«ignored 는 안 막는다»)가 판 구멍이다.
188
+ mk_pair "$T/o"; W="$T/o/wt"; mkdir -p "$W/tracks/_meta" "$W/knowledge/shared" "$W/outputs"
189
+ printf 'tracks/\nknowledge/**/*_paper_draft.md\noutputs/\n' > "$W/.gitignore"
190
+ echo draft > "$W/knowledge/shared/fh_paper_draft.md"; echo art > "$W/outputs/act2.png"
191
+ OUT="$(bash "$SUT" "$W" 2>&1)"; RC=$?
192
+ if printf '%s' "$OUT" | grep -q "safe to"; then
193
+ ng "W7g 미출간 초고·주행 산출을 두고 «safe to remove» 를 찍었다 (rc=$RC) — ignored 완화가 판 구멍"
194
+ elif [ "$RC" -ne 0 ] && printf '%s' "$OUT" | grep -q "fh_paper_draft.md"; then
195
+ ok "W7g ignored 라도 «화이트리스트 밖» 내용물은 막는다 (rc=$RC)"
196
+ else ng "W7g rc=$RC 인데 출력에 초고 이름이 없다"; fi
197
+
198
+ # W7h 🟥 A-5 — git 이 rc=0 으로 끝나면서 경고만 내는 «부분 열거». rc 만 보면 못 본다.
199
+ mk_pair "$T/q"; W="$T/q/wt"; mkdir -p "$W/tracks/_meta" "$W/blocked/inner"
200
+ echo real > "$W/blocked/inner/artifact.md"; chmod 000 "$W/blocked" 2>/dev/null
201
+ OUT="$(bash "$SUT" "$W" 2>&1)"; RC=$?
202
+ chmod 755 "$W/blocked" 2>/dev/null
203
+ # 🟥 초판은 `[ "$RC" -ne 0 ]` 하나였고, 그래서 **크래시(rc=1, `_p: unbound variable`)를 통과로
204
+ # 인증**하고 있었다. 비정상 종료와 «옳게 막힘» 이 레인에서 같은 값이 됐다. rc 값 그 자체 ·
205
+ # 기대 메시지 존재 · 「통과 문구」 부재 · 크래시 문자열 부재 넷을 같이 건다.
206
+ if printf '%s' "$OUT" | grep -q "safe to"; then
207
+ ng "W7h 읽기불가 디렉터리로 열거가 잘렸는데 «safe to remove» 를 찍었다 (rc=$RC)"
208
+ elif printf '%s' "$OUT" | grep -q "unbound variable"; then
209
+ ng "W7h 스크립트가 크래시했다 — 막힌 게 아니라 죽은 것이다 (rc=$RC)"
210
+ elif [ "$RC" -eq 10 ] && printf '%s' "$OUT" | grep -q "PARTIAL"; then
211
+ ok "W7h 부분 열거 → rc=10 «PARTIAL» (크래시도 초록도 아니다)"
212
+ else ng "W7h rc=$RC (기대 10) 또는 PARTIAL 문구 없음"; fi
213
+
214
+ # W7i 🟥 A-4 — SKIP 이 0 이 아닐 때 초록 문장이 그 사실을 데리고 나가나.
215
+ mk_pair "$T/r"; W="$T/r/wt"; mkdir -p "$W/tracks/_meta" "$W/node_modules"
216
+ printf 'tracks/\nnode_modules/\n' > "$W/.gitignore"; echo j > "$W/node_modules/p.js"
217
+ OUT="$(bash "$SUT" "$W" 2>&1)"; RC=$?
218
+ [ "$RC" -eq 0 ] && printf '%s' "$OUT" | grep -q "skipped as regenerable/sentinel" \
219
+ && ok "W7i 초록 문장이 «무엇을 건너뛰었는지» 를 데리고 나간다" \
220
+ || ng "W7i rc=$RC — «nothing left» 가 SKIP 을 가린다"
221
+
222
+ echo "── W8 3라운드 적대검증 (같은 계열 + 다른 계열 두 팔) ──"
223
+ # 🟥 셋 다 «2R 수리가 만든» 것이다. 1R→2R→3R 세 라운드 연속 같은 방향이었다.
224
+
225
+ # W8a 🟥 S-3 — 화이트리스트가 «undo 가 없는» 설정 파일을 통과시켰다(같은 계열 팔).
226
+ mk_pair "$T/s"; W="$T/s/wt"; mkdir -p "$W/tracks/_meta" "$W/.claude"
227
+ printf 'tracks/\n.claude/settings.json*\n.claude/settings.local.json*\n' > "$W/.gitignore"
228
+ echo '{"hooks":{}}' > "$W/.claude/settings.json"; echo '{"permissions":{}}' > "$W/.claude/settings.local.json"
229
+ # 🟥 4R 정정: 3R 은 이걸 «차단» 으로 고쳤는데 그게 A-3(영구 rc=1 → --force 훈련) 재발이었다.
230
+ # 실측이 결론을 바꿨다 — 갓 만든 워크트리는 ignored 파일이 **0건**이고, 워크트리의
231
+ # settings 는 «그 워크트리 세션이 만든 것» 이다. 그래서 차단도 무음 SKIP 도 아니고
232
+ # **CONFIG — 안 막되 초록 문장이 이름으로 데리고 나간다**.
233
+ OUT="$(bash "$SUT" "$W" 2>&1)"; RC=$?
234
+ if [ "$RC" -ne 0 ]; then
235
+ ng "W8a 워크트리-로컬 settings 로 막았다 (rc=$RC) — 거의 모든 워크트리에 있어 영구 차단이 된다"
236
+ elif printf '%s' "$OUT" | grep -q "CONFIG .claude/settings.local.json" \
237
+ && printf '%s' "$OUT" | grep -q "WILL BE DESTROYED"; then
238
+ ok "W8a 워크트리-로컬 settings 는 «안 막되 파괴된다고 이름으로» 말한다 (rc=0)"
239
+ else ng "W8a rc=0 인데 CONFIG 줄이나 «WILL BE DESTROYED» 경고가 없다 — 조용히 사라진다"; fi
240
+ # 컨트롤: `.bak` 은 여전히 통과해야 한다(진짜 재생성물)
241
+ rm -f "$W/.claude/settings.json" "$W/.claude/settings.local.json"
242
+ printf 'tracks/\n.claude/settings*.json.bak\n' > "$W/.gitignore"; echo x > "$W/.claude/settings.json.bak"
243
+ OUT="$(bash "$SUT" "$W" 2>&1)"; RC=$?
244
+ [ "$RC" -eq 0 ] && ok "W8b 컨트롤: «.bak» 은 통과한다 — 원본만 조인 것이지 통째로 막은 게 아니다" \
245
+ || ng "W8b «.bak» 까지 막았다 (rc=$RC) — 과차단"
246
+
247
+ # W8c 🟥 다른 계열 팔의 단독 발견 — 워크트리에만 있는 스크린샷 증거.
248
+ mk_pair "$T/t"; W="$T/t/wt"; mkdir -p "$W/tracks/_meta" "$W/.playwright-mcp"
249
+ printf 'tracks/\n.playwright-mcp/\n' > "$W/.gitignore"; echo shot > "$W/.playwright-mcp/evidence.png"
250
+ OUT="$(bash "$SUT" "$W" 2>&1)"; RC=$?
251
+ [ "$RC" -ne 0 ] && printf '%s' "$OUT" | grep -q "evidence.png" \
252
+ && ok "W8c 워크트리 전용 스크린샷 증거를 막는다" \
253
+ || ng "W8c rc=$RC — .playwright-mcp 가 «재생성 가능» 으로 통과했다"
254
+
255
+ # W8d 🟥 A-10 — 손실 클래스가 «regenerable» 로 라벨되고 같은 경로가 두 번 렌더됐다.
256
+ mk_pair "$T/u"; W="$T/u/wt"; mkdir -p "$W/tracks/_meta"; echo sig > "$W/tracks/_meta/x.md"
257
+ OUT="$(bash "$SUT" "$W" 2>&1)"; RC=$?
258
+ if printf '%s' "$OUT" | grep -q "SKIP tracks/"; then
259
+ ng "W8d tracks/ 파일이 «regenerable 로 건너뜀» 으로 보고됐다 — 이 도구가 지키려는 바로 그 클래스다"
260
+ elif [ "$RC" -ne 0 ] && printf '%s' "$OUT" | grep -q "ONLY _meta/x.md"; then
261
+ ok "W8d tracks/ 는 자기 구역에서만 판정된다 — 이중 렌더 없음 (rc=$RC)"
262
+ else ng "W8d rc=$RC / ONLY 줄 없음"; fi
263
+
264
+ # W8e 🟥 A-11 — `tracks/` 가 ignored «가 아닌» 소비자 레포. 레인 픽스처엔 이 형태가 없었다.
265
+ T2="$T/v"; mkdir -p "$T2" && ( cd "$T2" && git init -q main && cd main \
266
+ && git config user.email l@example.invalid && git config user.name lane \
267
+ && printf '# no tracks rule\n' > .gitignore && echo x > README.md \
268
+ && git add -A && git commit -qm init && git worktree add -q ../wt -b wt-b ) >/dev/null 2>&1
269
+ W="$T2/wt"; M="$T2/main"; mkdir -p "$W/tracks/_meta"; echo sig > "$W/tracks/_meta/x.md"
270
+ OUT="$(bash "$SUT" "$W" --apply 2>&1)"; RC=$?
271
+ if printf '%s' "$OUT" | grep -q "OUTSIDE tracks/"; then
272
+ ng "W8e tracks/ 가 ignored 아닌 레포에서 «NOT auto-copied» 라고 하면서 실제로는 복사했다 — 영구 rc=1"
273
+ elif [ -f "$M/tracks/_meta/x.md" ]; then
274
+ OUT2="$(bash "$SUT" "$W" 2>&1)"; RC2=$?
275
+ [ "$RC2" -eq 0 ] && ok "W8e tracks/ 가 ignored 아니어도 회수되고, 재실행이 rc=0 으로 «풀린다»" \
276
+ || ng "W8e 회수는 됐는데 재실행 rc=$RC2 — 게이트가 안 풀린다"
277
+ else ng "W8e --apply 가 tracks/ 를 회수하지 못했다 (rc=$RC)"; fi
278
+
279
+ # W8f 🟥 A-9 — 화이트리스트가 이 레포 자신의 `.gitignore` 와 대조된 적이 없었다.
280
+ # 눈으로는 다시 안 맞춰지는 드리프트라 레인이 대조한다.
281
+ GI="$ROOT/.gitignore"
282
+ if [ -f "$GI" ]; then
283
+ miss=0; checked=0; names=""
284
+ for tok in .claude/.outbound_hook_uncalibrated_notice .claude/be_last_sync \
285
+ .claude/.prior_art_events.tsv .claude/.proposal_hook_events.tsv \
286
+ .claude/.outbound_hook_events.tsv; do
287
+ grep -qF "$tok" "$GI" || continue # 이 레포에 없는 항목은 대조 대상이 아니다
288
+ checked=$((checked+1))
289
+ grep -qF "$tok" "$SUT" || { miss=$((miss+1)); names="$names $tok"; }
290
+ done
291
+ # 🟥 4R B — 종전 판은 `.gitignore` 에 토큰이 없으면 조용히 `continue` 해서 **«대조 0건인데
292
+ # 초록»** 을 냈다. 실증: 그 다섯 줄을 지운 `.gitignore` 로 돌려도 42/0 이었다.
293
+ # 이 레포 자신의 결함 일가(「미측정을 0으로」)가 레인 안에서 재발한 자리다.
294
+ if [ "$checked" -eq 0 ]; then
295
+ ng "W8f 대조한 토큰이 0개다 — 「대조했다」가 아니라 「대조할 게 없었다」(NOT a pass)"
296
+ elif [ "$miss" -eq 0 ]; then
297
+ ok "W8f .gitignore 의 센티널 $checked 개를 대조했고 전부 화이트리스트에 있다"
298
+ else
299
+ ng "W8f 화이트리스트에 없는 센티널 $miss/$checked 개:$names — 재생성물이 제거를 막는다"
300
+ fi
301
+ else
302
+ ng "W8f .gitignore 를 못 찾았다 — 대조 «안 한» 것이지 통과가 아니다"
303
+ fi
304
+
305
+ echo "── W9 4라운드 (다른 계열, 3R 수리만 겨냥) ──"
306
+
307
+ # W9a 🟥 컨트롤 — CONFIG 완화가 «차단» 을 통째로 끄지 않았나.
308
+ mk_pair "$T/w"; W="$T/w/wt"; mkdir -p "$W/tracks/_meta" "$W/.claude" "$W/knowledge"
309
+ printf 'tracks/\n.claude/settings.json*\n.claude/settings.local.json*\nknowledge/*_draft.md\n' > "$W/.gitignore"
310
+ echo '{}' > "$W/.claude/settings.local.json"; echo draft > "$W/knowledge/paper_draft.md"
311
+ OUT="$(bash "$SUT" "$W" 2>&1)"; RC=$?
312
+ [ "$RC" -ne 0 ] && printf '%s' "$OUT" | grep -q "paper_draft.md" \
313
+ && ok "W9a CONFIG 완화가 «화이트리스트 밖 ignored 내용물» 차단을 안 껐다 (rc=$RC)" \
314
+ || ng "W9a rc=$RC — settings 완화가 차단을 통째로 껐다"
315
+
316
+ # W9b 🟥 4R B — `LC_ALL=C` 가 장식인지. 되돌려도 안 빨개졌다(diff 출력 파싱이 로케일 의존인데도).
317
+ # 행동 레인을 못 지으니(이 머신 diff 의 NLS 유무가 미상) **기록의 성질**을 단언한다.
318
+ # §Mechanization Boundary: 채널(그 호출이 로케일을 고정하나)은 기계화하고, 진위는 안 묻는다.
319
+ if grep -q 'LC_ALL=C git -C "$WT"' "$SUT" && grep -q 'LC_ALL=C diff -rq' "$SUT"; then
320
+ ok "W9b 열거기 둘 다 로케일 고정 — 정적 단언(행동 레인 아님, 잔여로 명시)"
321
+ else
322
+ ng "W9b git status 또는 diff 의 LC_ALL=C 가 빠졌다 — 번역된 경고/출력이 조용히 폐기된다"
323
+ fi
324
+
325
+ # W9c 🟥 ZONE 이 «판정을 쥐지 않는다» 를 확인 — tracks 가 회수되면 재실행이 rc=0 으로 풀려야 한다.
326
+ mk_pair "$T/x"; M="$T/x/main"; W="$T/x/wt"; mkdir -p "$W/tracks/_meta"; echo sig > "$W/tracks/_meta/z.md"
327
+ bash "$SUT" "$W" --apply >/dev/null 2>&1
328
+ OUT="$(bash "$SUT" "$W" 2>&1)"; RC=$?
329
+ [ "$RC" -eq 0 ] && [ -f "$M/tracks/_meta/z.md" ] \
330
+ && ok "W9c ZONE 은 판정을 안 쥔다 — 회수 뒤 재실행이 rc=0 으로 풀린다" \
331
+ || ng "W9c rc=$RC / 회수됨=$([ -f "$M/tracks/_meta/z.md" ] && echo 1 || echo 0)"
66
332
 
67
333
  echo
68
334
  echo "── worktree-reclaim lanes: PASS=$PASS FAIL=$FAIL ──"