@chrono-meta/fh-gate 2.13.0 → 2.15.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 (90) hide show
  1. package/.claude/rules/fh_4axis_gate.md +35 -1
  2. package/.claude-plugin/marketplace.json +2 -2
  3. package/AGENTS.md +50 -0
  4. package/CLAUDE.md +14 -1
  5. package/README.ja.md +3 -3
  6. package/README.ko.md +3 -3
  7. package/README.md +4 -4
  8. package/README.zh.md +3 -3
  9. package/docs/ETHOS.md +21 -0
  10. package/docs/IDENTITIES.md +83 -0
  11. package/knowledge/shared/harness-core/fh_detail_protocols.md +77 -1
  12. package/knowledge/shared/harness-core/measurement-integrity-checklist.md +80 -0
  13. package/knowledge/shared/harness-core/ship_readiness_gate.md +199 -5
  14. package/knowledge/shared/learnings/subagent_invocations_log.yaml +173 -0
  15. package/knowledge/shared/rules/multi_session_close_protocol.md +7 -1
  16. package/package.json +23 -2
  17. package/plugins/fh-commons/.claude-plugin/plugin.json +2 -2
  18. package/plugins/fh-commons/skills/preprep/README.md +45 -0
  19. package/plugins/fh-commons/skills/preprep/SKILL.md +214 -0
  20. package/plugins/fh-commons/skills/preprep/canon_terms.example.yaml +36 -0
  21. package/plugins/fh-commons/skills/preprep/fixtures/adjdup_known_negative.md +7 -0
  22. package/plugins/fh-commons/skills/preprep/fixtures/adjdup_known_positive.md +8 -0
  23. package/plugins/fh-commons/skills/preprep/fixtures/progression_known_negative.md +13 -0
  24. package/plugins/fh-commons/skills/preprep/fixtures/progression_known_positive.md +13 -0
  25. package/plugins/fh-commons/skills/preprep/fixtures/promise_known_negative.md +9 -0
  26. package/plugins/fh-commons/skills/preprep/fixtures/promise_known_positive.md +7 -0
  27. package/plugins/fh-commons/skills/preprep/interslide_deps.py +223 -0
  28. package/plugins/fh-commons/skills/preprep/jargon_terms.example.yaml +40 -0
  29. package/plugins/fh-commons/skills/preprep/lane_adjacent_dup.py +86 -0
  30. package/plugins/fh-commons/skills/preprep/lane_progression.py +81 -0
  31. package/plugins/fh-commons/skills/preprep/lane_promise.py +121 -0
  32. package/plugins/fh-commons/skills/preprep/ooxml/c1_baseline.txt +12 -0
  33. package/plugins/fh-commons/skills/preprep/ooxml/gate.py +164 -0
  34. package/plugins/fh-commons/skills/preprep/preprep.py +789 -0
  35. package/plugins/fh-commons/skills/preprep/presentation_checklist.md +310 -0
  36. package/plugins/fh-commons/skills/preprep/surfaces.example.yaml +148 -0
  37. package/plugins/fh-meta/.claude-plugin/plugin.json +1 -1
  38. package/plugins/fh-meta/CHANGELOG.md +140 -0
  39. package/plugins/fh-meta/skills/install-wizard/SKILL.md +39 -0
  40. package/scripts/com.forge-harness.daily-report.plist +44 -0
  41. package/scripts/context_continuity_score.sh +894 -0
  42. package/scripts/daily_report.sh +208 -0
  43. package/scripts/digest_landing_check.sh +71 -0
  44. package/scripts/directional_diff_gate.sh +11 -4
  45. package/scripts/fh_session_load.sh +19 -0
  46. package/scripts/field_canon_preload.sh +44 -0
  47. package/scripts/fixture_guard_lib.sh +55 -0
  48. package/scripts/lane_runner_check.sh +34 -1
  49. package/scripts/launchd_wiring_check.sh +182 -0
  50. package/scripts/mapped_tracks.sh +69 -0
  51. package/scripts/novelty_claim_check.sh +5 -1
  52. package/scripts/package_coverage_check.sh +39 -0
  53. package/scripts/portability_lint.sh +117 -0
  54. package/scripts/prepush_guard_check.sh +2 -2
  55. package/scripts/public_surface_scan_files.sh +36 -1
  56. package/scripts/selfcheck.sh +171 -1
  57. package/scripts/session_close_check.sh +17 -0
  58. package/scripts/shell_name_boundary_scan.sh +30 -0
  59. package/scripts/sim_isolated_run.sh +484 -0
  60. package/scripts/test_branch_claim_lanes.sh +8 -3
  61. package/scripts/test_env_purity_lanes.sh +4 -1
  62. package/scripts/test_lane_runner_lanes.sh +75 -0
  63. package/scripts/test_mapped_tracks_lanes.sh +64 -2
  64. package/scripts/test_marker_address_lanes.sh +78 -0
  65. package/scripts/test_marker_soul_check_lanes.sh +36 -0
  66. package/scripts/test_memory_link_check.sh +3 -1
  67. package/scripts/test_node_check_lanes.sh +5 -2
  68. package/scripts/test_node_infra_delta_lanes.sh +3 -1
  69. package/scripts/test_peer_worktree_detect_lanes.sh +3 -1
  70. package/scripts/test_precommit_staged_drift_lanes.sh +91 -0
  71. package/scripts/test_preprep_adjacent_dup_lanes.sh +57 -0
  72. package/scripts/test_preprep_drift_anchor.sh +65 -0
  73. package/scripts/test_preprep_progression_lanes.sh +53 -0
  74. package/scripts/test_preprep_promise_lanes.sh +56 -0
  75. package/scripts/test_preprep_retired_lanes.sh +54 -0
  76. package/scripts/test_prepush_destructive_lanes.sh +5 -2
  77. package/scripts/test_prepush_stdin_integrity.sh +2 -2
  78. package/scripts/test_regression_guard_ci_lanes.sh +4 -1
  79. package/scripts/test_selfcheck_state_lanes.sh +19 -4
  80. package/scripts/test_session_close_lanes.sh +5 -5
  81. package/scripts/test_sim_isolated_run_lanes.sh +265 -0
  82. package/scripts/test_skill_canon_preload_lanes.sh +58 -0
  83. package/scripts/test_target_freeze_lanes.sh +3 -1
  84. package/scripts/test_verdict_watermark_lanes.sh +427 -0
  85. package/scripts/test_wizard_snippet_merge_lanes.sh +4 -1
  86. package/scripts/universal_guard_check.sh +1 -1
  87. package/templates/.git-hooks/pre-commit +426 -8
  88. package/templates/.git-hooks/pre-push +8 -3
  89. package/templates/predelete_check.sh +4 -2
  90. package/templates/regression_guard.sh +7 -1
@@ -327,6 +327,25 @@ fi
327
327
  # catch the eye. Fixing it is one line in validate.yml (set core.hooksPath before the selfcheck step)
328
328
  # and is deliberately NOT bundled here — see the handoff. Until then the only real measurement arm is
329
329
  # the author's machine, which is the exact shape portability_lint.sh was written to condemn.
330
+ # ── prepush-guard known-pair (2026-08-31 배선) ─────────────────────────────────────────
331
+ # WHY: 이 스크립트는 pre-push 게이트의 known-pair 앵커인데 **아무도 부르지 않았다**.
332
+ # 그리고 그것이 실사고의 출처였다 — 픽스처 루트가 빈 값이 되면 레포 루트에 파일 13개를
333
+ # 뿌린다(2026-08-31 고장 주입으로 재현: `mktemp` 가 rc=0 으로 빈 출력을 낼 때).
334
+ # 「호출부가 없는 앵커는 산문」이므로 배선한다. 종료코드 계약은 0=통과 / 그 외=실패.
335
+ if [ ! -f scripts/prepush_guard_check.sh ]; then
336
+ _absent_subject_verdict "prepush-guard known-pair" "scripts/prepush_guard_check.sh" || fail=1
337
+ else
338
+ # 🟥 파이프 앞에서 rc 를 잡는다 — 표시 필터의 rc 를 읽으면 실패가 0 으로 보인다.
339
+ _pg_out="$(bash scripts/prepush_guard_check.sh 2>&1)"; _pg_rc=$?
340
+ if [ "$_pg_rc" -eq 0 ]; then
341
+ echo "PASS prepush-guard known-pair"
342
+ else
343
+ echo "FAIL prepush-guard known-pair (rc=$_pg_rc)"
344
+ [ -n "$_pg_out" ] && printf '%s\n' "$_pg_out" | tail -12 | sed 's/^/ /'
345
+ fail=1
346
+ fi
347
+ fi
348
+
330
349
  if [ ! -f scripts/gate_anchor_check.sh ]; then
331
350
  _absent_subject_verdict "gate-anchor harness" "scripts/gate_anchor_check.sh" || fail=1
332
351
  else
@@ -586,6 +605,16 @@ for _pair in \
586
605
  "templates/.git-hooks/pre-commit|scripts/test_marker_standpoint_lanes.sh" \
587
606
  "templates/.git-hooks/pre-commit|scripts/test_marker_thirdparty_lanes.sh" \
588
607
  "templates/.git-hooks/pre-commit|scripts/test_marker_soul_check_lanes.sh" \
608
+ "templates/.git-hooks/pre-commit|scripts/test_marker_soul_tenet_lanes.sh" \
609
+ "scripts/sim_isolated_run.sh|scripts/test_sim_path_isolation_lanes.sh" \
610
+ "templates/.git-hooks/pre-commit|scripts/test_marker_first_use_lanes.sh" \
611
+ "scripts/fixture_guard_lib.sh|scripts/test_fixture_guard_lanes.sh" \
612
+ "scripts/stray_path_scan.sh|scripts/test_stray_path_lanes.sh" \
613
+ "scripts/session_close_check.sh|scripts/test_stray_path_lanes.sh" \
614
+ "templates/.git-hooks/pre-commit|scripts/test_hook_leg_wiring_lanes.sh" \
615
+ ".claude/soul_tenets.txt|scripts/test_marker_soul_tenet_lanes.sh" \
616
+ "templates/.git-hooks/pre-commit|scripts/test_precommit_staged_drift_lanes.sh" \
617
+ "templates/.git-hooks/pre-commit|scripts/test_marker_address_lanes.sh" \
589
618
  "scripts/residency_closure_scan.py|scripts/test_residency_closure_lanes.sh" \
590
619
  "scripts/reviewer_capability_corpus.tsv|scripts/test_reviewer_capability_conformance.sh" \
591
620
  "scripts/field_canon_preload.sh|scripts/test_field_canon_lanes.sh" \
@@ -595,7 +624,19 @@ for _pair in \
595
624
  "scripts/script_caller_ratchet.sh|scripts/test_runner_surface_index_lanes.sh" \
596
625
  "scripts/mapped_tracks.sh|scripts/test_mapped_tracks_lanes.sh" \
597
626
  "scripts/fh-goal.sh|scripts/test_fh_goal_change_detection_lanes.sh" \
598
- "scripts/utterance_skill_probe.sh|scripts/test_utterance_skill_probe_lanes.sh"
627
+ "scripts/utterance_skill_probe.sh|scripts/test_utterance_skill_probe_lanes.sh" \
628
+ `# ── preprep 스킬(2026-08-29). 주체는 스킬 안의 모듈이라 scripts/ 밖이다 ──` \
629
+ "plugins/fh-commons/skills/preprep/preprep.py|scripts/test_preprep_retired_lanes.sh" \
630
+ "plugins/fh-commons/skills/preprep/lane_progression.py|scripts/test_preprep_progression_lanes.sh" \
631
+ "plugins/fh-commons/skills/preprep/lane_adjacent_dup.py|scripts/test_preprep_adjacent_dup_lanes.sh" \
632
+ "plugins/fh-commons/skills/preprep/lane_promise.py|scripts/test_preprep_promise_lanes.sh" \
633
+ "plugins/fh-commons/skills/preprep/SKILL.md|scripts/test_preprep_drift_anchor.sh" \
634
+ "scripts/field_canon_preload.sh|scripts/test_skill_canon_preload_lanes.sh" \
635
+ `# ── round/ 회차 계기 4종(2026-09-01). 넷 다 한 스위트가 잡는다 — 주체별로 행을 둔다 ──` \
636
+ "scripts/round/delta_guard.sh|scripts/test_round_instruments_lanes.sh" \
637
+ "scripts/round/target_pin.sh|scripts/test_round_instruments_lanes.sh" \
638
+ "scripts/round/instrument_manifest.sh|scripts/test_round_instruments_lanes.sh" \
639
+ "scripts/round/eligcheck_qset.sh|scripts/test_round_instruments_lanes.sh"
599
640
  do
600
641
  _subj="${_pair%%|*}"; _anc="${_pair##*|}"; _lbl="${_anc##*/}"
601
642
  if [ ! -f "$_subj" ]; then
@@ -749,6 +790,25 @@ for _subj in compaction_probe judgment_circuit_lint novelty_claim_check chamber_
749
790
  fi
750
791
  done
751
792
 
793
+ # 🟥 `soul_trace.sh` 는 위 루프에 넣지 않고 **명시 호출**한다 (2026-08-30).
794
+ # 루프는 `scripts/$_subj.sh` 로 경로를 조립하므로 **리터럴 grep 에 안 잡힌다** —
795
+ # CI 의 caller-zero ratchet 이 그것을 «호출부 0» 으로 잡았고, 그 판정이 옳다:
796
+ # 「호출된다」를 사람 눈으로만 확인할 수 있으면 그건 배선의 증거가 아니다.
797
+ # 오늘 아침 `digest_landing_check` 에서 본 것과 같은 형태다.
798
+ # 🟥 그리고 이 블록의 초판은 이 파일에 없는 변수(`$ROOT`·`$RC`)를 써서 **selfcheck 자체를
799
+ # 죽였다**(`ROOT: unbound variable`, 770줄). 관행은 상대경로 + `fail=1` 이다.
800
+ if [ ! -f "scripts/soul_trace.sh" ]; then
801
+ _absent_subject_verdict "soul_trace --self-test" "scripts/soul_trace.sh" || fail=1
802
+ else
803
+ if _st_out=$(bash scripts/soul_trace.sh --self-test 2>&1); then
804
+ echo "PASS soul_trace --self-test ($(printf '%s' "$_st_out" | grep -c '✅') lanes)"
805
+ else
806
+ echo "FAIL soul_trace --self-test"
807
+ printf '%s\n' "$_st_out" | grep '❌' | head -5
808
+ fail=1
809
+ fi
810
+ fi
811
+
752
812
  # capability_registry_check — one of the 4 embedded --self-test subjects lane_runner_check.sh
753
813
  # flagged (2026-08-15), kept out of the loop above (see that loop's comment) because its own
754
814
  # terminal line is `통과 N · 실패 N`, never 캘리브레이션 — gate on exit code instead, same shape
@@ -1065,6 +1125,116 @@ else
1065
1125
  fail=1
1066
1126
  fi
1067
1127
 
1128
+ # The isolated sim runner gets the same treatment, and it earned it in one session. Its lanes are
1129
+ # hermetic (the `claude` CLI is stubbed), so running them is free — and L8a is the lane that caught
1130
+ # a FALSE FINDING already published into CLAUDE.md: the runner still passed `--restricted` at the
1131
+ # call site after the flag had been "made opt-in" in the tools array, so every arm ran with the
1132
+ # project CLAUDE.md removed, and a two-variable comparison was written up as one. Without this
1133
+ # suite that retraction does not happen. Subject-present-but-anchor-absent is a FAIL, not a skip.
1134
+ if [ ! -f scripts/sim_isolated_run.sh ]; then
1135
+ _absent_subject_verdict "test_sim_isolated_run_lanes.sh" "scripts/sim_isolated_run.sh" || fail=1
1136
+ elif [ -f scripts/test_sim_isolated_run_lanes.sh ]; then
1137
+ if ! bash scripts/test_sim_isolated_run_lanes.sh; then
1138
+ fail=1
1139
+ fi
1140
+ else
1141
+ echo "FAIL test_sim_isolated_run_lanes.sh: sim_isolated_run.sh present but its anchor is missing"
1142
+ fail=1
1143
+ fi
1144
+
1145
+ # 무효 워터마크 — 무효 회차의 «숫자 줄»이 자기 무효를 나르는가.
1146
+ # 🟥 회차 3 은 자기 게이트가 VOID 를 찍고도 그 숫자만 기록으로 넘어갔다(VOID 낱말은 0회).
1147
+ # 판정이 표 «밖»에 있었고 사람은 표를 복사하기 때문이다. 그 채널을 닫은 배선의 앵커다.
1148
+ # subject-present-but-anchor-absent 는 SKIP 이 아니라 FAIL 이다 — 여기서도 같은 형태를 쓴다.
1149
+ if [ ! -f scripts/context_continuity_score.sh ]; then
1150
+ _absent_subject_verdict "test_verdict_watermark_lanes.sh" "scripts/context_continuity_score.sh" || fail=1
1151
+ elif [ -f scripts/test_verdict_watermark_lanes.sh ]; then
1152
+ if ! bash scripts/test_verdict_watermark_lanes.sh; then
1153
+ fail=1
1154
+ fi
1155
+ else
1156
+ echo "FAIL test_verdict_watermark_lanes.sh: context_continuity_score.sh present but its anchor is missing"
1157
+ fail=1
1158
+ fi
1159
+
1160
+ # 무효 워터마크 — 무효 회차의 «숫자 줄»이 자기 무효를 나르는가.
1161
+ # 🟥 회차 3 은 자기 게이트가 VOID 를 찍고도 그 숫자만 기록으로 넘어갔다(VOID 낱말은 0회).
1162
+ # 판정이 표 «밖»에 있었고 사람은 표를 복사하기 때문이다. 그 채널을 닫은 배선의 앵커다.
1163
+ # subject-present-but-anchor-absent 는 SKIP 이 아니라 FAIL 이다 — 여기서도 같은 형태를 쓴다.
1164
+ if [ ! -f scripts/context_continuity_score.sh ]; then
1165
+ _absent_subject_verdict "test_verdict_watermark_lanes.sh" "scripts/context_continuity_score.sh" || fail=1
1166
+ elif [ -f scripts/test_verdict_watermark_lanes.sh ]; then
1167
+ if ! bash scripts/test_verdict_watermark_lanes.sh; then
1168
+ fail=1
1169
+ fi
1170
+ else
1171
+ echo "FAIL test_verdict_watermark_lanes.sh: context_continuity_score.sh present but its anchor is missing"
1172
+ fail=1
1173
+ fi
1174
+
1175
+ # 무효 워터마크 — 무효 회차의 «숫자 줄»이 자기 무효를 나르는가.
1176
+ # 🟥 회차 3 은 자기 게이트가 VOID 를 찍고도 그 숫자만 기록으로 넘어갔다(VOID 낱말은 0회).
1177
+ # 판정이 표 «밖»에 있었고 사람은 표를 복사하기 때문이다. 그 채널을 닫은 배선의 앵커다.
1178
+ # subject-present-but-anchor-absent 는 SKIP 이 아니라 FAIL 이다 — 여기서도 같은 형태를 쓴다.
1179
+ if [ ! -f scripts/context_continuity_score.sh ]; then
1180
+ _absent_subject_verdict "test_verdict_watermark_lanes.sh" "scripts/context_continuity_score.sh" || fail=1
1181
+ elif [ -f scripts/test_verdict_watermark_lanes.sh ]; then
1182
+ if ! bash scripts/test_verdict_watermark_lanes.sh; then
1183
+ fail=1
1184
+ fi
1185
+ else
1186
+ echo "FAIL test_verdict_watermark_lanes.sh: context_continuity_score.sh present but its anchor is missing"
1187
+ fail=1
1188
+ fi
1189
+
1190
+ # daily_report — 어제 커밋 집계. 자기검사 10 레인(known-pair · 멱등 · 부재 표기).
1191
+ # 🟥 이 파일은 «한 번 존재했다가 사라진» 이력이 있다 — 2026-08-29 에 산출물 1건을 내고
1192
+ # git 에 커밋된 적 없이 없어졌고, 로컬 바인딩만 「설치됨」이라 적고 있었다. 배선이
1193
+ # 그 재발을 막는 층이다. subject 있는데 anchor 없으면 FAIL 이지 skip 이 아니다.
1194
+ if [ ! -f scripts/daily_report.sh ]; then
1195
+ _absent_subject_verdict "daily_report --self-test" "scripts/daily_report.sh" || fail=1
1196
+ else
1197
+ if ! bash scripts/daily_report.sh --self-test >/dev/null 2>&1; then
1198
+ echo "FAIL daily_report --self-test"
1199
+ bash scripts/daily_report.sh --self-test 2>&1 | grep '❌' | head -5
1200
+ fail=1
1201
+ else
1202
+ echo "PASS daily_report --self-test (10 lanes)"
1203
+ fi
1204
+ fi
1205
+
1206
+ # launchd_wiring_check — 주기 실행(frontier-digest)이 실제로 배선됐나. 자기검사 10 레인.
1207
+ # 🟥 이 검사가 없던 동안, 추적본 plist 는 «템플릿»(/path/to/ 플레이스홀더)인데 «바꿨는지»도
1208
+ # «걸렸는지»도 보는 것이 0개였다. 소비자는 digest 가 돈다고 믿으면서 한 번도 안 도는 상태로
1209
+ # 지낼 수 있었고 그 부재는 아무 신호도 안 냈다. subject 있는데 anchor 없으면 FAIL 이다.
1210
+ if [ ! -f scripts/launchd_wiring_check.sh ]; then
1211
+ _absent_subject_verdict "launchd_wiring_check --self-test" "scripts/launchd_wiring_check.sh" || fail=1
1212
+ else
1213
+ if ! bash scripts/launchd_wiring_check.sh --self-test >/dev/null 2>&1; then
1214
+ echo "FAIL launchd_wiring_check --self-test"
1215
+ bash scripts/launchd_wiring_check.sh --self-test 2>&1 | grep '❌' | head -5
1216
+ fail=1
1217
+ else
1218
+ echo "PASS launchd_wiring_check --self-test (10 lanes)"
1219
+ fi
1220
+ fi
1221
+
1222
+ # context_continuity_score — 「압축 후 모델이 여전히 답하나」의 격리 채점기. 자기검사 12 레인.
1223
+ # 🟥 이 배선이 없으면 채점 규칙이 조용히 썩는다. 실제로 이 스크립트는 만든 당일에 세 번 틀렸고
1224
+ # (positive 오채점 · 거절 어휘 누락 · negative 게이트 구멍) 셋 다 이 레인들이 잡는 형태다.
1225
+ # subject 는 있는데 anchor 가 없으면 FAIL 이지 skip 이 아니다.
1226
+ if [ ! -f scripts/context_continuity_score.sh ]; then
1227
+ _absent_subject_verdict "context_continuity_score --self-test" "scripts/context_continuity_score.sh" || fail=1
1228
+ else
1229
+ if ! bash scripts/context_continuity_score.sh --self-test >/dev/null 2>&1; then
1230
+ echo "FAIL context_continuity_score --self-test"
1231
+ bash scripts/context_continuity_score.sh --self-test 2>&1 | grep '❌' | head -5
1232
+ fail=1
1233
+ else
1234
+ echo "PASS context_continuity_score --self-test (12 lanes)"
1235
+ fi
1236
+ fi
1237
+
1068
1238
  # marker axes-run lanes — 훅의 축 자기대조 형식 검사(§CLAUDE.md 3층 자기 대조)의 앵커.
1069
1239
  # ⚠️ 「4축」이라고 적혀 있었는데 2026-08-17 부로 **6축 분기가 생겼다**(마커 날짜 >= 그 날이면
1070
1240
  # 기호 키 ⓐ~ⓕ 요구, 미만이면 옛 ASCII 넷). 산문 층이라 레인은 안 깨지고 조용히 stale 이었다.
@@ -687,5 +687,22 @@ CARRY_EOF
687
687
  fi
688
688
  fi
689
689
 
690
+ # ── ①-e STRAY PATH (advisory) ────────────────────────────────────────────────
691
+ # 🟥 `git status` 는 **빈 디렉터리를 안 보여준다**(`--porcelain` 도 `-uall` 도 0; 파일 하나
692
+ # 넣으면 1 — known-pair 로 확인). 그래서 「트리 깨끗」이 이 클래스에 대해선 **부재 증명이
693
+ # 아니다.** 2026-08-31 하루에 세 번 났고(거버너 레포 2 · 병렬 팔 레포 1) 세 번 다 «깨끗»
694
+ # 보고 뒤에 발견됐다. 그중 하나는 채점기 레인의 전수 grep 을 rc=2 로 죽였다.
695
+ # 🟥 **advisory 다 — 막지 않는다.** 빈 디렉터리 하나로 push 를 막으면 그것이 `--no-verify` 를
696
+ # 훈련시키고, 같은 훅의 Destructive-Op 게이트를 무장해제한다. 시끄럽게 하되 안 막는다.
697
+ if [ -x "$FH/scripts/stray_path_scan.sh" ]; then
698
+ _sp_out=$(bash "$FH/scripts/stray_path_scan.sh" "$FH" 2>&1); _sp_rc=$?
699
+ case "$_sp_rc" in
700
+ 1) printf '%s\n' "$_sp_out" ;;
701
+ 2) echo "⚠️ ①-e stray-path 스캔 불가 — UNMEASURED (0 으로 읽지 마라)" ;;
702
+ esac
703
+ else
704
+ echo "⚠️ ①-e stray_path_scan.sh 없음 — skipped, not passed"
705
+ fi
706
+
690
707
  echo "── close check: $([ "$FAIL" -eq 0 ] && echo CONSISTENT || echo VIOLATIONS) ──"
691
708
  exit "$FAIL"
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env bash
2
+ # 셸 «이름 경계» 스캐너 — 변수 전개에서 «어디까지가 이름인가»를 셸이 나와 다르게 읽는 자리.
3
+ #
4
+ # 🟥 왜 있나. 2026-08-31 하루에 **세 번** 나왔고 셋 다 자력 적발이 아니었다:
5
+ # ① zsh "$ref:scripts/x" 콜론 뒤를 «modifier» 로 먹는다 — 에러가 아니라 «다른 유효 문자열»
6
+ # ② zsh set -- $pair 인용 없는 전개가 리스트가 안 된다 — 여러 낱말이 한 낱말로
7
+ # ③ bash "$V»" 다국어 문자가 «변수명»에 붙는다 — 이름 `V»` → unbound variable
8
+ # 공통형: **셸이 이름 경계를 다르게 읽는데 그게 조용하다**(①은 완전 무음, ③만 시끄럽다).
9
+ #
10
+ # ⚠️ **이 스캐너는 셋 중 «둘»만 덮는다** — ①과 ③. ②(단어분할)는 문법이 아니라 «의도»라
11
+ # 정적으로 못 가른다. 안 덮는 것을 덮는 척하지 않는다.
12
+ # ⚠️ 주석 안의 히트도 «보고한다» — 제외하면 진짜를 놓치는 쪽으로 기운다. 사람이 판정해라.
13
+ set -uo pipefail
14
+ [ $# -gt 0 ] || { echo "usage: shell_name_boundary_scan.sh <file...>"; exit 2; }
15
+ python3 - "$@" <<'PY'
16
+ import re,sys,io
17
+ NONASCII=re.compile(r'\$[A-Za-z_][A-Za-z0-9_]*(?=[^\x00-\x7F])') # ③
18
+ MODIFIER=re.compile(r'"\$[A-Za-z_][A-Za-z0-9_]*:') # ① (중괄호 없는 "$V:...")
19
+ hits=0
20
+ for f in sys.argv[1:]:
21
+ try: s=io.open(f,encoding='utf-8').read()
22
+ except Exception as e: print(" ⚠️ 읽기 실패 %s: %s (미검사 — 통과 아님)"%(f,e)); hits+=1; continue
23
+ for i,l in enumerate(s.split('\n'),1):
24
+ for m in NONASCII.finditer(l):
25
+ print(" 🟥 %s:%d [비-ASCII가 이름에 붙음] %s → %s"%(f,i,m.group(0),l.strip()[:64])); hits+=1
26
+ for m in MODIFIER.finditer(l):
27
+ print(" 🟥 %s:%d [zsh modifier 로 먹힐 수 있음] %s → %s"%(f,i,m.group(0),l.strip()[:64])); hits+=1
28
+ print(" 히트 %d 건 (0 이면 이 두 얼굴은 없다 — 나머지 하나는 이 계기가 «안 본다»)"%hits)
29
+ sys.exit(1 if hits else 0)
30
+ PY