@chrono-meta/fh-gate 3.25.1 → 3.26.1

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 (86) hide show
  1. package/.claude/regression/probes_live.yaml +9 -3
  2. package/.claude/rules/fh_4axis_gate.md +2 -0
  3. package/.claude-plugin/marketplace.json +4 -4
  4. package/AGENTS.md +69 -13
  5. package/CLAUDE.md +3 -3
  6. package/README.ja.md +90 -379
  7. package/README.ko.md +130 -379
  8. package/README.md +122 -364
  9. package/README.zh.md +90 -346
  10. package/docs/REFERENCE.md +465 -0
  11. package/docs/USER_GUIDE.md +19 -0
  12. package/docs/codex-compat.md +36 -9
  13. package/knowledge/shared/harness-core/agents_md_runtime_details.md +49 -5
  14. package/knowledge/shared/harness-core/multi_model_sidecar_strategy.md +7 -3
  15. package/knowledge/shared/learnings/subagent_invocations_log.yaml +73 -0
  16. package/knowledge/shared/rules/operations.md +3 -2
  17. package/package.json +10 -1
  18. package/plugins/fh-commons/.claude-plugin/plugin.json +1 -1
  19. package/plugins/fh-meta/.claude-plugin/plugin.json +1 -1
  20. package/plugins/fh-meta/CHANGELOG.md +24 -0
  21. package/plugins/fh-meta/skills/prompt-regression/SKILL.md +2 -2
  22. package/plugins/fh-preprep/.claude-plugin/plugin.json +1 -1
  23. package/plugins/fh-preprep/skills/preprep/lane_speech_coach.py +0 -18
  24. package/plugins/fh-qp/.claude-plugin/plugin.json +1 -1
  25. package/scripts/fixtures/generated_harness/P1_r1/.claude/agents/todo-developer.md +28 -0
  26. package/scripts/fixtures/generated_harness/P1_r1/.claude/agents/todo-qa.md +25 -0
  27. package/scripts/fixtures/generated_harness/P1_r1/.claude/skills/harness/SKILL.md +6 -0
  28. package/scripts/fixtures/generated_harness/P1_r1/.claude/skills/todo-dev/SKILL.md +37 -0
  29. package/scripts/fixtures/generated_harness/P1_r1/CLAUDE.md +10 -0
  30. package/scripts/fixtures/generated_harness/P1_r1/tests/test_cli.py +1 -0
  31. package/scripts/fixtures/generated_harness/P1_r1/todo/cli.py +13 -0
  32. package/scripts/fixtures/generated_harness/P2_r2/.claude/agents/note-organizer.md +26 -0
  33. package/scripts/fixtures/generated_harness/P2_r2/.claude/agents/summary-reviewer.md +20 -0
  34. package/scripts/fixtures/generated_harness/P2_r2/.claude/agents/summary-writer.md +23 -0
  35. package/scripts/fixtures/generated_harness/P2_r2/.claude/skills/meeting-notes-organize/SKILL.md +23 -0
  36. package/scripts/fixtures/generated_harness/P2_r2/.claude/skills/weekly-meeting-summary/SKILL.md +39 -0
  37. package/scripts/fixtures/generated_harness/P2_r2/.claude/skills/weekly-summary-write/SKILL.md +25 -0
  38. package/scripts/fixtures/generated_harness/P2_r2/CLAUDE.md +10 -0
  39. package/scripts/fixtures/generated_harness/P2_r2/tests/test_cli.py +1 -0
  40. package/scripts/fixtures/generated_harness/P2_r2/todo/cli.py +13 -0
  41. package/scripts/fixtures/generated_harness/P3_r1/.claude/agents/todo-developer.md +30 -0
  42. package/scripts/fixtures/generated_harness/P3_r1/.claude/agents/todo-reviewer.md +21 -0
  43. package/scripts/fixtures/generated_harness/P3_r1/.claude/agents/todo-tester.md +23 -0
  44. package/scripts/fixtures/generated_harness/P3_r1/.claude/settings.json +11 -0
  45. package/scripts/fixtures/generated_harness/P3_r1/.claude/skills/todo-dev/SKILL.md +38 -0
  46. package/scripts/fixtures/generated_harness/P3_r1/CLAUDE.md +12 -0
  47. package/scripts/fixtures/generated_harness/P3_r1/tests/test_cli.py +1 -0
  48. package/scripts/fixtures/generated_harness/P3_r1/todo/cli.py +13 -0
  49. package/scripts/fixtures/generated_harness/P3_r2/.claude/agents/todo-developer.md +27 -0
  50. package/scripts/fixtures/generated_harness/P3_r2/.claude/agents/todo-reviewer.md +15 -0
  51. package/scripts/fixtures/generated_harness/P3_r2/.claude/agents/todo-tester.md +20 -0
  52. package/scripts/fixtures/generated_harness/P3_r2/.claude/settings.json +12 -0
  53. package/scripts/fixtures/generated_harness/P3_r2/.claude/skills/todo-dev-team/SKILL.md +32 -0
  54. package/scripts/fixtures/generated_harness/P3_r2/CLAUDE.md +12 -0
  55. package/scripts/fixtures/generated_harness/P3_r2/tests/test_cli.py +1 -0
  56. package/scripts/fixtures/generated_harness/P3_r2/todo/cli.py +13 -0
  57. package/scripts/fixtures/generated_harness/P4_r2/.claude/agents/todo-developer.md +27 -0
  58. package/scripts/fixtures/generated_harness/P4_r2/.claude/agents/todo-qa.md +23 -0
  59. package/scripts/fixtures/generated_harness/P4_r2/.claude/skills/todo-dev/SKILL.md +19 -0
  60. package/scripts/fixtures/generated_harness/P4_r2/.claude/skills/todo-orchestrator/SKILL.md +33 -0
  61. package/scripts/fixtures/generated_harness/P4_r2/CLAUDE.md +10 -0
  62. package/scripts/fixtures/generated_harness/P4_r2/tests/test_cli.py +1 -0
  63. package/scripts/fixtures/generated_harness/P4_r2/todo/cli.py +13 -0
  64. package/scripts/gate_bootstrap_ephemeral.sh +0 -2
  65. package/scripts/generated_harness_check.py +740 -0
  66. package/scripts/lane_onoff_compare.py +138 -0
  67. package/scripts/lane_stub_env.allow +5 -0
  68. package/scripts/lane_stub_env.sh +63 -0
  69. package/scripts/mutation_probe.py +0 -5
  70. package/scripts/pr_merge_verified.sh +27 -3
  71. package/scripts/probe_live_eval.sh +1 -1
  72. package/scripts/probe_live_eval_lib.py +2 -2
  73. package/scripts/selfcheck.sh +22 -1
  74. package/scripts/test_axis4_lane_substitute_lanes.sh +93 -0
  75. package/scripts/test_card_drift_probe.sh +7 -0
  76. package/scripts/test_generated_harness_check_lanes.sh +325 -0
  77. package/scripts/test_hook_source_gate_lanes.sh +14 -3
  78. package/scripts/test_lane_stub_env_lanes.sh +218 -0
  79. package/scripts/test_marker_floor_lanes.sh +7 -0
  80. package/scripts/test_pr_merge_verified_lanes.sh +50 -3
  81. package/scripts/test_probe_live_eval_lanes.sh +1 -1
  82. package/scripts/test_push_zone_lanes.sh +6 -0
  83. package/scripts/test_session_close_lanes.sh +7 -0
  84. package/scripts/test_utterance_intake_lanes.sh +20 -1
  85. package/templates/.claude/rules/session.md +11 -0
  86. package/templates/.git-hooks/pre-commit +63 -21
@@ -0,0 +1,218 @@
1
+ #!/usr/bin/env bash
2
+ # test_lane_stub_env_lanes.sh — scripts/lane_stub_env.sh 와 scripts/lane_onoff_compare.py 의 known-pair.
3
+ #
4
+ # 지키는 것 셋: ① 스텁은 허용 목록의 레인 안에서만 켜진다(누출 금지 — 훅·selfcheck 본체·주제 레인)
5
+ # ② 스텁이 켜져도 «무엇을 안 돌렸나» 가 보인다(gh 호출 기록 · ①-g UNMEASURED)
6
+ # ③ 켠/끈 비교기가 «rc 는 같은데 진단이 사라진» 변이를 잡는다(설계 §11)
7
+ set -uo pipefail
8
+ cd "$(dirname "$0")/.." || exit 1
9
+ ROOT="$(pwd -P)"
10
+ H="$ROOT/scripts/lane_stub_env.sh"; CMP="$ROOT/scripts/lane_onoff_compare.py"; ALLOW="$ROOT/scripts/lane_stub_env.allow"
11
+ for f in "$H" "$CMP" "$ALLOW"; do [ -f "$f" ] || { echo "HARNESS-ERROR: ${f##*/} 없음 (NOT a pass)"; exit 3; }; done
12
+ PASS=0; FAIL=0
13
+ ok() { echo "✅ $1"; PASS=$((PASS+1)); }
14
+ ng() { echo "❌ $1"; FAIL=$((FAIL+1)); }
15
+ T=$(mktemp -d) || { echo "HARNESS-ERROR: mktemp"; exit 3; }
16
+ trap 'rm -rf "$T"' EXIT INT TERM
17
+
18
+ # ── ① 누출: 허용 목록 밖 파일은 이 헬퍼를 source 하지 않는다 ──
19
+ leaks() { # $1=검색 루트 → 허용 목록·예외 밖에서 lane_stub_env 를 «언급» 하는 파일 (source 형태를 쫓지 않는다:
20
+ # 변수 경유 `. "$H"` · 확장자 없는 훅도 잡힌다 — codex 구현 R1 A2)
21
+ /usr/bin/grep -rl 'lane_stub_env' "$1" 2>/dev/null | while read -r f; do
22
+ b=$(basename "$f"); rel="${f#"$ROOT"/}" # 허용은 레포 상대 «경로» 로 — 이름 충돌을 막는다(codex 구현 R10)
23
+ case "$rel" in scripts/lane_stub_env.sh|scripts/lane_stub_env.allow|scripts/test_lane_stub_env_lanes.sh) continue ;; esac
24
+ /usr/bin/grep -qxF "$rel" "$ALLOW" && continue
25
+ if [ "$rel" = scripts/selfcheck.sh ] || [ "$b" = selfcheck.sh ]; then # 레인 등록부 줄만 허용
26
+ # 줄 «전체» 가 등록부 문법이어야 한다 — 뒤에 `; . lane_stub_env.sh` 를 붙인 줄은 누출 (codex 구현 R2 A2)
27
+ /usr/bin/grep 'lane_stub_env' "$f" | /usr/bin/grep -vqE '^[[:space:]]*"scripts/lane_(stub_env\.(sh|allow)|onoff_compare\.py)\|scripts/test_lane_stub_env_lanes\.sh"[[:space:]]*\\?$' || continue
28
+ fi
29
+ echo "$f"
30
+ done
31
+ }
32
+ L=$(leaks "$ROOT/scripts"; leaks "$ROOT/templates")
33
+ [ -z "$L" ] && ok "L1 누출 없음: 허용 목록 밖에서 source 하는 파일 0" || ng "L1 누출: $L"
34
+ mkdir -p "$T/leak"; printf '. "$D/lane_stub_env.sh"\n' > "$T/leak/selfcheck.sh"
35
+ [ -n "$(leaks "$T/leak")" ] && ok "L1b 컨트롤: 허용 목록 밖 source 를 잡는다" || ng "L1b 누출 검출기가 장식이다"
36
+ mkdir -p "$T/leak2"; printf 'H="$D/lane_stub_env.sh"\n. "$H"\n' > "$T/leak2/test_x.sh"; printf '#!/bin/sh\n. scripts/lane_stub_env.sh\n' > "$T/leak2/pre-push"
37
+ [ "$(leaks "$T/leak2" | wc -l | tr -d ' ')" = 2 ] && ok "L1c 변수 경유 source · 확장자 없는 훅도 잡는다" || ng "L1c: $(leaks "$T/leak2")"
38
+ mkdir -p "$T/leak3"; printf ' "scripts/lane_stub_env.sh|scripts/test_lane_stub_env_lanes.sh" \\\n' > "$T/leak3/selfcheck.sh"
39
+ [ -z "$(leaks "$T/leak3")" ] && ok "L1d 컨트롤: selfcheck 의 등록부 줄은 누출이 아니다" || ng "L1d 등록부 줄을 누출로 읽는다"
40
+ mkdir -p "$T/leak4"; printf ' "scripts/lane_stub_env.sh|scripts/test_lane_stub_env_lanes.sh"; . scripts/lane_stub_env.sh\n' > "$T/leak4/selfcheck.sh"
41
+ [ -n "$(leaks "$T/leak4")" ] && ok "L1e 등록부 줄 뒤에 source 를 붙이면 누출이다" || ng "L1e 등록부 접두만 보고 뒤를 놓친다"
42
+ for s in scripts/test_session_close_chain_lanes.sh scripts/test_stale_ref_close_lanes.sh templates/.git-hooks/pre-push templates/.git-hooks/pre-commit scripts/selfcheck.sh scripts/session_close_check.sh; do
43
+ /usr/bin/grep -qxF "$s" "$ALLOW" && ng "L2 주제·생산 파일 $s 가 허용 목록에 있다" || ok "L2 $s 는 허용 목록 밖"
44
+ done
45
+
46
+ mkdir -p "$ROOT/templates/.lse_probe_$$"; COL="$ROOT/templates/.lse_probe_$$/test_hook_source_gate_lanes.sh"
47
+ printf '. "$ROOT/scripts/lane_stub_env.sh"\n' > "$COL"
48
+ [ -n "$(leaks "$ROOT/templates/.lse_probe_$$")" ] && ok "L1f 허용된 이름과 같은 «다른 자리» 파일은 누출이다" || ng "L1f 이름 충돌을 허용한다"
49
+ printf '. "%s"\nlane_stub_env_on "%s/colx" gh; echo "rc=$?"\n' "$H" "$T" > "$COL"; mkdir -p "$T/colx"
50
+ case "$(bash "$COL" 2>&1)" in *rc=9*) ok "L3b 이름이 같아도 다른 경로의 호출은 rc=9" ;; *) ng "L3b 이름 충돌로 스텁이 켜졌다" ;; esac
51
+ rm -rf "$ROOT/templates/.lse_probe_$$"
52
+ # ── 허용 목록 거절 · 켬/끔 ──
53
+ cat > "$T/not_allowed.sh" <<EOF
54
+ . "$H"
55
+ lane_stub_env_on "$T/na" gh; echo "rc=\$?"
56
+ EOF
57
+ mkdir -p "$T/na"; out=$(bash "$T/not_allowed.sh" 2>&1)
58
+ case "$out" in *rc=9*HARNESS*|*HARNESS*rc=9*) ok "L3 허용 목록 밖 호출 → rc=9 HARNESS-ERROR" ;; *) ng "L3 거절 안 됨: $out" ;; esac
59
+ mkdir -p "$T/al"; cp "$H" "$T/al/lane_stub_env.sh"; printf 'al/test_fake_lane.sh\n' > "$T/al/lane_stub_env.allow"
60
+ cat > "$T/al/test_fake_lane.sh" <<'EOF'
61
+ . "$(dirname "$0")/lane_stub_env.sh"
62
+ lane_stub_env_on "$1" gh stale-ref || exit 9
63
+ echo "gh=$(command -v gh)"; gh pr list --author @me --state open --json number
64
+ python3 -c 'print("real-py")'
65
+ python3 scripts/stale_ref_scan.py --body x.md; echo "scan_rc=$? scan_out_end"
66
+ lane_stub_env_used gh && echo used-gh; lane_stub_env_used stale-ref && echo used-sr
67
+ EOF
68
+ mkdir -p "$T/on"; out=$(bash "$T/al/test_fake_lane.sh" "$T/on" 2>&1)
69
+ case "$out" in *"gh=$T/on/lane_stub_bin/gh"*) ok "L4 켜면 PATH 맨 앞 gh 가 스텁" ;; *) ng "L4 gh 경로: $out" ;; esac
70
+ printf '%s\n' "$out" | /usr/bin/grep -qx '\[\]' && ok "L5 gh pr list → []" || ng "L5 gh 출력: $out"
71
+ printf '%s\n' "$out" | /usr/bin/grep -qx 'real-py' && ok "L6 다른 python3 호출은 진짜로 넘어간다" || ng "L6 python3 통과 실패: $out"
72
+ printf '%s\n' "$out" | /usr/bin/grep -qx 'scan_rc=0 scan_out_end' && ok "L7 stale_ref_scan.py 는 가로채고 출력 0 (체커가 UNMEASURED 를 낸다)" || ng "L7 가로채기: $out"
73
+ { printf '%s' "$out" | /usr/bin/grep -q used-gh && printf '%s' "$out" | /usr/bin/grep -q used-sr; } && ok "L8 호출 기록: gh · stale-ref 둘 다" || ng "L8 기록: $out"
74
+ cat > "$T/al/test_fake_lane.sh" <<'EOF2'
75
+ . "$(dirname "$0")/lane_stub_env.sh"
76
+ lane_stub_env_on "$1" stale-ref || exit 9
77
+ python3 -c 'raise SystemExit(1)' scripts/stale_ref_scan.py; echo "argrc=$?"
78
+ EOF2
79
+ mkdir -p "$T/w2"; out=$(bash "$T/al/test_fake_lane.sh" "$T/w2" 2>&1)
80
+ case "$out" in *argrc=1*) ok "L7b 인자 어딘가에 스캐너 이름이 있는 다른 python3 실패는 가로채지 않는다(rc=1 그대로)" ;; *) ng "L7b 다른 실패를 삼켰다: $out" ;; esac
81
+ cat > "$T/al/test_fake_lane.sh" <<'EOF2'
82
+ . "$(dirname "$0")/lane_stub_env.sh"
83
+ lane_stub_env_on "$1" gh stale-ref || exit 9
84
+ echo "gh=$(command -v gh)"; gh pr list --author @me --state open --json number
85
+ python3 -c 'print("real-py")'
86
+ python3 scripts/stale_ref_scan.py --body x.md; echo "scan_rc=$? scan_out_end"
87
+ lane_stub_env_used gh && echo used-gh; lane_stub_env_used stale-ref && echo used-sr
88
+ EOF2
89
+ mkdir -p "$T/off"; out=$(FH_LANE_STUB=off bash "$T/al/test_fake_lane.sh" "$T/off" 2>&1)
90
+ case "$out" in *"gh=$T/off/lane_stub_bin/gh"*) ng "L9 끈 상태인데 스텁 gh" ;; *) ok "L9 FH_LANE_STUB=off → 스텁 없음" ;; esac
91
+ mkdir -p "$T/un"; cat > "$T/al/test_fake_lane.sh" <<'EOF'
92
+ . "$(dirname "$0")/lane_stub_env.sh"
93
+ lane_stub_env_on "$1" gh || exit 9
94
+ lane_stub_env_used gh && echo used || echo unused
95
+ EOF
96
+ [ "$(bash "$T/al/test_fake_lane.sh" "$T/un")" = unused ] && ok "L10 안 불린 스텁 → used 거짓 (PATH 가림을 잡는 근거)" || ng "L10 used 가 항상 참"
97
+
98
+ # L12 스텁 PATH 는 레인 «자식» 프로세스 안에만 산다 — 같은 부모가 다음에 부르는 레인으로 넘어가지 않는다
99
+ mkdir -p "$T/inh"; bash "$T/al/test_fake_lane.sh" "$T/inh" >/dev/null 2>&1
100
+ case "$(command -v gh 2>/dev/null)" in "$T"/*) ng "L12 부모 셸에 스텁 gh 가 남았다" ;; *) ok "L12 레인이 끝나면 부모 PATH 에 스텁이 없다" ;; esac
101
+
102
+ # L3c/L3d 상대 경로로 실행된 레인이 cd 한 뒤 source → rc=9 (안내 줄) · 절대 경로 재실행 형태 → 통과
103
+ mkdir -p "$T/al/sub"; cat > "$T/al/test_fake_lane.sh" <<'EOF2'
104
+ cd "$(dirname "$0")/sub" || exit 1
105
+ . ../lane_stub_env.sh
106
+ lane_stub_env_on "$1" gh; echo "rc=$?"
107
+ EOF2
108
+ mkdir -p "$T/rel1"; out=$(cd "$T/al" && bash test_fake_lane.sh "$T/rel1" 2>&1)
109
+ case "$out" in *rc=9*"절대 경로로 다시 실행"*|*"절대 경로로 다시 실행"*rc=9*) ok "L3c 상대 실행 + cd 뒤 source → rc=9 와 안내" ;; *) ng "L3c: $out" ;; esac
110
+ cat > "$T/al/test_fake_lane.sh" <<'EOF2'
111
+ case "$0" in /*) ;; *) exec bash "$(cd "$(dirname "$0")" && pwd -P)/$(basename "$0")" "$@" ;; esac
112
+ cd "$(dirname "$0")/sub" || exit 1
113
+ . ../lane_stub_env.sh
114
+ lane_stub_env_on "$1" gh; echo "rc=$?"
115
+ EOF2
116
+ mkdir -p "$T/rel2"; out=$(cd "$T/al" && bash test_fake_lane.sh "$T/rel2" 2>&1)
117
+ case "$out" in *rc=0*) ok "L3d 절대 경로로 재실행하는 레인은 상대 실행이어도 통과" ;; *) ng "L3d: $out" ;; esac
118
+ /usr/bin/grep -q 'case "$0" in /\*) ;; \*) exec bash' "$ROOT/scripts/test_utterance_intake_lanes.sh" \
119
+ && ok "L3e cd 하는 허용 레인(utterance_intake)이 재실행 줄을 갖고 있다" || ng "L3e utterance_intake 에 재실행 줄이 없다"
120
+
121
+ # ── 체커 통합: 스텁 아래 ①-g 는 «UNMEASURED» 이지 «대상 없음»·«깨끗함» 이 아니다 ──
122
+ cp "$H" "$T/al/lane_stub_env.sh"
123
+ cat > "$T/al/test_fake_lane.sh" <<EOF
124
+ . "\$(dirname "\$0")/lane_stub_env.sh"
125
+ lane_stub_env_on "\$1" gh stale-ref || exit 9
126
+ env -u CLAUDE_CODE_CHILD_SESSION -u CLAUDE_CODE_AGENT bash "$ROOT/scripts/session_close_check.sh" 2>&1 | /usr/bin/grep '①-g'
127
+ EOF
128
+ mkdir -p "$T/int"; out=$(bash "$T/al/test_fake_lane.sh" "$T/int")
129
+ case "$out" in *UNMEASURED*) ok "L11 체커 ①-g = UNMEASURED (스캐너 0회)" ;; *) ng "L11 ①-g 출력: $out" ;; esac
130
+ case "$out" in *"대상 없음"*|*"최신을 가리킨다"*) ng "L11b 스텁 아래 ①-g 가 대상 없음/깨끗함으로 읽힌다" ;; *) ok "L11b «대상 없음»·«깨끗함» 문구 없음" ;; esac
131
+
132
+ # ── ③ 비교기 known-pair ──
133
+ cmpf() { python3 "$CMP" files "$T/c_off" "$T/c_rcoff" "$T/c_on" "$T/c_rcon" "$@" >/dev/null 2>&1; echo $?; }
134
+ base=$'✅ L1 a 1\n✅ L2 b\n⚠️ ①-g stale-ref: 2 개 id 가 폐기된 버전을 가리킨다\nPASS done'
135
+ printf '%s\n' "$base" > "$T/c_off"; printf '%s\n' "$base" > "$T/c_on"; echo 1 > "$T/c_rcoff"; echo 1 > "$T/c_rcon"
136
+ [ "$(cmpf)" = 0 ] && ok "C1 같은 출력 → SAME" || ng "C1"
137
+ printf '%s\n' "${base/✅ L2 b
138
+ /}" > "$T/c_on"; [ "$(cmpf)" = 1 ] && ok "C2 한쪽 단언 누락 → DIFFERENT" || ng "C2"
139
+ printf '%s\n' "${base/⚠️ ①-g stale-ref: 2 개 id 가 폐기된 버전을 가리킨다/✅ ①-g stale-ref: 살아있는 Zenodo 인용이 전부 최신을 가리킨다}" > "$T/c_on"
140
+ [ "$(cmpf)" = 1 ] && ok "C3 SUPERSEDED>0 → 깨끗함 변이(rc 같음) → DIFFERENT" || ng "C3 비교기가 장식"
141
+ printf '%s\n' "$base" > "$T/c_on"; echo 0 > "$T/c_rcoff"; echo 1 > "$T/c_rcon"; [ "$(cmpf)" = 1 ] && ok "C4 종료 0→1 → DIFFERENT" || ng "C4"
142
+ echo 1 > "$T/c_rcoff"; echo 3 > "$T/c_rcon"; [ "$(cmpf)" = 1 ] && ok "C5 종료 1→3 → DIFFERENT" || ng "C5"
143
+ echo 2 > "$T/c_rcon"; [ "$(cmpf)" = 0 ] && ok "C6 종료 1→2 (같은 부류) → SAME" || ng "C6"
144
+ echo 1 > "$T/c_rcon"; : > "$T/c_on"; [ "$(cmpf)" = 3 ] && ok "C7 빈 출력 → HARNESS-ERROR" || ng "C7"
145
+ printf '%s\n' "${base/✅ L2 b
146
+ /}" > "$T/c_off"; printf '%s\n' "${base/✅ L2 b
147
+ /}" > "$T/c_on"; printf '✅ L# b\n' > "$T/man"
148
+ [ "$(cmpf --manifest "$T/man")" = 1 ] && ok "C8 양쪽에서 같은 단언 누락 + manifest → DIFFERENT" || ng "C8"
149
+ [ "$(cmpf)" = 0 ] && ok "C8b 컨트롤: manifest 없으면 양쪽 누락은 SAME (manifest 가 있어야 잡힌다)" || ng "C8b"
150
+
151
+ printf '✅ L1 checked\n✅ L2 checked\n' > "$T/c_off"; printf '✅ L1 checked\n✅ L1 checked\n' > "$T/c_on"; echo 0 > "$T/c_rcoff"; echo 0 > "$T/c_rcon"
152
+ [ "$(cmpf)" = 1 ] && ok "C9 레인 번호가 다른 단언(L2 사라지고 L1 둘) → DIFFERENT" || ng "C9 정규화가 단언 신원을 지운다"
153
+ printf '✅ x\n⚠️ SUPERSEDED=2 UNSCANNABLE=0\n' > "$T/c_off"; printf '✅ x\n⚠️ SUPERSEDED=0 UNSCANNABLE=2\n' > "$T/c_on"
154
+ [ "$(cmpf)" = 1 ] && ok "C10 진단 안의 작은 수가 다르다 → DIFFERENT" || ng "C10 진단 수를 지운다"
155
+ printf '✅ base\nUNMEASURED scanner\n' > "$T/c_off"; printf '✅ base\nclean scanner\n' > "$T/c_on"
156
+ [ "$(cmpf)" = 1 ] && ok "C11 기호 없는 UNMEASURED 줄이 사라짐 → DIFFERENT" || ng "C11 typed 상태 줄을 안 본다"
157
+ printf '✅ checked\n' > "$T/c_off"; printf '✅ checked\n' > "$T/c_on"; printf '✅ checked\n✅ checked\n' > "$T/man"
158
+ [ "$(cmpf --manifest "$T/man")" = 1 ] && ok "C12 manifest 가 두 번 기대하는데 한 번씩 → DIFFERENT" || ng "C12 manifest 개수 무시"
159
+ printf '✅ x\n⚠️ UNSCANNABLE=1000\n' > "$T/c_off"; printf '✅ x\n⚠️ UNSCANNABLE=9999\n' > "$T/c_on"
160
+ [ "$(cmpf)" = 1 ] && ok "C14 큰 진단 수가 다르다 → DIFFERENT" || ng "C14 큰 수를 지운다"
161
+ printf '✅ /tmp/arm/result:PASS=1\n' > "$T/c_off"; printf '✅ /tmp/arm/result:PASS=0\n' > "$T/c_on"
162
+ [ "$(cmpf)" = 1 ] && ok "C15 임시 경로에 붙은 진단이 다르다 → DIFFERENT" || ng "C15 경로 정규화가 진단을 삼킨다"
163
+ printf '✅ base\n── lanes: PASS=39 FAIL=0 ──\nCACHED scanner\n' > "$T/c_off"; printf '✅ base\n── lanes: PASS=39 FAIL=0 ──\n' > "$T/c_on"
164
+ [ "$(cmpf)" = 1 ] && ok "C16 typed 상태 줄(CACHED) 사라짐 → DIFFERENT" || ng "C16 CACHED 를 안 본다"
165
+ printf '✅ base\n── lanes: PASS=38 FAIL=1 ──\nCACHED scanner\n' > "$T/c_on"; printf '✅ base\n── lanes: PASS=39 FAIL=0 ──\nCACHED scanner\n' > "$T/c_off"
166
+ [ "$(cmpf)" = 1 ] && ok "C17 줄 안의 요약 필드(PASS=39→38) → DIFFERENT" || ng "C17 요약 필드를 안 본다"
167
+ printf '✅ x\n⚠️ pid1_count=1\n' > "$T/c_off"; printf '✅ x\n⚠️ pid2_count=1\n' > "$T/c_on"
168
+ [ "$(cmpf)" = 1 ] && ok "C18 pid 꼴 식별자(pid1_count/pid2_count)는 지킨다 → DIFFERENT" || ng "C18 pid 정규화가 식별자를 지운다"
169
+ printf 'just text\n' > "$T/c_off"; printf 'just text\n' > "$T/c_on"
170
+ [ "$(cmpf)" = 3 ] && ok "C19 단언 없는 출력 → HARNESS-ERROR" || ng "C19"
171
+ printf '✅ scanner timeout=45s\n' > "$T/c_off"; printf '✅ scanner timeout=1s\n' > "$T/c_on"
172
+ [ "$(cmpf)" = 1 ] && ok "C20 설정값(timeout=45s→1s) → DIFFERENT" || ng "C20 설정값을 지운다"
173
+ printf 'BYPASS scanner\n' > "$T/c_off"; printf 'BYPASS scanner\n' > "$T/c_on"
174
+ [ "$(cmpf)" = 3 ] && ok "C21 BYPASS 는 단언이 아니다 → HARNESS-ERROR" || ng "C21 낱말 안의 PASS 를 단언으로 센다"
175
+ printf '✅ premise: card.md=2026-10-12 14:38:18 vs log.md=2000-01-01 00:00:00\n' > "$T/c_off"
176
+ printf '✅ premise: card.md=2026-10-13 09:01:40 vs log.md=2000-01-01 00:00:00\n' > "$T/c_on"
177
+ [ "$(cmpf)" = 1 ] && ok "C13 정규화 없음: 픽스처 파일 시각이 다르면 선언 없이는 DIFFERENT" || ng "C13 계기가 스스로 정규화한다"
178
+ [ "$(cmpf --volatile '^✅ premise:')" = 0 ] && ok "C13b 휘발 선언(--volatile)한 줄만 빼고 SAME" || ng "C13b 휘발 선언이 안 듣는다"
179
+ python3 "$CMP" files "$T/c_off" "$T/c_rcoff" "$T/c_on" "$T/c_rcon" --volatile '^✅ premise:' 2>&1 | /usr/bin/grep -q '^UNMEASURED 휘발 선언 줄 off×1 on×1' \
180
+ && ok "C13c 휘발 선언 줄은 UNMEASURED 로 보고된다(조용히 같다고 하지 않는다)" || ng "C13c 휘발 줄이 보고되지 않는다"
181
+ printf '✅ x\n✅ premise: a=2026-10-12 14:38:18\n' > "$T/c_off" # 휘발 줄 «수» 만 다르다 — 나머지 줄은 같게
182
+ printf '✅ x\n✅ premise: a=2026-10-12 14:38:18\n✅ premise: b=2026-10-12 14:38:19\n' > "$T/c_on"
183
+ [ "$(cmpf --volatile '^✅ premise:')" = 1 ] && ok "C13d 휘발 선언 줄 «수» 가 다르면 DIFFERENT" || ng "C13d 휘발 줄 수 차이를 놓친다"
184
+ printf '✅ scanner timeout=00:00:45\n' > "$T/c_off"; printf '✅ scanner timeout=00:00:01\n' > "$T/c_on"
185
+ [ "$(cmpf)" = 1 ] && ok "C22 시각꼴 설정값 → DIFFERENT" || ng "C22"
186
+ printf '✅ base\npremise: log.md=2000-01-01 00:00:00\n' > "$T/c_off"; printf '✅ base\npremise: log.md=2001-01-01 00:00:00\n' > "$T/c_on"
187
+ [ "$(cmpf)" = 1 ] && ok "C23 고정 기준 날짜가 바뀜 → DIFFERENT" || ng "C23"
188
+ printf '✅ base\n value\n' > "$T/c_off"; printf '✅ base\nvalue \n' > "$T/c_on"
189
+ [ "$(cmpf)" = 1 ] && ok "C25 공백만 다른 줄 → DIFFERENT (정규화 없음)" || ng "C25 공백을 지운다"
190
+ printf '✅ base\nstatus:a\342\200\250status:b\n' > "$T/c_off"; printf '✅ base\nstatus:a\nstatus:b\n' > "$T/c_on"
191
+ [ "$(cmpf)" = 1 ] && ok "C26 U+2028 은 줄 경계가 아니다 → DIFFERENT" || ng "C26 U+2028 을 줄로 쪼갠다"
192
+ printf '✅ base\nstatus:a\rstatus:b\n' > "$T/c_off"; printf '✅ base\nstatus:a\nstatus:b\n' > "$T/c_on"
193
+ [ "$(cmpf)" = 1 ] && ok "C27 파일 입력의 CR 을 바꾸지 않는다 → DIFFERENT" || ng "C27 files 리더가 CR 을 LF 로 바꾼다"
194
+ printf '✅ base\r\nx\n' > "$T/c_off"; printf '✅ base\nx\n' > "$T/c_on"
195
+ [ "$(cmpf)" = 1 ] && ok "C27b CRLF 도 그대로 → DIFFERENT" || ng "C27b CRLF 를 바꾼다"
196
+ mkdir -p "$T/crl"
197
+ cat > "$T/crl/lane_cr.sh" <<'EOF3'
198
+ if [ "$FH_LANE_STUB" = off ]; then printf '✅ base\nstatus:a\rstatus:b\n'; else printf '✅ base\nstatus:a\nstatus:b\n'; fi
199
+ EOF3
200
+ python3 "$CMP" run "$T/crl/lane_cr.sh" >/dev/null 2>&1; [ $? = 1 ] && ok "C27c run 캡처도 CR 을 바꾸지 않는다 → DIFFERENT" || ng "C27c run 캡처가 CR 을 바꾼다"
201
+ printf '✅ base\nscanner id=\377\n' > "$T/c_off"; printf '✅ base\nscanner id=\376\n' > "$T/c_on"
202
+ [ "$(cmpf)" = 1 ] && ok "C28 잘못된 UTF-8 바이트가 다르면 → DIFFERENT (files)" || ng "C28 다른 바이트를 같은 문자로 접는다"
203
+ cat > "$T/crl/lane_bad.sh" <<'EOF3'
204
+ printf '✅ base\n'; if [ "$FH_LANE_STUB" = off ]; then printf 'scanner id=\377\n'; else printf 'scanner id=\376\n'; fi
205
+ EOF3
206
+ python3 "$CMP" run "$T/crl/lane_bad.sh" >/dev/null 2>&1; [ $? = 1 ] && ok "C28b run 캡처도 바이트를 지킨다 → DIFFERENT" || ng "C28b run 캡처가 바이트를 접는다"
207
+ printf '✅ base\nscanner id=\377\n' > "$T/c_on"
208
+ [ "$(cmpf)" = 0 ] && ok "C28c 컨트롤: 같은 잘못된 바이트 → SAME" || ng "C28c"
209
+ printf '✅ base\nscanner id=\377\n' > "$T/c_off"; cp "$T/c_off" "$T/c_on"; python3 "$CMP" manifest "$T/c_off" > "$T/man_b"
210
+ [ "$(cmpf --manifest "$T/man_b")" = 0 ] && ok "C29 manifest 왕복: 잘못된 바이트 원본 vs 그 manifest → SAME" || ng "C29 manifest 가 바이트를 바꿨다"
211
+ printf '✅ base\nscanner id=\\xff\n' > "$T/c_off"; cp "$T/c_off" "$T/c_on"
212
+ [ "$(cmpf --manifest "$T/man_b")" = 1 ] && ok "C29b 글자 \\xff 로 바뀐 양팔은 원 바이트 manifest 와 다르다 → DIFFERENT" || ng "C29b 이스케이프 글자와 원 바이트가 충돌한다"
213
+ for w in 'PASSIVE scanner' 'FAILURE scanner'; do printf '%s\n' "$w" > "$T/c_off"; printf '%s\n' "$w" > "$T/c_on"
214
+ [ "$(cmpf)" = 3 ] && ok "C24 «${w}» 는 단언이 아니다 → HARNESS-ERROR" || ng "C24 ${w} 를 단언으로 센다"; done
215
+
216
+ echo
217
+ echo "── lane-stub-env lanes: PASS=$PASS FAIL=$FAIL ──"
218
+ [ "$FAIL" -eq 0 ]
@@ -65,6 +65,13 @@ check "$T/m5" BLOCK "below-floor without ack (guard intact)"
65
65
  check "$T/m6" PASS "opus at-floor (legacy lane intact)"
66
66
  check "$T/m7" PASS "below-floor with quoted ack (legacy lane intact)"
67
67
  check "$T/m8" BLOCK "invalid floor-status (fail-closed on unknown value)"
68
+ # 2026-10-12 agy 실측 — 힌트 예시값 베끼기. 힌트는 자리표시자를 주고, 자리표시자 그대로는 막는다
69
+ printf "axis2-engine: <무엇이 돌렸나>\naxis2-model: <지금 실제로 도는 모델>\nfloor-status: at-floor\naxis2-evidence: PASS no-S\n" > "$T/m9"
70
+ printf "axis2-engine: agy\naxis2-model: gemini-3.8-flash-high\nfloor-status: at-floor\naxis2-evidence: PASS no-S\n" > "$T/m10"
71
+ check "$T/m9" BLOCK "placeholder axis2-engine/axis2-model pasted from the hint"
72
+ check "$T/m10" PASS "non-Claude runtime model recorded truthfully (gemini via agy)"
73
+ hint=$(bash -c "source '$T/fn.sh'; marker_recreate_hint /tmp/x" 2>&1)
74
+ case "$hint" in *"axis2-model: opus"*|*"axis2-engine: quench-challenger"*) echo "❌ hint still shows copyable example values"; FAIL=1 ;; *) echo "✅ hint shows placeholders, not copyable values" ;; esac
68
75
 
69
76
  [ "$FAIL" -eq 0 ] && echo "── all marker-floor lane fixtures behave ──"
70
77
  exit "$FAIL"
@@ -36,7 +36,17 @@ D="$D"
36
36
  case "\$1 \$2" in
37
37
  "pr view")
38
38
  [ -f "\$D/view_fail" ] && exit 1
39
- case "\$*" in *headRefOid*) cat "\$D/head.oid"; echo ;;
39
+ [ -f "\$D/view_fail_after_merge" ] && [ -s "\$D/merge.log" ] && exit 1
40
+ case "\$*" in
41
+ *state,headRefOid*)
42
+ if [ -f "\$D/merge.oid" ] && [ ! -f "\$D/queued" ]; then
43
+ if [ -f "\$D/stuck" ]; then echo "OPEN \$(cat "\$D/head.oid")"
44
+ elif [ -f "\$D/lag" ] && [ "\$(wc -l < "\$D/lag")" -lt 2 ]; then echo x >> "\$D/lag"; echo "OPEN \$(cat "\$D/head.oid")"
45
+ elif [ -f "\$D/other_head" ]; then echo "MERGED 0000000000000000000000000000000000000000"
46
+ else echo "MERGED \$(cat "\$D/head.oid")"; fi
47
+ elif [ -f "\$D/closed" ]; then echo "CLOSED \$(cat "\$D/head.oid")"
48
+ else echo "OPEN \$(cat "\$D/head.oid")"; fi ;;
49
+ *headRefOid*) cat "\$D/head.oid"; echo ;;
40
50
  *state*) if [ -f "\$D/merge.oid" ] && [ ! -f "\$D/queued" ]; then echo MERGED; else echo OPEN; fi ;;
41
51
  *mergeCommit*) if [ -f "\$D/queued" ]; then echo null; else cat "\$D/merge.oid" 2>/dev/null; echo; fi ;; esac ;;
42
52
  "pr merge")
@@ -49,13 +59,15 @@ case "\$1 \$2" in
49
59
  git -C "\$D/seed" switch -q main && git -C "\$D/seed" merge --squash -q feat >/dev/null 2>&1
50
60
  [ -f "\$D/drop_b" ] && git -C "\$D/seed" checkout -q HEAD -- b
51
61
  git -C "\$D/seed" commit -qm squash --no-verify && git -C "\$D/seed" push -q origin main
52
- git -C "\$D/seed" rev-parse HEAD > "\$D/merge.oid" ;;
62
+ git -C "\$D/seed" rev-parse HEAD > "\$D/merge.oid"
63
+ [ -f "\$D/local_fail" ] && { echo "fatal: 'main' is already used by worktree" >&2; exit 1; }
64
+ exit 0 ;;
53
65
  *) exit 2 ;;
54
66
  esac
55
67
  EOF
56
68
  chmod +x "$D/bin/gh"
57
69
  }
58
- run() { local D="$1"; shift; OUT=$(cd "$D/work" && PATH="$D/bin:$PATH" bash "$SC" "$@" 2>&1); RC=$?; }
70
+ run() { local D="$1"; shift; OUT=$(cd "$D/work" && PATH="$D/bin:$PATH" PMV_RETRY_SLEEP=0 bash "$SC" "$@" 2>&1); RC=$?; }
59
71
  merged() { [ -s "$1/merge.log" ]; }
60
72
  GOOD='grep -q a2 a && grep -q b2 b && echo instrument-ok'
61
73
 
@@ -100,5 +112,40 @@ setup q; mkgh "$T/q"; : > "$T/q/queued"; run "$T/q" 7 --rerun "$GOOD"
100
112
  { [ "$RC" -eq 6 ] && ! printf '%s' "$OUT" | grep -q 'merged and verified\|IS MERGED'; } \
101
113
  && ok "L9 merge queued / not completed → rc=6, reported as NOT verified" || { bad "L9 queued merge rc=$RC"; printf '%s\n' "$OUT" | tail -3; }
102
114
 
115
+ # ── 2026-10-12 misreport: gh exits non-zero AFTER the server merged (local branch cleanup failed) ──
116
+ # L10 GitHub says MERGED → never «nothing merged»; verification still runs to rc=0
117
+ setup lf; mkgh "$T/lf"; : > "$T/lf/local_fail"; run "$T/lf" 7 --rerun "$GOOD"
118
+ { [ "$RC" -eq 0 ] && printf '%s' "$OUT" | grep -q 'merged and verified' && ! printf '%s' "$OUT" | grep -q 'nothing merged'; } \
119
+ && ok "L10 gh non-zero after server merge → re-queried MERGED, verified rc=0" || { bad "L10 local-cleanup failure rc=$RC"; printf '%s\n' "$OUT" | tail -4; }
120
+ # L11 gh non-zero AND state unreadable → rc=4 «outcome UNKNOWN», never «nothing merged» — both with and
121
+ # without a real server merge behind the failure
122
+ setup lu; mkgh "$T/lu"; : > "$T/lu/merge_fail"; : > "$T/lu/view_fail_after_merge"; run "$T/lu" 7 --rerun "$GOOD"
123
+ { [ "$RC" -eq 4 ] && printf '%s' "$OUT" | grep -q 'UNKNOWN' && ! printf '%s' "$OUT" | grep -q 'nothing merged'; } \
124
+ && ok "L11a gh fails (no merge) + state unreadable → rc=4 UNKNOWN" || { bad "L11a rc=$RC"; printf '%s\n' "$OUT" | tail -3; }
125
+ setup lu2; mkgh "$T/lu2"; : > "$T/lu2/local_fail"; : > "$T/lu2/view_fail_after_merge"; run "$T/lu2" 7 --rerun "$GOOD"
126
+ { [ "$RC" -eq 4 ] && printf '%s' "$OUT" | grep -q 'UNKNOWN' && ! printf '%s' "$OUT" | grep -q 'nothing merged'; } \
127
+ && ok "L11b server merged, gh fails, state unreadable → rc=4 UNKNOWN" || { bad "L11b rc=$RC"; printf '%s\n' "$OUT" | tail -3; }
128
+ # L12 verification still bites on the recovered path: local_fail + a squash that dropped b → rc=1
129
+ setup lfd; mkgh "$T/lfd"; : > "$T/lfd/local_fail"; : > "$T/lfd/drop_b"; run "$T/lfd" 7 --rerun 'grep -q a2 a && echo a-ok'
130
+ { [ "$RC" -eq 1 ] && printf '%s' "$OUT" | grep -q 'IS MERGED but verification FAILED'; } \
131
+ && ok "L12 recovered path still verifies: dropped file → rc=1" || { bad "L12 rc=$RC"; printf '%s\n' "$OUT" | tail -3; }
132
+ # L13 state lags (OPEN, OPEN, then MERGED) → re-reads, verified rc=0
133
+ setup lag; mkgh "$T/lag"; : > "$T/lag/local_fail"; : > "$T/lag/lag"; run "$T/lag" 7 --rerun "$GOOD"
134
+ { [ "$RC" -eq 0 ] && printf '%s' "$OUT" | grep -q 'merged and verified'; } \
135
+ && ok "L13 OPEN→MERGED lag after gh failure → bounded re-read, rc=0" || { bad "L13 rc=$RC"; printf '%s\n' "$OUT" | tail -3; }
136
+ # L14 MERGED from a head other than the recorded one → rc=4, NOT verified
137
+ setup oh; mkgh "$T/oh"; : > "$T/oh/local_fail"; : > "$T/oh/other_head"; run "$T/oh" 7 --rerun "$GOOD"
138
+ { [ "$RC" -eq 4 ] && printf '%s' "$OUT" | grep -q 'not the recorded' && ! printf '%s' "$OUT" | grep -q 'merged and verified'; } \
139
+ && ok "L14 MERGED from a different head → rc=4 NOT verified" || { bad "L14 rc=$RC"; printf '%s\n' "$OUT" | tail -3; }
140
+ # L15 CLOSED (unmerged) after gh failure → rc=5
141
+ setup cl; mkgh "$T/cl"; : > "$T/cl/merge_fail"; : > "$T/cl/closed"; run "$T/cl" 7 --rerun "$GOOD"
142
+ { [ "$RC" -eq 5 ] && printf '%s' "$OUT" | grep -q 'reports CLOSED (read 1 time' && ! printf '%s' "$OUT" | grep -q 'nothing merged'; } \
143
+ && ok "L15 gh fails, PR CLOSED → rc=5 · actual read count" || { bad "L15 rc=$RC"; printf '%s\n' "$OUT" | tail -2; }
144
+ # L16 residual made visible: server merged but state stays OPEN through every re-read → rc=5 reported as
145
+ # «NOT observed» with a re-check hint — never as «nothing merged»
146
+ setup st; mkgh "$T/st"; : > "$T/st/local_fail"; : > "$T/st/stuck"; run "$T/st" 7 --rerun "$GOOD"
147
+ { [ "$RC" -eq 5 ] && printf '%s' "$OUT" | grep -q 'NOT observed' && printf '%s' "$OUT" | grep -q 'read 3 time' && ! printf '%s' "$OUT" | grep -q 'nothing merged'; } \
148
+ && ok "L16 stale OPEN through all re-reads → rc=5 «NOT observed», no false «nothing merged»" || { bad "L16 rc=$RC"; printf '%s\n' "$OUT" | tail -2; }
149
+
103
150
  printf 'PASS %d · FAIL %d\n' "$PASS" "$FAIL"
104
151
  [ "$FAIL" -eq 0 ]
@@ -246,7 +246,7 @@ fi
246
246
  # and 20 -> 21. It should have moved on 2026-09-14 with its twin; leaving it behind is the
247
247
  # half-fix shape, and these three pinned numbers are what surfaced it.
248
248
  _lane S2 select-guard "selected count == 12 (13 - G-TRIG-01, 2026-09-17)" "12" "$sel_count"
249
- _lane S3 select-guard "excluded count == 21 (33 probes.md rows - 12 selected)" "21" "$exc_count"
249
+ _lane S3 select-guard "excluded count == 20 (32 probes.md rows - 12 selected)" "20" "$exc_count"
250
250
 
251
251
  # S7/S8: the two newly-covered rows must actually be IN the selection, and the state-excluded row
252
252
  # must carry its OWN reason rather than the generic utterance-shape one. Counting alone would pass
@@ -42,6 +42,9 @@ fi
42
42
  WORK="$(fh_fixture_root "$(mktemp -d)")" || exit 1
43
43
  : "${WORK:?fixture root unset — refusing to run git in cwd}"
44
44
  trap 'rm -rf "$WORK"' EXIT
45
+ # 비주제 레인 — ①-b 의 gh 를 레인 안 스텁으로 (네트워크 의존 · scripts/lane_stub_env.sh)
46
+ . "$(dirname "${BASH_SOURCE[0]}")/lane_stub_env.sh"
47
+ mkdir -p "$WORK/.lane_stub" && lane_stub_env_on "$WORK/.lane_stub" gh || { echo "HARNESS_ERROR — lane_stub_env 를 못 켰다"; exit 9; }
45
48
  cp "$HOOK_SRC" "$WORK/hook" || exit 1
46
49
  HOOK="$WORK/hook"
47
50
 
@@ -299,6 +302,9 @@ else
299
302
  rm -rf "$SR"
300
303
  fi
301
304
 
305
+ if lane_stub_env_used gh; then echo " ✅ lane_stub_env: gh 스텁 선택 확인(FH_LANE_STUB=off 면 해당 없음)"; PASSED=$((PASSED+1))
306
+ else echo " ❌ lane_stub_env: gh 스텁이 한 번도 안 불렸다 — 체커가 다른 gh 를 골랐다(PATH 가림)"; FAILED=$((FAILED+1)); fi
307
+
302
308
  echo ""
303
309
  echo "[push-zone] $PASSED passed, $FAILED failed"
304
310
  [ "$FAILED" -eq 0 ]
@@ -40,6 +40,9 @@ export FH_COMPANION_STORE=""
40
40
  CHECK="$SCRIPT_DIR/session_close_check.sh"
41
41
  TODAY=$(date +%Y-%m-%d)
42
42
  FAILED=0
43
+ # 비주제 레인 — ①-b 의 gh 를 레인 안 스텁으로 (네트워크 의존 · selfcheck 에서 ≈66s). scripts/lane_stub_env.sh
44
+ . "$SCRIPT_DIR/lane_stub_env.sh"
45
+ _LS_DIR=$(mktemp -d) && lane_stub_env_on "$_LS_DIR" gh || { echo "HARNESS-ERROR: lane_stub_env 를 못 켰다"; exit 9; }
43
46
 
44
47
  if [ ! -f "$CHECK" ]; then
45
48
  echo "FAIL session-close lanes: subject $CHECK missing"
@@ -383,6 +386,10 @@ else
383
386
  fi
384
387
  rm -rf "$_ei"
385
388
 
389
+ if ! lane_stub_env_used gh; then
390
+ echo "❌ lane_stub_env: gh 스텁이 한 번도 안 불렸다 — 체커가 다른 gh 를 골랐다(PATH 가림)"; FAILED=1
391
+ fi
392
+ rm -rf "$_LS_DIR"
386
393
  if [ "$PREMISE_FAILED" -ne 0 ]; then
387
394
  echo "SESSION-CLOSE LANES: FIXTURE ERROR — a lane's input state was never created; this run's ⑤ verdicts prove nothing (exit 3 ≠ gate failure)"
388
395
  exit 3
@@ -27,6 +27,9 @@
27
27
 
28
28
  set -uo pipefail
29
29
  . "$(dirname "${BASH_SOURCE[0]}")/fixture_guard_lib.sh"
30
+ # 상대 경로로 실행됐으면 절대 경로로 다시 실행한다 — 아래 cd 뒤에 lane_stub_env 가 호출자 경로를
31
+ # 확인하기 때문이다(상대 경로는 cd 뒤에 다른 파일을 가리킨다).
32
+ case "$0" in /*) ;; *) exec bash "$(cd "$(dirname "$0")" && pwd -P)/$(basename "$0")" "$@" ;; esac
30
33
  cd "$(dirname "$0")/.." || exit 1
31
34
  ROOT="$(pwd -P)"
32
35
  SUT="$ROOT/scripts/utterance_intake.sh"
@@ -46,6 +49,9 @@ done
46
49
  T="$(fh_fixture_root "$(mktemp -d 2>/dev/null)")" || { echo "ⓘ mktemp failed — this suite's own setup broke (NOT a pass)"; exit 10; }
47
50
  : "${T:?fixture root unset}"
48
51
  trap 'rm -rf "$T"' EXIT INT TERM
52
+ # 비주제 레인 — ①-b 의 gh 를 레인 안 스텁으로 (네트워크 의존 · scripts/lane_stub_env.sh)
53
+ . "$ROOT/scripts/lane_stub_env.sh"
54
+ mkdir -p "$T/.lane_stub" && lane_stub_env_on "$T/.lane_stub" gh || { echo "HARNESS-ERROR: lane_stub_env 를 못 켰다"; exit 9; }
49
55
 
50
56
  TODAY="$(date +%Y-%m-%d)"
51
57
 
@@ -165,7 +171,17 @@ N20=$(python3 "$EXTRACT" "$T/tr.jsonl" --min-chars 20 2>/dev/null | grep -c .);
165
171
  [ "${N0:-0}" -eq 4 ] && ok "L9 --min-chars 0 → 4 발화 (known-positive)" || ng "L9 --min-chars 0 → $N0 (기대 4)"
166
172
  [ "${N20:-0}" -eq 3 ] && ok "L9b --min-chars 20 → 3 발화 (필터가 실제로 거른다)" || ng "L9b --min-chars 20 → $N20 (기대 3)"
167
173
  # 출력 형식: n<TAB>ts<TAB>text
168
- python3 "$EXTRACT" "$T/tr.jsonl" --min-chars 0 2>/dev/null | head -1 | grep -qE $'^1\t2026-09-05T01:00:00' \
174
+ # 🟥 파이프를 걷은 이유 — `… | head -1 | grep -q` 는 `set -o pipefail` 밑에서 조기종료
175
+ # 소비자가 생산자를 SIGPIPE 로 죽이고, 그 rc 가 레인 판정이 된다. 레포 자기 계기
176
+ # (`scripts/pipefail_earlyexit_scan.sh`)가 이 줄을 이미 `head / GUARD` VULN 으로
177
+ # 이름 대고 있었다. 2026-10-12 클린룸 감사에서 **실제로 떴다**: 한 selfcheck 로그 안의
178
+ # 같은 레인 4회 실행 중 1회만 적색(앞선 3개 회차 로그에서는 4/4 × 3 = 12/12 초록),
179
+ # 부하를 준 단독 재현 1/30 · 부하가 빠진 뒤 0/180. 조용한 «통과»가 아니라 조용한
180
+ # «적색»이고, 그래서 더 나쁘다 — 주간 감사의 회차 간 diff 를 오염시켜 「새로 깨진 것」
181
+ # 판정 자체를 못 쓰게 만든다. 처방은 레포 관례 그대로: 먼저 담고 here-string 으로 본다.
182
+ # 기존 부채 121 곳은 이 변경의 일이 아니다 — 그쪽은 델타 잠금이 이미 관장한다.
183
+ _L9C_OUT=$(python3 "$EXTRACT" "$T/tr.jsonl" --min-chars 0 2>/dev/null)
184
+ grep -qE $'^1\t2026-09-05T01:00:00' <<<"${_L9C_OUT%%$'\n'*}" \
169
185
  && ok "L9c tsv 형식이 n<TAB>ts<TAB>text" || ng "L9c tsv 형식이 어긋난다"
170
186
 
171
187
  # ── L10 seal 출력 골든 — 공용화가 기존 원장을 바꾸지 않았다 ─────────────────
@@ -539,6 +555,9 @@ else
539
555
  esac
540
556
  fi
541
557
 
558
+ lane_stub_env_used gh && ok "lane_stub_env: gh 스텁 선택 확인(FH_LANE_STUB=off 면 해당 없음)" \
559
+ || ng "lane_stub_env: gh 스텁이 한 번도 안 불렸다 — 체커가 다른 gh 를 골랐다(PATH 가림)"
560
+
542
561
  echo
543
562
  echo "── utterance-intake lanes: PASS=$PASS FAIL=$FAIL ──"
544
563
  [ "$FAIL" -eq 0 ] || exit 1
@@ -163,6 +163,17 @@ Be conscious of every principle below **before** writing code — directly reduc
163
163
 
164
164
  Starting design with zero cited references is a warning signal for **missing own assets**. Always present at least 1 grep result before beginning design.
165
165
 
166
+ #### 6. Slop Check Before Saying "Done"
167
+
168
+ Look only at what **this change added** — leave existing code alone. Same four questions in every language. Catching everything is not the goal; remove what you can see.
169
+
170
+ 1. **Unused** — for each new function, variable, file, or setting, look for its users. Delete it only when you have verified it is unused, counting dynamic and external uses (framework hooks, reflection, config, exports). If unsure, keep it.
171
+ 2. **Change-narrating comments** — rare, but a comment that only narrates *this edit* ("fixed", "now uses X", "previously") belongs in the commit message. Keep anything that carries safety, security, legal, or compatibility meaning — rewrite it as a lasting explanation instead. Every comment is re-read, and paid for in tokens, by whoever comes next.
172
+ 3. **Unrolled repetition** — when the new code repeats the same shape three or more times with only values changed, consider one loop, table, or function — only if behavior stays identical and it reads more clearly (see rule 1: three repeats permit abstraction, they do not require it).
173
+ 4. **Decoration** — unrequested abstraction, settings, or wrappers; guards for cases that cannot happen; tests that assert nothing.
174
+
175
+ In the completion report, mention concrete cleanup you did or anything you were unsure about. Do not add a boilerplate "nothing found" line.
176
+
166
177
  ---
167
178
 
168
179
  ### Rule Hierarchy and Priority
@@ -619,24 +619,6 @@ if [ -n "$LIGHT" ]; then
619
619
  fi
620
620
  echo ""
621
621
 
622
- # ── Doc-code coupling check (measured class — WARN, never blocks) ─────────────
623
- # Stale docs poison AI accuracy: when executable code changes but the docs that
624
- # describe it do not, the manuals drift (import: Anthropic 4-layer L4 practice —
625
- # "code change forces skill-doc update"). FH applies it as a WARN because many
626
- # script changes are doc-neutral; the warning makes the *decision* conscious.
627
- EXEC_STAGED=$(echo "$STAGED" | grep -E '^(bin/|scripts/).*' || true)
628
- DOC_STAGED=$(echo "$STAGED" \
629
- | grep -E '(README\.md|CHEATSHEET\.md|CLAUDE\.md|AGENTS\.md|^docs/|^knowledge/|SKILL(_detail)?\.md|^\.claude/regression/)' || true)
630
- if [ -n "$EXEC_STAGED" ] && [ -z "$DOC_STAGED" ]; then
631
- echo ""
632
- echo "⚠️ DOC-CODE COUPLING (measured — commit allowed)"
633
- echo " Executable changes staged with no doc asset staged:"
634
- echo "$EXEC_STAGED" | sed 's/^/ /'
635
- echo " If behavior/usage changed: update README/CHEATSHEET/SKILL.md or probes"
636
- echo " (.claude/regression/probes.md) in this commit. If doc-neutral, proceed."
637
- echo ""
638
- fi
639
-
640
622
  # ── Half-fix propagation (advisory — MARK, never block) ──────────────────────
641
623
  # The operator's spec for this debt is explicit: 표시(차단 아님 — 정당한 복제도 있다).
642
624
  # templates/ ships deliberate copies of scripts/, so blocking on duplication would block correct
@@ -794,7 +776,9 @@ marker_recreate_hint() {
794
776
  # 🟥 힌트는 «행위자가 읽는 자리»다(FH-T07). 2026-08-30 블라인드 sim 실측: 플로어 티어 세 팔이
795
777
  # 나머지 필드를 다 쓰고 `soul:` 을 **하나도 안 썼다** — 차단되는 필드인데도. 스펙에도 힌트에도
796
778
  # 없었기 때문이다. 여기에 최소 필드를 다 넣는다. 정본 = .claude/rules/fh_4axis_gate.md
797
- echo " printf 'axis2-engine: quench-challenger\\naxis2-model: opus\\nfloor-status: at-floor\\naxis2-evidence: PASS no-S\\nsoul: 성공 정의 = <...> · 절대 안 함 = <...>\\nsoul-check: reflected(<무엇이 되돌아왔나>)\\ndefeater: <틀렸다면 무엇이 관측되나>\\n' > \"$1\""
779
+ # 🟥 2026-10-12 agy 실측: Gemini 가 이 힌트의 예시값(quench-challenger · opus)을 3/3 그대로 베꼈다.
780
+ # 예시값을 «실제 값처럼 보이는 것» 으로 두면 다른 런타임이 자기 모델을 거짓 기입한다 → 자리표시자로.
781
+ echo " printf 'axis2-engine: <무엇이 돌렸나 — quench-challenger | inline | codex | agy …>\\naxis2-model: <지금 실제로 도는 모델 — 다른 마커에서 베끼지 마라>\\nfloor-status: <at-floor|above-floor|sonnet-floor|below-floor>\\naxis2-evidence: <찾은 것 — PASS no-S 등>\\nsoul: 성공 정의 = <...> · 절대 안 함 = <...>\\nsoul-check: reflected(<무엇이 되돌아왔나>)\\ndefeater: <틀렸다면 무엇이 관측되나>\\n' > \"$1\""
798
782
  }
799
783
 
800
784
  # ── Cross-family leg — typed verdict (see the load-bearing block below for WHY) ──
@@ -2667,7 +2651,13 @@ validate_marker_floor() {
2667
2651
  if [ -z "$model" ]; then
2668
2652
  echo " ❌ MARKER FORMAT — missing axis2-model: line"
2669
2653
  echo " Record the tier that actually produced the adversarial pass"
2670
- echo " (e.g. axis2-model: opus). This is what makes the floor auditable."
2654
+ echo " (the model you are actually running as — never copied from another marker or this hint). This is what makes the floor auditable."
2655
+ return 1
2656
+ fi
2657
+ # 힌트의 자리표시자(<...>)를 그대로 붙여 넣은 마커 — 값을 안 채운 것이다(2026-10-12 agy 베끼기 실측)
2658
+ if grep -qE '^[[:space:]]*(axis2-engine|axis2-model|floor-status):[[:space:]]*<' "$m"; then
2659
+ echo " ❌ MARKER FORMAT — axis2-engine/axis2-model/floor-status 에 자리표시자(<...>)가 남아 있다"
2660
+ echo " 실제 값으로 채워라 — 특히 axis2-model 은 지금 도는 모델이다(다른 마커·힌트에서 베끼지 마라)."
2671
2661
  return 1
2672
2662
  fi
2673
2663
  # axis2-evidence — presence + non-vacuity (NOT provenance; see header note + the
@@ -2850,7 +2840,7 @@ else
2850
2840
  # quoted `date: "<today>"` or extra spacing did not. Fail-open and over-block in one predicate.
2851
2841
  # Free-form stdout is never the verdict channel either — a python3 shim printing one banner line
2852
2842
  # would otherwise fail a healthy manifest.
2853
- MANIFEST_MSG=$(python3 - "$MANIFEST" "$TODAY" <<'PYEOF'
2843
+ MANIFEST_MSG=$(python3 - "$MANIFEST" "$TODAY" "$(git rev-parse --show-toplevel 2>/dev/null)" <<'PYEOF'
2854
2844
  import sys
2855
2845
  try:
2856
2846
  import yaml
@@ -2882,6 +2872,54 @@ if orphan:
2882
2872
  sys.exit(1)
2883
2873
  def norm(v):
2884
2874
  return v.isoformat() if hasattr(v, "isoformat") else str(v).strip()
2875
+ # 🟥 레인 갈음(2026-10-11, P29 표본 n=20 — tracks/_meta/p29_manifest_sample_verify_2026-10-11.md):
2876
+ # 오늘자 엔트리가 `lane:` 키를 달면 «예측» 대신 «레인 + 안 보는 것» 으로 갈음한다는 선언이다.
2877
+ # 이 완화는 **가역 표면(커밋 게이트)** 한정이고, 갈음을 인정하는 조건은 형식뿐이다:
2878
+ # ⓐ lane 이 repo 안에 실재하는 파일(죽은 포인터 차단 · 절대경로/`..` 거부)
2879
+ # ⓑ `not_seen:` 이 비지 않고 자리표시자가 아님(레인이 안 보는 것을 한 줄로 적는다)
2880
+ # ⓒ 부재 주장(«~가 남아 있지 않다/없다/never») 예측은 갈음 불가 — 레인 초록으로 증명되지 않는다
2881
+ # (반증 사례: psa_scan_lib.sh «…경로가 남아 있지 않다» → #762 에서 반증, 레인은 초록이었다).
2882
+ # `lane:` 이 없는 엔트리는 종전과 같다. 막는 것은 갈음 선언의 형식이지 레인의 진위가 아니다.
2883
+ import os, re
2884
+ repo = sys.argv[3] if len(sys.argv) > 3 else ""
2885
+ _PH = {"", "-", "--", "n/a", "na", "none", "tbd", "todo", "tba", "없음", "해당 없음", "해당없음", "...", "…"}
2886
+ _ABS = re.compile(r"(남아\s*있지\s*않|남지\s*않|존재하지\s*않|없어진다|사라진다|사라짐|없어짐|없음|없다|\bnever\b|no longer|"
2887
+ r"not\s+(?:remain|exist)|none\s+remain)", re.I)
2888
+ def _flat(v): # 매핑은 키가 아니라 값만 본다(codex B)
2889
+ if isinstance(v, dict): return [t for x in v.values() for t in _flat(x)]
2890
+ if isinstance(v, (list, tuple)): return [t for x in v for t in _flat(x)]
2891
+ return [str(v)]
2892
+ def _lane_problem(e):
2893
+ lane, ns = e.get("lane"), e.get("not_seen")
2894
+ if not isinstance(lane, str) or not lane.strip():
2895
+ return "`lane:` is empty or not a string"
2896
+ lane = lane.strip()
2897
+ if os.path.isabs(lane) or ".." in lane.replace("\\", "/").split("/"):
2898
+ return "lane `%s` must be a repo-relative path without `..`" % lane
2899
+ full = os.path.join(repo, lane)
2900
+ if not os.path.isfile(full):
2901
+ return "lane `%s` is not an existing regular file in the repo (dead pointer)" % lane
2902
+ # symlink 로 repo 밖을 가리키는 «죽지 않은» 포인터 차단 (codex A · agy B-1)
2903
+ if not os.path.realpath(full).startswith(os.path.realpath(repo) + os.sep):
2904
+ return "lane `%s` resolves outside the repo" % lane
2905
+ if not isinstance(ns, str) or ns.strip().lower() in _PH or len(ns.strip()) < 5:
2906
+ return "`not_seen:` (what the lane does NOT check) is empty/placeholder — substitution refused"
2907
+ for k in ("predicted_impact", "prediction", "impact"):
2908
+ v = e.get(k)
2909
+ # 문자열이 아닌 값(리스트 등)도 평탄화해서 본다 — 타입으로 부재 주장을 숨기지 못하게 (agy S-1 · codex A)
2910
+ if v is not None and _ABS.search(" ".join(_flat(v))):
2911
+ return ("`%s` makes an absence claim (남아 있지 않다/없다/never) — a green lane does not prove it; "
2912
+ "drop `lane:` and keep the classic prediction" % k)
2913
+ return None
2914
+ # 갈음 판정은 **오늘자 마지막 엔트리**(= 이번 커밋이 방금 덧붙인 것)에 건다: `lane:` 이 null 이 아니면
2915
+ # 유효해야 통과, 아니면 rc 4. 앞선 커밋의 낡은 lane 은 보지 않는다(뒤 커밋의 종전 예측을 막지 않음 —
2916
+ # codex B · agy A-2). 마지막이 불량 lane 이면 앞에 유효 엔트리가 있어도 차단(agy S-1).
2917
+ # 종전 엔트리(lane 없음/null)는 종전과 같다.
2918
+ _today = [e for e in doc if norm(e.get("date")) == sys.argv[2]]
2919
+ if _today and _today[-1].get("lane") is not None:
2920
+ pr = _lane_problem(_today[-1])
2921
+ if pr:
2922
+ print("lane substitution refused: " + pr); sys.exit(4)
2885
2923
  if not any(norm(e.get("date")) == sys.argv[2] for e in doc):
2886
2924
  sys.exit(2) # 2 = parses fine, but no entry for today
2887
2925
  sys.exit(0)
@@ -2903,6 +2941,10 @@ PYEOF
2903
2941
  2) echo " ❌ FAIL — manifest is valid YAML but has no entry dated $TODAY"
2904
2942
  echo " Run /edit-manifest RECORD to log predicted impact for today's changes."
2905
2943
  FAILED=1 ;;
2944
+ 4) echo " ❌ FAIL — ${MANIFEST_MSG}"
2945
+ echo " 레인 갈음은 \`lane: <repo 상대경로>\` + \`not_seen: <레인이 안 보는 것 한 줄>\` 이 있고 부재 주장 예측이 아닐 때만 인정된다."
2946
+ echo " 아니면 \`lane:\` 줄을 지우고 종전 \`predicted_impact:\` 를 적어라."
2947
+ FAILED=1 ;;
2906
2948
  *) echo " ❌ FAIL — edit_manifest.yaml did not validate: ${MANIFEST_MSG:-checker exited $MANIFEST_RC}"
2907
2949
  echo " Usual causes: an unquoted value containing ': ' (quote it), or a list item indented"
2908
2950
  echo " outside its parent list. Check:"