@chrono-meta/fh-gate 3.24.0 → 3.25.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.
- package/.claude/rules/fh_4axis_gate.md +14 -1
- package/.claude-plugin/marketplace.json +4 -4
- package/CLAUDE.md +5 -4
- package/README.md +8 -6
- package/knowledge/shared/harness-core/claude_md_gate_details.md +34 -0
- package/knowledge/shared/harness-core/fh_integration_contract.md +0 -1
- package/knowledge/shared/harness-core/fh_opencode_governance_wrapper.md +0 -1
- package/knowledge/shared/harness-core/fh_three_layer_canon.md +110 -2
- package/knowledge/shared/harness-core/field_verdict_crossfamily_gate.md +22 -0
- package/knowledge/shared/harness-core/governance_engineering_definition.md +16 -0
- package/knowledge/shared/harness-core/harness_verification_core_extended.md +26 -0
- package/knowledge/shared/harness-core/ship_readiness_gate.md +3 -0
- package/knowledge/shared/harness-core/sonnet_floor_doctrine.md +19 -0
- package/package.json +10 -2
- package/plugins/fh-commons/.claude-plugin/plugin.json +1 -1
- package/plugins/fh-meta/.claude-plugin/plugin.json +1 -1
- package/plugins/fh-meta/CHANGELOG.md +17 -0
- package/plugins/fh-meta/skills/install-wizard/SKILL_detail.md +17 -3
- package/plugins/fh-meta/skills/sim-conductor/SKILL.md +3 -3
- package/plugins/fh-meta/skills/sim-conductor/SKILL_detail.md +4 -2
- package/plugins/fh-meta/skills/verify-bidirectional/SKILL.md +1 -1
- package/plugins/fh-preprep/.claude-plugin/plugin.json +2 -2
- package/plugins/fh-preprep/README.md +11 -0
- package/plugins/fh-preprep/skills/preprep/SKILL.md +47 -1
- package/plugins/fh-preprep/skills/preprep/lane_speech_coach.py +1090 -0
- package/plugins/fh-preprep/skills/preprep/test_lane_speech_coach.py +751 -0
- package/plugins/fh-qp/.claude-plugin/plugin.json +1 -1
- package/scripts/cluster_capability_scan.sh +17 -0
- package/scripts/compaction_probe.sh +102 -23
- package/scripts/count_check.sh +37 -10
- package/scripts/field_canon_preload.sh +84 -2
- package/scripts/marker_diff_sha.sh +13 -0
- package/scripts/mutation_probe.py +1541 -0
- package/scripts/revert_probe.sh +5 -6
- package/scripts/selfcheck.sh +48 -0
- package/scripts/test_axis23_skip_reason_lanes.sh +109 -0
- package/scripts/test_channel_inventory_lanes.sh +7 -1
- package/scripts/test_count_check_all_plugins_lanes.sh +130 -0
- package/scripts/test_field_canon_lanes.sh +33 -0
- package/scripts/test_hook_templates_copilot_compat_lanes.sh +250 -0
- package/scripts/test_marker_diff_sha_lanes.sh +129 -0
- package/scripts/test_mutation_probe_lanes.sh +786 -0
- package/scripts/test_preprep_speech_coach_lanes.sh +62 -0
- package/scripts/test_skill_canon_preload_lanes.sh +148 -0
- package/scripts/universal_guard_check.sh +2 -0
- package/templates/.git-hooks/pre-commit +109 -5
- package/templates/goal-quench-hook-setup.md +3 -3
- package/templates/goal-quench-settings-merged.json +0 -1
- package/templates/settings.Compaction.snippet.json +0 -2
- package/templates/settings.FieldCanon.snippet.json +0 -1
- package/templates/settings.SessionStart.snippet.json +0 -2
- package/templates/settings.SubagentStop.snippet.json +0 -1
- package/templates/subagent-tally-hook.json +0 -1
|
@@ -0,0 +1,751 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""test_lane_speech_coach.py — L16 speech-coach known-pair · 퇴화 · 되돌림.
|
|
3
|
+
|
|
4
|
+
🟥 픽스처는 전부 **실행 중에 합성**한다(톱니형 배음 + 결정적 LCG 잡음). 녹화 원본·사람 목소리·
|
|
5
|
+
발표 내용은 넣지 않는다 — 공개 자산에 현장 녹음을 남기지 않는 규율이다. 받아쓰기·디코더는
|
|
6
|
+
«가짜 도구」(이 파일이 임시 폴더에 쓰는 작은 python 스크립트)로 대신해서, whisper 나 ffmpeg 가
|
|
7
|
+
없는 기계(CI)에서도 파이프라인 전 구간이 돈다. 진짜 ffmpeg 가 있으면 한 팔을 더 돈다(없으면
|
|
8
|
+
SKIP — **SKIP 은 PASS 가 아니다**, 수를 따로 찍는다).
|
|
9
|
+
|
|
10
|
+
python3 test_lane_speech_coach.py # 0 통과 / 1 실패
|
|
11
|
+
"""
|
|
12
|
+
import array
|
|
13
|
+
import json
|
|
14
|
+
import math
|
|
15
|
+
import os
|
|
16
|
+
import re
|
|
17
|
+
import shutil
|
|
18
|
+
import subprocess
|
|
19
|
+
import sys
|
|
20
|
+
import tempfile
|
|
21
|
+
import wave
|
|
22
|
+
|
|
23
|
+
HERE = os.path.dirname(os.path.abspath(__file__))
|
|
24
|
+
sys.path.insert(0, HERE)
|
|
25
|
+
import lane_speech_coach as L # noqa: E402
|
|
26
|
+
|
|
27
|
+
SR = L.SR
|
|
28
|
+
FAILS, PASSES, SKIPS = [], [], []
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def says_pass(text):
|
|
32
|
+
"""렌더 글자에 «통과」/PASS 가 있나 — 부정문 «통과 아님」은 뺀다."""
|
|
33
|
+
t = text.replace('통과 아님', '')
|
|
34
|
+
return '통과' in t or re.search(r'\bPASS\b', t) is not None
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def chk(name, cond, extra=''):
|
|
38
|
+
print(' %s %s %s' % ('✅' if cond else '❌', name, extra))
|
|
39
|
+
(PASSES if cond else FAILS).append(name)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def skip(name, why):
|
|
43
|
+
print(' ⏭ %s — SKIP (통과 아님): %s' % (name, why))
|
|
44
|
+
SKIPS.append(name)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
# ── 합성기 ──────────────────────────────────────────────────────────────────────────────────
|
|
48
|
+
class Synth:
|
|
49
|
+
def __init__(self, seed=7):
|
|
50
|
+
self.x = []
|
|
51
|
+
self.s = seed
|
|
52
|
+
|
|
53
|
+
def _noise(self, n, amp):
|
|
54
|
+
out, s = [], self.s
|
|
55
|
+
for _ in range(n):
|
|
56
|
+
s = (1103515245 * s + 12345) & 0x7fffffff
|
|
57
|
+
out.append(int((s / 0x7fffffff * 2 - 1) * amp))
|
|
58
|
+
self.s = s
|
|
59
|
+
return out
|
|
60
|
+
|
|
61
|
+
def sil(self, dur, namp=20):
|
|
62
|
+
self.x += self._noise(int(dur * SR), namp)
|
|
63
|
+
return self
|
|
64
|
+
|
|
65
|
+
def tone(self, dur, st_fn=lambda u: 0.0, f0=150.0, amp=8000, namp=20, harmonics=5):
|
|
66
|
+
"""st_fn(u): 0..1 진행률 → 반음 오프셋. 배음 1..harmonics(1/k) · 10ms 경사."""
|
|
67
|
+
n = int(dur * SR)
|
|
68
|
+
nz = self._noise(n, namp)
|
|
69
|
+
ramp = int(0.01 * SR)
|
|
70
|
+
ph = 0.0
|
|
71
|
+
norm = sum(1.0 / k for k in range(1, harmonics + 1))
|
|
72
|
+
for i in range(n):
|
|
73
|
+
f = f0 * 2 ** (st_fn(i / n) / 12)
|
|
74
|
+
ph += 2 * math.pi * f / SR
|
|
75
|
+
v = sum(math.sin(k * ph) / k for k in range(1, harmonics + 1)) / norm
|
|
76
|
+
env = min(1.0, i / ramp, (n - 1 - i) / ramp)
|
|
77
|
+
self.x.append(int(amp * v * env) + nz[i])
|
|
78
|
+
return self
|
|
79
|
+
|
|
80
|
+
def arr(self):
|
|
81
|
+
return array.array('h', [max(-32768, min(32767, v)) for v in self.x])
|
|
82
|
+
|
|
83
|
+
def wav(self, path):
|
|
84
|
+
L.write_wav(path, self.arr())
|
|
85
|
+
return path
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def tail_fn(kind, body=1.2, tail=0.3, depth=3.0):
|
|
89
|
+
"""본문 평탄 → 끝 tail 초 동안 fall/rise/flat/pushpull."""
|
|
90
|
+
tot = body + tail
|
|
91
|
+
|
|
92
|
+
def f(u):
|
|
93
|
+
t = u * tot
|
|
94
|
+
if t < body:
|
|
95
|
+
return 0.0
|
|
96
|
+
v = (t - body) / tail
|
|
97
|
+
return {'fall': -depth * v, 'rise': depth * v, 'flat': 0.0,
|
|
98
|
+
'pushpull': depth * (1 - abs(2 * v - 1))}[kind]
|
|
99
|
+
return f
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
# ── 가짜 도구 ───────────────────────────────────────────────────────────────────────────────
|
|
103
|
+
FAKE_FFMPEG = r'''
|
|
104
|
+
import sys, wave
|
|
105
|
+
a = sys.argv
|
|
106
|
+
src = a[a.index('-i') + 1]
|
|
107
|
+
if src.startswith('file:'):
|
|
108
|
+
src = src[5:]
|
|
109
|
+
try:
|
|
110
|
+
w = wave.open(src, 'rb')
|
|
111
|
+
except Exception:
|
|
112
|
+
sys.stderr.write('fake-ffmpeg: not a wav\n'); sys.exit(1)
|
|
113
|
+
if w.getnchannels() != 1 or w.getframerate() != 16000 or w.getsampwidth() != 2:
|
|
114
|
+
sys.stderr.write('fake-ffmpeg: need 16k mono s16\n'); sys.exit(1)
|
|
115
|
+
import os
|
|
116
|
+
n = w.getnframes()
|
|
117
|
+
keep = float(os.environ.get('FAKE_FFMPEG_KEEP', '1')) # 디코드된 몫(잘림 재현)
|
|
118
|
+
err = os.environ.get('FAKE_FFMPEG_ERR') # rc 0 인데 stderr 에 오류(손상 패킷 재현)
|
|
119
|
+
if err:
|
|
120
|
+
sys.stderr.write(err + '\n')
|
|
121
|
+
sys.stdout.buffer.write(w.readframes(int(n * keep)))
|
|
122
|
+
'''
|
|
123
|
+
|
|
124
|
+
FAKE_FFPROBE = r'''
|
|
125
|
+
import sys, wave
|
|
126
|
+
src = (sys.argv[sys.argv.index('-i') + 1] if '-i' in sys.argv else
|
|
127
|
+
[x for x in sys.argv[1:] if not x.startswith('-') and '=' not in x and x not in ('a:0', 'error')][-1])
|
|
128
|
+
if src.startswith('file:'):
|
|
129
|
+
src = src[5:]
|
|
130
|
+
w = wave.open(src, 'rb')
|
|
131
|
+
d = w.getnframes() / w.getframerate()
|
|
132
|
+
print('duration=%.6f' % d)
|
|
133
|
+
print('duration=%.6f' % d)
|
|
134
|
+
'''
|
|
135
|
+
|
|
136
|
+
FAKE_WHISPER = r'''
|
|
137
|
+
import sys, os, json, re, wave
|
|
138
|
+
texts = json.loads(os.environ.get('FAKE_WHISPER_TEXTS', '[]'))
|
|
139
|
+
skip = {int(v) for v in os.environ.get('FAKE_WHISPER_SKIP', '').split(',') if v.strip()}
|
|
140
|
+
for f in [x for x in sys.argv[1:] if x.endswith('.wav')]:
|
|
141
|
+
j = int(re.search(r'c(\d+)\.wav$', f).group(1))
|
|
142
|
+
if j in skip:
|
|
143
|
+
continue # 이 덩어리는 JSON 을 안 쓴다(받아쓰기 누락 재현)
|
|
144
|
+
raw = json.loads(os.environ.get('FAKE_WHISPER_RAW', '{}'))
|
|
145
|
+
if str(j) in raw: # 모양이 이상한 JSON 을 그대로 쓴다([] · {"transcription": null} …)
|
|
146
|
+
open(f + '.json', 'w').write(raw[str(j)]); continue
|
|
147
|
+
t = texts[j] if j < len(texts) else ''
|
|
148
|
+
w = wave.open(f, 'rb'); dur = w.getnframes() / w.getframerate(); w.close()
|
|
149
|
+
ws = t.split(); toks = [{"text": "[_BEG_]", "offsets": {"from": 0, "to": 0}, "p": 1.0}]
|
|
150
|
+
a0, a1 = 0.12, max(0.13, dur - 0.12)
|
|
151
|
+
for k, x in enumerate(ws):
|
|
152
|
+
s = a0 + (a1 - a0) * k / max(1, len(ws)); e = a0 + (a1 - a0) * (k + 1) / max(1, len(ws))
|
|
153
|
+
toks.append({"text": " " + x, "offsets": {"from": int(s * 1000), "to": int(e * 1000)}, "p": 0.9})
|
|
154
|
+
json.dump({"transcription": [{"text": t, "tokens": toks}]}, open(f + '.json', 'w'), ensure_ascii=False)
|
|
155
|
+
'''
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
def install_tool(d, name, body):
|
|
159
|
+
p = os.path.join(d, name)
|
|
160
|
+
with open(p, 'w') as fh:
|
|
161
|
+
fh.write('#!' + sys.executable + '\n' + body)
|
|
162
|
+
os.chmod(p, 0o755)
|
|
163
|
+
return p
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
# 리허설 픽스처: 덩어리 8개(4번은 0.2초 잡음 — 가짜 받아쓰기가 «감사합니다」를 지어낸다)
|
|
167
|
+
GREET_TEXTS = ['안녕하세요.', '오늘은 놓친 것을 이야기합니다.', '그런데', '답이 달라지는 곳이 있습니다.',
|
|
168
|
+
'감사합니다.', '고치는 법을 봅니다.', '다음으로 넘어갑니다.', '감사합니다.']
|
|
169
|
+
GREET_SCRIPT = '안녕하세요.\n오늘은 놓치는 것을 이야기합니다.\n[진행] 다음 장\n그런데 답이 달라지는 곳이 있습니다.\n' \
|
|
170
|
+
'고치는 법을 봅니다.\n다음으로 넘어갑니다.\n감사합니다.\n'
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
def greet_fixture(path, blip='noise'):
|
|
174
|
+
"""blip: 4번 덩어리(0.2초) — 'noise' = 무성 잡음 폭발(숨·마찰) · 'voiced' = 짧은 유성 발화(«네»)."""
|
|
175
|
+
s = Synth(11).sil(0.5)
|
|
176
|
+
s.tone(1.0, tail_fn('fall', 0.7, 0.3), amp=11000).sil(0.7)
|
|
177
|
+
s.tone(1.6, tail_fn('fall', 1.3, 0.3)).sil(0.7)
|
|
178
|
+
s.tone(0.5, amp=8000).sil(0.7) # 홀로 선 «그런데»
|
|
179
|
+
s.tone(1.6, tail_fn('fall', 1.3, 0.3)).sil(0.7)
|
|
180
|
+
if blip == 'voiced':
|
|
181
|
+
s.tone(0.2, amp=3000).sil(0.7) # 짧은 «유성» 덩어리(실제 발화일 수 있다)
|
|
182
|
+
else:
|
|
183
|
+
s.sil(0.2, namp=3000).sil(0.7) # 짧은 «무성» 잡음 덩어리
|
|
184
|
+
s.tone(1.5, tail_fn('pushpull', 1.2, 0.3)).sil(0.7)
|
|
185
|
+
s.tone(1.5, tail_fn('rise', 1.2, 0.3)).sil(0.7)
|
|
186
|
+
s.tone(0.9, tail_fn('fall', 0.6, 0.3), amp=1800).sil(0.6) # 작은 끝인사
|
|
187
|
+
return s.wav(path)
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
def main():
|
|
191
|
+
tmp = tempfile.mkdtemp(prefix='speechcoach_pair_')
|
|
192
|
+
try:
|
|
193
|
+
run(tmp)
|
|
194
|
+
finally:
|
|
195
|
+
shutil.rmtree(tmp, ignore_errors=True)
|
|
196
|
+
print('PASS %d · FAIL %d · SKIP %d (SKIP != PASS)' % (len(PASSES), len(FAILS), len(SKIPS)))
|
|
197
|
+
if FAILS:
|
|
198
|
+
print('FAIL · ' + ', '.join(FAILS))
|
|
199
|
+
return 1 if FAILS else 0
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
def run(tmp):
|
|
203
|
+
print('L16 speech-coach known-pair')
|
|
204
|
+
# K1 쉼: 0.5 · 1.0 초 쉼은 경계, 0.10초는 흡수
|
|
205
|
+
s = Synth(1).sil(0.5).tone(1.0).sil(0.5).tone(1.0).sil(1.0).tone(1.0).sil(0.10).tone(1.0).sil(0.5)
|
|
206
|
+
db = L.frame_db(s.arr())
|
|
207
|
+
ch, _ = L.segment(db)
|
|
208
|
+
gaps = [round(ch[i + 1][0] - ch[i][1], 2) for i in range(len(ch) - 1)]
|
|
209
|
+
chk('K1 쉼 경계: 덩어리 3개(0.10초 쉼은 흡수)', len(ch) == 3, 'chunks=%d gaps=%s' % (len(ch), gaps))
|
|
210
|
+
chk('K1-b 쉼 길이 0.5 · 1.0초를 ±0.05 안으로', len(gaps) == 2 and abs(gaps[0] - 0.5) <= 0.05
|
|
211
|
+
and abs(gaps[1] - 1.0) <= 0.05, str(gaps))
|
|
212
|
+
|
|
213
|
+
# K2 문장 끝 피치 — 같은 본문, 끝 0.3초만 다르다(한 변수)
|
|
214
|
+
res = {}
|
|
215
|
+
for kind in ('fall', 'rise', 'flat', 'pushpull'):
|
|
216
|
+
s = Synth(2).sil(0.4).tone(1.5, tail_fn(kind)).sil(0.6)
|
|
217
|
+
x = s.arr()
|
|
218
|
+
db = L.frame_db(x)
|
|
219
|
+
ch, thr = L.segment(db)
|
|
220
|
+
res[kind] = L.end_metrics(x, db, thr, ch[0][0], ch[0][1]) if len(ch) == 1 else {}
|
|
221
|
+
ts = {k: v.get('tail_st') for k, v in res.items()}
|
|
222
|
+
chk('K2 컨트롤 생존: 네 팔 모두 끝 피치를 잼', all(v is not None for v in ts.values()), str(ts))
|
|
223
|
+
if all(v is not None for v in ts.values()):
|
|
224
|
+
chk('K2-a 하강 → 음수(<-0.8)', ts['fall'] < -0.8, '%+.1f' % ts['fall'])
|
|
225
|
+
chk('K2-b 상승 → 양수(>+0.8)', ts['rise'] > 0.8, '%+.1f' % ts['rise'])
|
|
226
|
+
chk('K2-c 평탄 → |x|<0.5', abs(ts['flat']) < 0.5, '%+.1f' % ts['flat'])
|
|
227
|
+
pp = {k: L.is_push_pull(v) for k, v in res.items()}
|
|
228
|
+
chk('K2-d 밀당은 «올렸다 내림」에서만', pp == {'fall': False, 'rise': False, 'flat': False,
|
|
229
|
+
'pushpull': True}, str(pp))
|
|
230
|
+
|
|
231
|
+
# K3 끝인사 크기 — 끝 덩어리만 −14dB
|
|
232
|
+
def greet_run(last_amp):
|
|
233
|
+
s = Synth(3).sil(0.4)
|
|
234
|
+
for _ in range(11):
|
|
235
|
+
s.tone(0.8, harmonics=1).sil(0.5)
|
|
236
|
+
s.tone(0.8, amp=last_amp, harmonics=1).sil(0.5)
|
|
237
|
+
db = L.frame_db(s.arr())
|
|
238
|
+
ch, _ = L.segment(db)
|
|
239
|
+
return len(ch), L.row_greet(db, ch, None)
|
|
240
|
+
n_q, g_q = greet_run(1600)
|
|
241
|
+
n_c, g_c = greet_run(8000)
|
|
242
|
+
chk('K3 컨트롤 생존: 양팔 덩어리 12개', n_q == 12 and n_c == 12, '%d/%d' % (n_q, n_c))
|
|
243
|
+
chk('K3-a 작은 끝인사 → 하위 10% 아래', g_q['last']['below_p10'], '%+.1f dB' % g_q['last']['vs_median'])
|
|
244
|
+
chk('K3-b 같은 크기 끝인사 → 하위 10% 아래 아님', not g_c['last']['below_p10'],
|
|
245
|
+
'%+.1f dB' % g_c['last']['vs_median'])
|
|
246
|
+
|
|
247
|
+
# K4 접속사 늘임 — 홀로 선 «그런데」 길이만 다르다
|
|
248
|
+
def conj_run(conj_dur):
|
|
249
|
+
ch = [(0.0, 1.0), (1.5, 2.5), (3.0, 3.0 + conj_dur), (4.0, 5.0), (5.5, 6.5)]
|
|
250
|
+
ws = []
|
|
251
|
+
for j, (a, b) in enumerate(ch):
|
|
252
|
+
ws.append({'w': '그런데' if j == 2 else ('가나다라마바,' if j == 0 else '가나다라마바'),
|
|
253
|
+
't0': a, 't1': b, 'chunk': j, 'p': 1.0})
|
|
254
|
+
return L.row_conj(ws, ch)
|
|
255
|
+
r_n, r_d = conj_run(0.5), conj_run(0.8)
|
|
256
|
+
sn, sd = r_n['conj'][0]['stretch'], r_d['conj'][0]['stretch']
|
|
257
|
+
chk('K4-a 보통 «그런데」 → 늘임 ≈1.0, 끌기 문턱 아래', sn is not None and abs(sn - 1.0) <= 0.05
|
|
258
|
+
and sn < L.C('drag_stretch'), str(sn))
|
|
259
|
+
chk('K4-b 끈 «그런데」 → 끌기 문턱 이상', sd is not None and sd >= L.C('drag_stretch'), str(sd))
|
|
260
|
+
chk('K4-c 홀로 선 접속사 길이는 «음향 경계」에서 잰다(토큰 시각 아님)',
|
|
261
|
+
r_n['conj'][0]['dur_src'] == '음향 경계' and r_n['conj'][0]['pause_before'] == 0.5, str(r_n['conj'][0]))
|
|
262
|
+
chk('K4-d 쉼표 뒤 쉼 실현', r_n['commas'] == [0.5], str(r_n['commas']))
|
|
263
|
+
ch_j = [(0.0, 1.0), (1.5, 1.8), (2.3, 3.3)]
|
|
264
|
+
ws_j = [{'w': w, 't0': a, 't1': b, 'chunk': j, 'p': 1.0}
|
|
265
|
+
for j, ((a, b), w) in enumerate(zip(ch_j, ['가나다라마바', '즉', '가나다라마바']))]
|
|
266
|
+
rj = L.row_conj(ws_j, ch_j)['conj'][0]
|
|
267
|
+
chk('K4-e 1음절 «즉」은 늘임을 안 낸다(None — 0 이 아니다)', rj['conj'] == '즉' and rj['stretch'] is None, str(rj))
|
|
268
|
+
chk('K4-f 옥타브 의심 끝(+13반음 봉우리)은 밀당으로 안 센다',
|
|
269
|
+
not L.is_push_pull({'tail_st': -7.0, 'tail_peak_st': 13.2, 'tail_last_st': -7.2})
|
|
270
|
+
and L.is_push_pull({'tail_st': 1.0, 'tail_peak_st': 2.5, 'tail_last_st': 0.5}))
|
|
271
|
+
chk('K4-g 정상적인 깊은 평서 하강(−7.5반음)은 옥타브 의심이 아니다(첫 실사용 회귀)',
|
|
272
|
+
not L.octave_suspect({'tail_st': -7.5, 'tail_peak_st': -5.0})
|
|
273
|
+
and L.octave_suspect({'tail_st': -17.7, 'tail_peak_st': -15.0}))
|
|
274
|
+
|
|
275
|
+
# K5 환각 거르기 — 가짜 받아쓰기로 transcribe() 전 구간
|
|
276
|
+
bindir = os.path.join(tmp, 'bin_w')
|
|
277
|
+
os.makedirs(bindir)
|
|
278
|
+
fake_w = install_tool(bindir, 'whisper-cli', FAKE_WHISPER)
|
|
279
|
+
# 0번 = 0.2초 «무성» 잡음 폭발 — 유성이면 R3 규칙상 버려도 누락이 된다(그건 R3·K5-c 가 따로 잰다)
|
|
280
|
+
s = Synth(5).sil(0.5).sil(0.2, namp=3000).sil(0.8).tone(1.0).sil(0.8).tone(1.0).sil(0.5)
|
|
281
|
+
x = s.arr()
|
|
282
|
+
ch, _ = L.segment(L.frame_db(x))
|
|
283
|
+
wenv = {'PATH': bindir, 'FAKE_WHISPER_TEXTS': json.dumps(['감사합니다.', '감사합니다.', '안녕하세요.'],
|
|
284
|
+
ensure_ascii=False)}
|
|
285
|
+
wtmp = os.path.join(tmp, 'w5')
|
|
286
|
+
os.makedirs(wtmp)
|
|
287
|
+
words, dropped, missing, _q, _w = L.transcribe(x, ch, fake_w, '/dev/null', 'ko', wtmp, env=wenv)
|
|
288
|
+
nmiss = len(missing) if isinstance(missing, list) else missing
|
|
289
|
+
chk('K5 컨트롤 생존: 덩어리 3개 · 누락 0', len(ch) == 3 and nmiss == 0, 'chunks=%d missing=%s' % (len(ch), missing))
|
|
290
|
+
chk('K5-a 0.2초 «감사합니다」 → 환각으로 버림', dropped == [0], str(dropped))
|
|
291
|
+
chk('K5-b 1.0초 «감사합니다」 → 남김(진짜 끝인사일 수 있다)',
|
|
292
|
+
any(w['chunk'] == 1 and '감사' in w['w'] for w in words), str([(w['chunk'], w['w']) for w in words]))
|
|
293
|
+
|
|
294
|
+
# K5-c (codex R2-A): 빈 받아쓰기의 «누락」 판정은 길이가 아니라 유성음으로 — 짧은 실제 발화(0.3초 «네»)의
|
|
295
|
+
# 빈 받아쓰기는 누락이고, 같은 길이의 무성 잡음 폭발(숨·마찰)의 빈 것은 누락이 아니다.
|
|
296
|
+
s = Synth(6).sil(0.5).sil(0.3, namp=6000).sil(0.8).tone(0.3, amp=8000).sil(0.8).tone(1.0).sil(0.5)
|
|
297
|
+
x = s.arr()
|
|
298
|
+
ch, _ = L.segment(L.frame_db(x))
|
|
299
|
+
wenv2 = dict(wenv, FAKE_WHISPER_TEXTS=json.dumps(['', '', '안녕하세요.'], ensure_ascii=False))
|
|
300
|
+
wtmp2 = os.path.join(tmp, 'w5c')
|
|
301
|
+
os.makedirs(wtmp2)
|
|
302
|
+
_, _, miss_c, quiet_c, _w = L.transcribe(x, ch, fake_w, '/dev/null', 'ko', wtmp2, env=wenv2)
|
|
303
|
+
chk('K5-c 컨트롤 생존: 덩어리 3개(무성 잡음 0.3초 · 유성 0.3초 · 1.0초)', len(ch) == 3, 'chunks=%d %s' % (len(ch), ch))
|
|
304
|
+
chk('K5-c 0.3초 유성 덩어리의 빈 받아쓰기 = 누락 · 0.3초 무성 잡음의 빈 것은 누락 아님',
|
|
305
|
+
list(miss_c) == [1] and list(quiet_c) == [0], 'missing=%s unvoiced_empty=%s' % (miss_c, quiet_c))
|
|
306
|
+
|
|
307
|
+
# K6 «-는」 탈락 후보 — 받아쓰기에서 «는」 하나만 다르다
|
|
308
|
+
script = [(1, '오늘은 놓치는 것을 고치는 법을 봅니다.'), (2, '저는 그렇게 봅니다.')]
|
|
309
|
+
ch6 = [(0.0, 3.0), (3.5, 5.0)]
|
|
310
|
+
|
|
311
|
+
def mk(t0, t1):
|
|
312
|
+
out = [{'w': w, 'chunk': 0, 't0': 0, 't1': 1} for w in t0.split()]
|
|
313
|
+
return out + [{'w': w, 'chunk': 1, 't0': 3.5, 't1': 4} for w in t1.split()]
|
|
314
|
+
r_l = L.row_pron(script, mk('오늘은 놓친 것을 고치는 법을 봅니다.', '저는 그렇게 봅니다.'), ch6)
|
|
315
|
+
r_k = L.row_pron(script, mk('오늘은 놓치는 것을 고치는 법을 봅니다.', '저는 그렇게 봅니다.'), ch6)
|
|
316
|
+
chk('K6-a «놓치는→놓친」 → 관형형 탈락 1/2', [e['word'] for e in r_l['neun']['verb'][1]] == ['놓치는']
|
|
317
|
+
and r_l['neun']['verb'][0] == 2, str(r_l['neun']))
|
|
318
|
+
chk('K6-b 대명사 «저는」 은 따로 센다', r_l['neun']['pron'][0] == 1 and not r_l['neun']['pron'][1],
|
|
319
|
+
str(r_l['neun']['pron']))
|
|
320
|
+
chk('K6-c 같은 받아쓰기 → 탈락 0 · 치환 0', not r_k['neun']['verb'][1] and not r_k['subs'], str(r_k['neun']))
|
|
321
|
+
|
|
322
|
+
# 퇴화 — 의존성 부재는 «측정불가」이고 exit 2, 0 이 아니다
|
|
323
|
+
print('L16 퇴화 · CLI')
|
|
324
|
+
wav = greet_fixture(os.path.join(tmp, 'rehearsal.wav'))
|
|
325
|
+
wav_v = greet_fixture(os.path.join(tmp, 'rehearsal_voiced.wav'), blip='voiced')
|
|
326
|
+
scr = os.path.join(tmp, 'script.txt')
|
|
327
|
+
with open(scr, 'w', encoding='utf-8') as fh:
|
|
328
|
+
fh.write(GREET_SCRIPT)
|
|
329
|
+
empty = os.path.join(tmp, 'empty_bin')
|
|
330
|
+
os.makedirs(empty)
|
|
331
|
+
ffbin = os.path.join(tmp, 'bin_f')
|
|
332
|
+
os.makedirs(ffbin)
|
|
333
|
+
install_tool(ffbin, 'ffmpeg', FAKE_FFMPEG)
|
|
334
|
+
install_tool(ffbin, 'ffprobe', FAKE_FFPROBE)
|
|
335
|
+
both = os.path.join(tmp, 'bin_fw')
|
|
336
|
+
os.makedirs(both)
|
|
337
|
+
install_tool(both, 'ffmpeg', FAKE_FFMPEG)
|
|
338
|
+
install_tool(both, 'ffprobe', FAKE_FFPROBE)
|
|
339
|
+
install_tool(both, 'whisper-cli', FAKE_WHISPER)
|
|
340
|
+
model = os.path.join(tmp, 'fake-model.bin')
|
|
341
|
+
open(model, 'w').close()
|
|
342
|
+
texts = json.dumps(GREET_TEXTS, ensure_ascii=False)
|
|
343
|
+
|
|
344
|
+
r = L.coach(wav, scr, (), env={'PATH': empty})
|
|
345
|
+
st = {x['n']: x['cause'] for x in r['rows']}
|
|
346
|
+
chk('D1 ffmpeg 없음 → exit 2', r['rc'] == 2, 'rc=%d' % r['rc'])
|
|
347
|
+
chk('D1-b ①~④ 전부 «측정불가(UNMEASURED)」, ⑤⑥ 은 «설계상 범위 밖」',
|
|
348
|
+
all(st[n] == L.CAUSE_DEP for n in (1, 2, 3, 4)) and st[5] == st[6] == L.CAUSE_DESIGN, str(st))
|
|
349
|
+
chk('D1-c 출력이 «통과 아님」을 말한다', '통과 아님' in L.render(r))
|
|
350
|
+
|
|
351
|
+
real_ff = shutil.which('ffmpeg')
|
|
352
|
+
if real_ff:
|
|
353
|
+
r = L.coach(wav, None, {1, 2}, env={'PATH': os.path.dirname(real_ff), 'PREPREP_FFMPEG': '/nonexistent/ffmpeg'})
|
|
354
|
+
chk('D2 명시 경로(PREPREP_FFMPEG)가 틀리면 PATH 로 몰래 갈아타지 않는다', r['rc'] == 2
|
|
355
|
+
and 'PREPREP_FFMPEG' in r['deps']['ffmpeg'], r['deps']['ffmpeg'])
|
|
356
|
+
else:
|
|
357
|
+
skip('D2 명시 경로 우선', '이 기계에 진짜 ffmpeg 가 없다')
|
|
358
|
+
|
|
359
|
+
r = L.coach(wav, scr, (), env={'PATH': ffbin})
|
|
360
|
+
st = {x['n']: (x['status'], x['cause']) for x in r['rows']}
|
|
361
|
+
chk('D3 whisper 없음 → ①② 측정불가(UNMEASURED)',
|
|
362
|
+
st[1] == (L.ST_NONE, L.CAUSE_DEP) and st[2] == (L.ST_NONE, L.CAUSE_DEP), str(st))
|
|
363
|
+
chk('D3-b whisper 없어도 ③④ 는 오디오만으로 돈다',
|
|
364
|
+
st[3][1] is None and st[4][1] is None and r['n_chunks'] == 8, '%s chunks=%s' % (st, r.get('n_chunks')))
|
|
365
|
+
chk('D3-c 그 상태의 종료코드는 2(통과 아님)', r['rc'] == 2, 'rc=%d' % r['rc'])
|
|
366
|
+
|
|
367
|
+
r = L.coach(wav, scr, {1, 2}, env={'PATH': ffbin})
|
|
368
|
+
chk('D4 --audio-only(선언) → exit 0, ①② 는 «범위에서 뺌」으로 남는다',
|
|
369
|
+
r['rc'] == 0 and r['rows'][0]['cause'] == r['rows'][1]['cause'] == L.CAUSE_DECLARED, 'rc=%d' % r['rc'])
|
|
370
|
+
|
|
371
|
+
r = L.coach(wav, scr, (), env={'PATH': both, 'FAKE_WHISPER_TEXTS': texts})
|
|
372
|
+
chk('D5 모델 경로 미지정 → ①② 측정불가, 이유가 PREPREP_WHISPER_MODEL 을 댄다',
|
|
373
|
+
r['rc'] == 2 and 'PREPREP_WHISPER_MODEL' in r['rows'][0]['why'], r['rows'][0]['why'])
|
|
374
|
+
|
|
375
|
+
env = {'PATH': both, 'FAKE_WHISPER_TEXTS': texts, 'PREPREP_WHISPER_MODEL': model}
|
|
376
|
+
r = L.coach(wav, scr, (), env=env)
|
|
377
|
+
st = {x['n']: (x['status'], x['cause']) for x in r['rows']}
|
|
378
|
+
chk('D6 전 의존성(가짜) → ①~④ 전부 측정 · exit 0', r['rc'] == 0 and all(st[n][1] is None for n in (1, 2, 3, 4)),
|
|
379
|
+
'rc=%d %s' % (r['rc'], st))
|
|
380
|
+
chk('D6-b 짧은 잡음의 «감사합니다」 1개를 버리고 그 수를 낸다', r.get('asr', {}).get('hallucination_dropped') == 1,
|
|
381
|
+
str(r.get('asr')))
|
|
382
|
+
chk('D6-c ① 은 «부분」(후보)이고 «놓치는」 탈락을 근거 시각과 함께 댄다',
|
|
383
|
+
st[1][0] == L.ST_PARTIAL and any('놓치는' in d for _, d in r['rows'][0]['evidence']),
|
|
384
|
+
str(r['rows'][0]['evidence']))
|
|
385
|
+
chk('D6-d ② 가 홀로 선 «그런데」를 시각과 함께 댄다', any('그런데' in d for _, d in r['rows'][1]['evidence']),
|
|
386
|
+
str(r['rows'][1]['evidence']))
|
|
387
|
+
chk('D6-e ④ 작게 녹음한 끝인사가 가장 조용한 덩어리(1/8)로 잡힌다',
|
|
388
|
+
any('끝 덩어리' in o and '조용한 쪽부터 1/8' in o for o in r['rows'][3]['obs']), str(r['rows'][3]['obs']))
|
|
389
|
+
out = L.render(r)
|
|
390
|
+
chk('D6-f 보정 상수가 «UNCALIBRATED」 로 찍힌다', out.count('UNCALIBRATED') >= 2)
|
|
391
|
+
# B2(codex 교차 리뷰): 종전 단언은 상태값이 «L.ST_* 중 하나」인지만 봤다 — 같은 상수를 읽으니
|
|
392
|
+
# 렌더러가 «통과」를 써도 초록이었다. 이제 «렌더된 글자」를 직접 본다.
|
|
393
|
+
chk('B2 렌더 출력에 «통과」/PASS 낱말이 없다(부정문 «통과 아님」 제외)', not says_pass(out),
|
|
394
|
+
'찾은 줄: %s' % [l for l in out.splitlines() if says_pass(l)][:2])
|
|
395
|
+
orig = L.ST_MEASURED
|
|
396
|
+
try:
|
|
397
|
+
L.ST_MEASURED = '통과' # 되돌림: 렌더러가 «통과」라고 말하게 만든다
|
|
398
|
+
out_m = L.render(L.coach(wav, scr, (), env=env))
|
|
399
|
+
finally:
|
|
400
|
+
L.ST_MEASURED = orig
|
|
401
|
+
chk('B2-b 되돌림: 상태명을 «통과」로 바꾸면 B2 단언이 빨개진다(장식 아님)', says_pass(out_m) and '통과' in out_m)
|
|
402
|
+
|
|
403
|
+
# A1(codex 교차 리뷰): 덩어리 일부만 받아쓰기가 누락되면 노트만 달리고 ② 가 «잡음」· exit 0 이었다
|
|
404
|
+
r = L.coach(wav, scr, {1}, env=dict(env, FAKE_WHISPER_SKIP='3'))
|
|
405
|
+
r2 = r['rows'][1]
|
|
406
|
+
chk('A1 덩어리 1/8 받아쓰기 누락(--skip 1) → ② 는 «부분」 · exit 2',
|
|
407
|
+
r['rc'] == 2 and r2['status'] == L.ST_PARTIAL and '1/8' in r2['why'],
|
|
408
|
+
'rc=%d ②=%s · %s' % (r['rc'], r2['status'], r2['why']))
|
|
409
|
+
at = r.get('asr', {}).get('missing_at') or []
|
|
410
|
+
chk('A1-b 누락 위치(시각)를 낸다', len(at) == 1 and at[0] in r2['why'], 'missing_at=%s' % at)
|
|
411
|
+
# A2: 유효 JSON 인데 낱말 0 인 «말소리」 덩어리는 누락으로 센다.
|
|
412
|
+
# 🟥 codex R2 로 뒤집었다 — 종전 단언은 «0.2초 덩어리의 빈 것은 안 센다」였고, 그 0.2초 덩어리는
|
|
413
|
+
# 유성음(톤)이다. 길이만으로 «잡음」을 단정한 구멍을 시험이 «보존」하고 있었다.
|
|
414
|
+
t2 = list(GREET_TEXTS)
|
|
415
|
+
t2[3], t2[4] = '', '' # 3 = 1.6초 말소리 · 4 = 0.2초 «유성» 덩어리(짧은 발화)
|
|
416
|
+
r = L.coach(wav_v, scr, {1, 3}, env=dict(env, FAKE_WHISPER_TEXTS=json.dumps(t2, ensure_ascii=False)))
|
|
417
|
+
chk('A2 말소리 덩어리 둘(1.6초 · 0.2초 유성)의 빈 받아쓰기 = 누락 2 · --skip 1,3 에서도 exit 2 · ② 일부 못 들음',
|
|
418
|
+
r.get('asr', {}).get('missing') == 2 and r['rc'] == 2 and r['rows'][1]['cause'] == L.CAUSE_INCOMPLETE,
|
|
419
|
+
'asr=%s rc=%d ②=%s' % (r.get('asr'), r['rc'], r['rows'][1]['cause']))
|
|
420
|
+
t3 = list(GREET_TEXTS)
|
|
421
|
+
t3[4] = '' # 짧은 유성 덩어리 «하나만» 비었다 — R2 가 재현한 그 모양
|
|
422
|
+
r = L.coach(wav_v, scr, {1, 3}, env=dict(env, FAKE_WHISPER_TEXTS=json.dumps(t3, ensure_ascii=False)))
|
|
423
|
+
chk('A2-b 0.2초 유성 덩어리 하나만 빈 받아쓰기(--skip 1,3) → exit 2 · ② «잡음」 아님',
|
|
424
|
+
r['rc'] == 2 and r['rows'][1]['status'] != L.ST_MEASURED and r['rows'][1]['cause'] is not None,
|
|
425
|
+
'rc=%d ②=%s/%s' % (r['rc'], r['rows'][1]['status'], r['rows'][1]['cause']))
|
|
426
|
+
# R3 (codex R3): 같은 0.2초 «유성» 덩어리를 받아쓰기가 «감사합니다.」로 지어내면 환각 필터가 버린다 —
|
|
427
|
+
# 그 버림이 누락 셈을 우회해 rc 0 이 났다(빈 받아쓰기면 rc 2 인데). 버린 덩어리도 유성이면 누락이다.
|
|
428
|
+
r = L.coach(wav_v, scr, {1, 3}, env=env) # GREET_TEXTS[4] = '감사합니다.'
|
|
429
|
+
a_ = r.get('asr', {})
|
|
430
|
+
chk('R3 0.2초 유성 덩어리의 «감사합니다」 환각 → 버리되 누락으로 센다 · --skip 1,3 에서 exit 2',
|
|
431
|
+
a_.get('hallucination_dropped') == 1 and a_.get('missing') == 1 and r['rc'] == 2
|
|
432
|
+
and r['rows'][1]['cause'] == L.CAUSE_INCOMPLETE, 'asr=%s rc=%d' % (a_, r['rc']))
|
|
433
|
+
r = L.coach(wav, scr, {1, 3}, env=env) # 같은 자리가 «무성» 잡음이면
|
|
434
|
+
a_ = r.get('asr', {})
|
|
435
|
+
chk('R3-b 컨트롤: 무성 잡음 덩어리의 «감사합니다」 환각 → 버리고 누락 아님 · exit 0',
|
|
436
|
+
a_.get('hallucination_dropped') == 1 and a_.get('missing') == 0 and r['rc'] == 0, 'asr=%s rc=%d' % (a_, r['rc']))
|
|
437
|
+
orig_vf = L.voiced_fraction
|
|
438
|
+
try:
|
|
439
|
+
L.voiced_fraction = lambda *a, **k: 0.0 # 되돌림: 유성 판정을 죽인다
|
|
440
|
+
r = L.coach(wav_v, scr, {1, 3}, env=env)
|
|
441
|
+
finally:
|
|
442
|
+
L.voiced_fraction = orig_vf
|
|
443
|
+
chk('R3-c 되돌림: 유성 판정을 죽이면 같은 오디오가 다시 exit 0 으로 접힌다(판정이 하중을 진다)',
|
|
444
|
+
r['rc'] == 0 and r.get('asr', {}).get('missing') == 0, 'rc=%d asr=%s' % (r['rc'], r.get('asr')))
|
|
445
|
+
# B-json (codex R2): 모양이 이상한 JSON 은 트레이스백이 아니라 그 덩어리의 누락이다
|
|
446
|
+
try:
|
|
447
|
+
r = L.coach(wav, scr, {1}, env=dict(env, FAKE_WHISPER_RAW=json.dumps(
|
|
448
|
+
{'3': '[]', '5': '{"transcription": null}', '6': '{"transcription": [null]}'})))
|
|
449
|
+
chk('B-json []·{"transcription":null}·[null] → 그 덩어리 누락 3 · exit 2',
|
|
450
|
+
r.get('asr', {}).get('missing') == 3 and r['rc'] == 2, 'asr=%s rc=%d' % (r.get('asr'), r['rc']))
|
|
451
|
+
except Exception as e: # noqa: BLE001
|
|
452
|
+
chk('B-json []·{"transcription":null}·[null] → 그 덩어리 누락 3 · exit 2', False,
|
|
453
|
+
'예외로 죽음: %s: %s' % (type(e).__name__, e))
|
|
454
|
+
# R4 (codex R4): 덩어리 하나의 이상한 «값」(거대 정수 · NaN · 음수 오프셋)이 전체를 죽이거나 조용히 통과했다.
|
|
455
|
+
# 부류로 닫는다 — 덩어리 하나를 파싱하는 경계에서 어떤 예외든 그 덩어리의 누락(사유 보존)이다.
|
|
456
|
+
def tok(frm, to):
|
|
457
|
+
return '{"transcription":[{"tokens":[{"text":" 답이","offsets":{"from":%s,"to":%s},"p":0.9}]}]}' % (frm, to)
|
|
458
|
+
raw4 = {'3': tok('1' + '0' * 400, '2' + '0' * 400), '5': tok('NaN', '100'), '6': tok('-500', '100')}
|
|
459
|
+
try:
|
|
460
|
+
r = L.coach(wav, scr, {1}, env=dict(env, FAKE_WHISPER_RAW=json.dumps(raw4)))
|
|
461
|
+
a_ = r.get('asr', {})
|
|
462
|
+
chk('R4 거대 정수 · NaN · 음수 오프셋 → 각 덩어리 누락 3 · exit 2 (크래시 아님 · 조용한 통과 아님)',
|
|
463
|
+
a_.get('missing') == 3 and r['rc'] == 2, 'asr.missing=%s rc=%d' % (a_.get('missing'), r['rc']))
|
|
464
|
+
why = a_.get('missing_why') or {}
|
|
465
|
+
chk('R4-b 누락 사유 문자열을 덩어리마다 보존한다', len(why) == 3 and all(v for v in why.values()), str(why))
|
|
466
|
+
chk('R4-b2 렌더 표에 못 들은 위치와 사유가 찍힌다', L.render(r).count('못 들음 ') >= 3)
|
|
467
|
+
except Exception as e: # noqa: BLE001 — 크래시 자체가 이 레인의 실패다
|
|
468
|
+
chk('R4 거대 정수 · NaN · 음수 오프셋 → 각 덩어리 누락 3 · exit 2 (크래시 아님 · 조용한 통과 아님)', False,
|
|
469
|
+
'예외로 죽음: %s' % type(e).__name__)
|
|
470
|
+
chk('R4-b 누락 사유 문자열을 덩어리마다 보존한다', False, '위에서 죽음')
|
|
471
|
+
orig_w = L.words_from_whisper
|
|
472
|
+
try:
|
|
473
|
+
def boom(*a, **k):
|
|
474
|
+
raise RuntimeError('예상 못 한 파서 예외')
|
|
475
|
+
L.words_from_whisper = boom # 예외 «종류」 목록에 없는 것 — 부류로 닫혔나
|
|
476
|
+
r = L.coach(wav, scr, {1}, env=env)
|
|
477
|
+
chk('R4-c 목록에 없는 예외 종류(RuntimeError)도 그 덩어리 누락으로 갇힌다 · exit 2',
|
|
478
|
+
r['rc'] == 2 and r['rows'][1]['cause'] == L.CAUSE_DEP
|
|
479
|
+
and 'RuntimeError' in json.dumps(r.get('asr', {}), ensure_ascii=False),
|
|
480
|
+
'rc=%d asr=%s' % (r['rc'], str(r.get('asr'))[:120]))
|
|
481
|
+
except Exception as e: # noqa: BLE001
|
|
482
|
+
chk('R4-c 목록에 없는 예외 종류(RuntimeError)도 그 덩어리 누락으로 갇힌다 · exit 2', False,
|
|
483
|
+
'예외로 죽음: %s' % type(e).__name__)
|
|
484
|
+
finally:
|
|
485
|
+
L.words_from_whisper = orig_w
|
|
486
|
+
# ── 외부 입력 경계 전수(codex R5) — 경계마다 «임의 예외 주입」 1개. 각 경계는 그 경계 전용 예외로
|
|
487
|
+
# 감싸여 «그 항목 UNMEASURED(사유) · exit 2」 로 떨어져야 하고, 크래시(exit 1)면 안 된다.
|
|
488
|
+
print('L16 외부 입력 경계 — 임의 예외 주입')
|
|
489
|
+
|
|
490
|
+
def inject(name, attr, exc, want_dep, skip_rows=(), script=scr, env_=None, mod=L):
|
|
491
|
+
orig_ = getattr(mod, attr, None)
|
|
492
|
+
had = hasattr(mod, attr)
|
|
493
|
+
|
|
494
|
+
def raiser(*a, **k):
|
|
495
|
+
raise exc('주입된 예외')
|
|
496
|
+
setattr(mod, attr, raiser)
|
|
497
|
+
try:
|
|
498
|
+
r = L.coach(wav, script, skip_rows, env=env_ or env)
|
|
499
|
+
dep = sorted(x['n'] for x in r['rows'] if x['cause'] == L.CAUSE_DEP)
|
|
500
|
+
whys = ' '.join(x['why'] for x in r['rows'] if x['cause'] == L.CAUSE_DEP) + json.dumps(r['deps'], ensure_ascii=False)
|
|
501
|
+
chk(name, r['rc'] == 2 and dep == sorted(want_dep) and exc.__name__ in whys,
|
|
502
|
+
'rc=%d dep=%s why=%s' % (r['rc'], dep, whys[:90]))
|
|
503
|
+
except Exception as e: # noqa: BLE001 — 크래시 자체가 실패다
|
|
504
|
+
chk(name, False, '예외로 죽음: %s: %s' % (type(e).__name__, e))
|
|
505
|
+
finally:
|
|
506
|
+
if had:
|
|
507
|
+
setattr(mod, attr, orig_)
|
|
508
|
+
else:
|
|
509
|
+
delattr(mod, attr)
|
|
510
|
+
|
|
511
|
+
inject('E1 환경변수 경로(도구 찾기) — which 가 터지면 ffmpeg 없음 → ①~④ UNMEASURED', 'which', ZeroDivisionError,
|
|
512
|
+
[1, 2, 3, 4], mod=L.shutil)
|
|
513
|
+
inject('E2 모델 경로 확인이 터지면 → ①② UNMEASURED, ③④ 는 돈다', 'check_model', ZeroDivisionError, [1, 2])
|
|
514
|
+
inject('E3 녹화 디코드(ffmpeg 출력 포함)가 목록 밖 예외로 터지면 → ①~④ UNMEASURED', 'decode', ZeroDivisionError,
|
|
515
|
+
[1, 2, 3, 4])
|
|
516
|
+
inject('E4 원고 로드가 목록 밖 예외로 터지면 → ① 만 UNMEASURED', 'read_script', ZeroDivisionError, [1])
|
|
517
|
+
inject('E5 whisper 실행이 목록 밖 예외로 터지면 → ①② UNMEASURED', 'run_whisper', ZeroDivisionError, [1, 2])
|
|
518
|
+
inject('E6 덩어리 파일 준비(쓰기)가 터지면 → ①② UNMEASURED', 'write_wav', ZeroDivisionError, [1, 2])
|
|
519
|
+
# E7 whisper 출력 파싱 경계는 R4-c(RuntimeError 주입)가 이미 잰다.
|
|
520
|
+
try:
|
|
521
|
+
import io
|
|
522
|
+
from pptx import Presentation
|
|
523
|
+
prs = Presentation()
|
|
524
|
+
sl = prs.slides.add_slide(prs.slide_layouts[6])
|
|
525
|
+
ph = sl.notes_slide.notes_placeholder
|
|
526
|
+
ph._element.getparent().remove(ph._element) # 노트 본문 자리표시자 제거
|
|
527
|
+
buf = io.BytesIO()
|
|
528
|
+
prs.save(buf)
|
|
529
|
+
pp = os.path.join(tmp, 'no_notes_placeholder.pptx')
|
|
530
|
+
with open(pp, 'wb') as fh:
|
|
531
|
+
fh.write(buf.getvalue())
|
|
532
|
+
has_pptx = True
|
|
533
|
+
except ImportError:
|
|
534
|
+
has_pptx = False
|
|
535
|
+
if has_pptx:
|
|
536
|
+
try:
|
|
537
|
+
r = L.coach(wav, pp, (), env=env)
|
|
538
|
+
chk('E8 노트 자리표시자 없는 pptx → ① UNMEASURED · exit 2 (크래시 아님)',
|
|
539
|
+
r['rc'] == 2 and r['rows'][0]['cause'] == L.CAUSE_DEP, 'rc=%d ①=%s' % (r['rc'], r['rows'][0]['why'][:60]))
|
|
540
|
+
except Exception as e: # noqa: BLE001
|
|
541
|
+
chk('E8 노트 자리표시자 없는 pptx → ① UNMEASURED · exit 2 (크래시 아님)', False,
|
|
542
|
+
'예외로 죽음: %s: %s' % (type(e).__name__, e))
|
|
543
|
+
else:
|
|
544
|
+
skip('E8 노트 자리표시자 없는 pptx', 'python-pptx 없음')
|
|
545
|
+
# ── R6 (codex R6): 디코드가 rc 0 인데 손상 구간을 조용히 버리면 «다 들음」이 된다 ──
|
|
546
|
+
print('L16 부분 디코드 — stderr 오류 · 길이 부족')
|
|
547
|
+
|
|
548
|
+
def degraded(r):
|
|
549
|
+
return (r['rc'] == 2 and all(r['rows'][n - 1]['cause'] == L.CAUSE_INCOMPLETE for n in (3, 4))
|
|
550
|
+
and all(r['rows'][n - 1]['status'] == L.ST_PARTIAL for n in (3, 4)))
|
|
551
|
+
msg = 'Decoding error: Invalid data found when processing input'
|
|
552
|
+
for name, extra, needle in (
|
|
553
|
+
('G1 rc 0 + stderr 오류 줄 → ③④ «부분(디코드 오류)」 · exit 2', {'FAKE_FFMPEG_ERR': msg}, '디코드 오류 1줄'),
|
|
554
|
+
('G2 디코드 길이가 녹화보다 10% 짧음(stderr 없음) → ③④ «부분」 · exit 2', {'FAKE_FFMPEG_KEEP': '0.9'}, '짧음')):
|
|
555
|
+
try:
|
|
556
|
+
r = L.coach(wav, None, {1, 2}, env=dict(PATH=ffbin, **extra))
|
|
557
|
+
chk(name, degraded(r) and needle in r['rows'][3]['why'],
|
|
558
|
+
'rc=%d ④=%s/%s %s' % (r['rc'], r['rows'][3]['status'], r['rows'][3]['cause'], r['rows'][3]['why'][:80]))
|
|
559
|
+
except Exception as e: # noqa: BLE001
|
|
560
|
+
chk(name, False, '예외로 죽음: %s: %s' % (type(e).__name__, e))
|
|
561
|
+
r = L.coach(wav, None, {1, 2}, env={'PATH': ffbin, 'FAKE_FFMPEG_KEEP': '0.99'})
|
|
562
|
+
chk('G3 컨트롤: 1% 짧음(문턱 2% 미만) · 오류 줄 없음 → exit 0 · 들린 표 그대로', r['rc'] == 0 and r['rows'][3]['cause'] is None,
|
|
563
|
+
'rc=%d' % r['rc'])
|
|
564
|
+
onlyff = os.path.join(tmp, 'bin_ffonly')
|
|
565
|
+
os.makedirs(onlyff)
|
|
566
|
+
install_tool(onlyff, 'ffmpeg', FAKE_FFMPEG)
|
|
567
|
+
try:
|
|
568
|
+
r = L.coach(wav, None, {1, 2}, env={'PATH': onlyff})
|
|
569
|
+
chk('G4 ffprobe 없음 → 길이 대조 못 함 = «부분」 · exit 2 (못 잰 것을 다 들었다고 안 한다)',
|
|
570
|
+
degraded(r) and '길이 대조' in r['rows'][3]['why'], 'rc=%d %s' % (r['rc'], r['rows'][3]['why'][:80]))
|
|
571
|
+
except Exception as e: # noqa: BLE001
|
|
572
|
+
chk('G4 ffprobe 없음 → 길이 대조 못 함 = «부분」 · exit 2 (못 잰 것을 다 들었다고 안 한다)', False,
|
|
573
|
+
'예외로 죽음: %s' % type(e).__name__)
|
|
574
|
+
orig_p = getattr(L, 'probe_duration', None)
|
|
575
|
+
try:
|
|
576
|
+
def boomp(*a, **k):
|
|
577
|
+
raise ZeroDivisionError('주입된 예외')
|
|
578
|
+
L.probe_duration = boomp
|
|
579
|
+
r = L.coach(wav, None, {1, 2}, env={'PATH': ffbin})
|
|
580
|
+
chk('G5 길이 조회(ffprobe 출력) 경계에 예외 주입 → «부분」 · exit 2 (크래시 아님)',
|
|
581
|
+
degraded(r) and 'ZeroDivisionError' in r['rows'][3]['why'], 'rc=%d' % r['rc'])
|
|
582
|
+
except Exception as e: # noqa: BLE001
|
|
583
|
+
chk('G5 길이 조회(ffprobe 출력) 경계에 예외 주입 → «부분」 · exit 2 (크래시 아님)', False,
|
|
584
|
+
'예외로 죽음: %s' % type(e).__name__)
|
|
585
|
+
finally:
|
|
586
|
+
if orig_p is None:
|
|
587
|
+
del L.probe_duration
|
|
588
|
+
else:
|
|
589
|
+
L.probe_duration = orig_p
|
|
590
|
+
# G6 진짜 ffmpeg 팔 — 합성 음성을 mp3 로 굽고 가운데 바이트를 깨뜨린다(codex 재현 형태: rc 0 + 오류 줄 + 잘림)
|
|
591
|
+
if real_ff:
|
|
592
|
+
mp3, bad3 = os.path.join(tmp, 'g6.mp3'), os.path.join(tmp, 'g6_bad.mp3')
|
|
593
|
+
pr = subprocess.run([real_ff, '-nostdin', '-v', 'error', '-y', '-i', wav, '-c:a', 'libmp3lame', '-b:a', '64k', mp3],
|
|
594
|
+
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
|
595
|
+
if pr.returncode == 0 and os.path.isfile(mp3):
|
|
596
|
+
d = bytearray(open(mp3, 'rb').read())
|
|
597
|
+
for i in range(len(d) // 3, len(d) // 3 + 4000):
|
|
598
|
+
d[i] = (d[i] * 7 + 13) & 255
|
|
599
|
+
open(bad3, 'wb').write(bytes(d))
|
|
600
|
+
renv = {'PATH': os.path.dirname(real_ff)}
|
|
601
|
+
r_ok = L.coach(mp3, None, {1, 2}, env=renv)
|
|
602
|
+
r_bad = L.coach(bad3, None, {1, 2}, env=renv)
|
|
603
|
+
chk('G6 진짜 ffmpeg: 멀쩡한 mp3 → exit 0', r_ok['rc'] == 0, 'rc=%d %s' % (r_ok['rc'], r_ok.get('decode_issue')))
|
|
604
|
+
chk('G6-b 진짜 ffmpeg: 가운데가 깨진 mp3(rc 0 디코드) → «부분」 · exit 2', degraded(r_bad),
|
|
605
|
+
'rc=%d issue=%s' % (r_bad['rc'], str(r_bad.get('decode_issue'))[:100]))
|
|
606
|
+
else:
|
|
607
|
+
skip('G6 진짜 ffmpeg 손상 팔', 'libmp3lame 인코더 없음')
|
|
608
|
+
else:
|
|
609
|
+
skip('G6 진짜 ffmpeg 손상 팔', '이 기계에 ffmpeg 가 없다')
|
|
610
|
+
# B-exec (codex R2): isfile·X_OK 는 통과하지만 실행이 안 되는 whisper(셰뱅 없는 스크립트 → ENOEXEC)
|
|
611
|
+
noexec = os.path.join(tmp, 'bin_noexec')
|
|
612
|
+
os.makedirs(noexec)
|
|
613
|
+
install_tool(noexec, 'ffmpeg', FAKE_FFMPEG)
|
|
614
|
+
install_tool(noexec, 'ffprobe', FAKE_FFPROBE)
|
|
615
|
+
with open(os.path.join(noexec, 'whisper-cli'), 'wb') as fh:
|
|
616
|
+
fh.write(b'\x00\x01not-an-executable\n')
|
|
617
|
+
os.chmod(os.path.join(noexec, 'whisper-cli'), 0o755)
|
|
618
|
+
try:
|
|
619
|
+
r = L.coach(wav, scr, (), env={'PATH': noexec, 'PREPREP_WHISPER_MODEL': model})
|
|
620
|
+
chk('B-exec 실행 불가 whisper → ①② 측정불가 · exit 2(트레이스백 아님)',
|
|
621
|
+
r['rc'] == 2 and r['rows'][0]['cause'] == r['rows'][1]['cause'] == L.CAUSE_DEP
|
|
622
|
+
and '실행' in r['rows'][1]['why'], 'rc=%d ②=%s' % (r['rc'], r['rows'][1]['why'][:70]))
|
|
623
|
+
except Exception as e: # noqa: BLE001
|
|
624
|
+
chk('B-exec 실행 불가 whisper → ①② 측정불가 · exit 2(트레이스백 아님)', False,
|
|
625
|
+
'예외로 죽음: %s: %s' % (type(e).__name__, e))
|
|
626
|
+
# B1: 원고 인코딩 — CP949 는 읽고, 어느 쪽으로도 못 읽으면 ① 측정불가(트레이스백 아님)
|
|
627
|
+
cp = os.path.join(tmp, 'script_cp949.txt')
|
|
628
|
+
with open(cp, 'wb') as fh:
|
|
629
|
+
fh.write(GREET_SCRIPT.encode('cp949'))
|
|
630
|
+
bad = os.path.join(tmp, 'script_bad.txt')
|
|
631
|
+
with open(bad, 'wb') as fh:
|
|
632
|
+
fh.write(b'\xff\xff\xfe\xff' * 8)
|
|
633
|
+
for label, path, want in (('B1 CP949 원고 → 읽는다(① 측정)', cp, 'ok'),
|
|
634
|
+
('B1-b UTF-8·CP949 둘 다 아닌 원고 → ① 측정불가 · exit 2', bad, 'dep')):
|
|
635
|
+
try:
|
|
636
|
+
r = L.coach(wav, path, (), env=env)
|
|
637
|
+
c1 = r['rows'][0]['cause']
|
|
638
|
+
good = (c1 is None and r['rc'] == 0) if want == 'ok' else (c1 == L.CAUSE_DEP and r['rc'] == 2
|
|
639
|
+
and '원고를 못 읽는다' in r['rows'][0]['why'])
|
|
640
|
+
chk(label, good, 'rc=%d ①=%s' % (r['rc'], r['rows'][0]['why'][:60]))
|
|
641
|
+
except Exception as e: # noqa: BLE001 — 트레이스백 자체가 이 레인의 실패다
|
|
642
|
+
chk(label, False, '예외로 죽음: %s: %s' % (type(e).__name__, e))
|
|
643
|
+
if hasattr(os, 'geteuid') and os.geteuid() != 0:
|
|
644
|
+
nor = os.path.join(tmp, 'script_noread.txt')
|
|
645
|
+
with open(nor, 'w', encoding='utf-8') as fh:
|
|
646
|
+
fh.write(GREET_SCRIPT)
|
|
647
|
+
os.chmod(nor, 0)
|
|
648
|
+
try:
|
|
649
|
+
r = L.coach(wav, nor, (), env=env)
|
|
650
|
+
chk('B1-c 읽기 권한 없는 원고 → ① 측정불가 · exit 2', r['rows'][0]['cause'] == L.CAUSE_DEP and r['rc'] == 2)
|
|
651
|
+
except Exception as e: # noqa: BLE001
|
|
652
|
+
chk('B1-c 읽기 권한 없는 원고 → ① 측정불가 · exit 2', False, '예외로 죽음: %s' % type(e).__name__)
|
|
653
|
+
finally:
|
|
654
|
+
os.chmod(nor, 0o600)
|
|
655
|
+
else:
|
|
656
|
+
skip('B1-c 읽기 권한', 'root 로 돌아서 권한 거부를 재현 못 한다')
|
|
657
|
+
|
|
658
|
+
r = L.coach(wav, scr, (), env=dict(env, FAKE_WHISPER_TEXTS=json.dumps([''] * 8)))
|
|
659
|
+
chk('D6-g 빈 받아쓰기(낱말 0) → ①② 측정불가 · exit 2 («접속사 0개」로 접히지 않는다)',
|
|
660
|
+
r['rc'] == 2 and r['rows'][1]['cause'] == L.CAUSE_DEP and r['rows'][0]['cause'] == L.CAUSE_DEP,
|
|
661
|
+
'rc=%d ②=%s' % (r['rc'], r['rows'][1]['why']))
|
|
662
|
+
|
|
663
|
+
p = subprocess.run([sys.executable, os.path.join(HERE, 'lane_speech_coach.py'), wav, '--audio-only'],
|
|
664
|
+
env=dict(os.environ, PATH=ffbin + os.pathsep + os.path.dirname(sys.executable)),
|
|
665
|
+
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
666
|
+
chk('D7 CLI --audio-only → rc 0 · 표 6행', p.returncode == 0 and p.stdout.decode().count(' — ') >= 6,
|
|
667
|
+
'rc=%d' % p.returncode)
|
|
668
|
+
p = subprocess.run([sys.executable, os.path.join(HERE, 'lane_speech_coach.py'), wav],
|
|
669
|
+
env=dict(os.environ, PATH=empty), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
670
|
+
chk('D7-b CLI ffmpeg 없음 → rc 2 (1 도 0 도 아니다)', p.returncode == 2, 'rc=%d' % p.returncode)
|
|
671
|
+
# codex R7: «²» 는 isdigit() 참·int() 실패 — 크래시(exit 1)가 아니라 인자 오류(exit 2)여야 한다.
|
|
672
|
+
for bad in ('²', '9' * 30, '1,x'):
|
|
673
|
+
p = subprocess.run([sys.executable, os.path.join(HERE, 'lane_speech_coach.py'), wav, '--skip', bad],
|
|
674
|
+
env=dict(os.environ, PATH=ffbin + os.pathsep + os.path.dirname(sys.executable)),
|
|
675
|
+
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
676
|
+
chk('D7-c CLI --skip %r → rc 2 (크래시 아님)' % bad,
|
|
677
|
+
p.returncode == 2 and b'Traceback' not in p.stderr, 'rc=%d' % p.returncode)
|
|
678
|
+
|
|
679
|
+
# Output failures are instrument errors, while valid JSON preserves the measured result.
|
|
680
|
+
cli = [sys.executable, os.path.join(HERE, 'lane_speech_coach.py'), wav, '--audio-only', '--json']
|
|
681
|
+
cli_env = dict(os.environ, PATH=ffbin + os.pathsep + os.path.dirname(sys.executable))
|
|
682
|
+
good_json = os.path.join(tmp, 'cli-result.json')
|
|
683
|
+
p = subprocess.run(cli + [good_json], env=cli_env, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
684
|
+
with open(good_json, encoding='utf-8') as fh:
|
|
685
|
+
result = json.load(fh)
|
|
686
|
+
chk('D7-json valid output preserves rc 0 and the JSON result',
|
|
687
|
+
p.returncode == 0 and result['rc'] == 0 and b'Traceback' not in p.stderr)
|
|
688
|
+
for label, output in [('directory', tmp), ('missing parent', os.path.join(tmp, 'missing', 'result.json'))]:
|
|
689
|
+
p = subprocess.run(cli + [output], env=cli_env, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
690
|
+
chk('D7-json %s output failure is rc 2, no traceback' % label,
|
|
691
|
+
p.returncode == 2 and b'Traceback' not in p.stderr and b'JSON output' in p.stderr,
|
|
692
|
+
'rc=%d' % p.returncode)
|
|
693
|
+
|
|
694
|
+
# Real tools must read the literal local filename, not a leading option or a file: URL.
|
|
695
|
+
real_probe = shutil.which('ffprobe')
|
|
696
|
+
if real_ff and real_probe:
|
|
697
|
+
named = os.path.join(tmp, 'literal-names')
|
|
698
|
+
os.mkdir(named)
|
|
699
|
+
L.write_wav(os.path.join(named, 'clip.wav'), array.array('h', [0] * 1600))
|
|
700
|
+
for name in ('-clip.wav', 'file:clip.wav'):
|
|
701
|
+
L.write_wav(os.path.join(named, name), array.array('h', [0] * 3200))
|
|
702
|
+
cwd = os.getcwd()
|
|
703
|
+
try:
|
|
704
|
+
os.chdir(named)
|
|
705
|
+
for name in ('clip.wav', '-clip.wav', 'file:clip.wav'):
|
|
706
|
+
expected = 1600 if name == 'clip.wav' else 3200
|
|
707
|
+
try:
|
|
708
|
+
samples, errs = L.decode(name, real_ff)
|
|
709
|
+
duration = L.probe_duration(name, real_probe)
|
|
710
|
+
chk('D7-local literal %s uses the correct file in ffmpeg and ffprobe' % name,
|
|
711
|
+
len(samples) == expected and not errs and abs(duration - expected / SR) < 0.00001)
|
|
712
|
+
except Exception as e:
|
|
713
|
+
chk('D7-local literal %s uses the correct file in ffmpeg and ffprobe' % name,
|
|
714
|
+
False, type(e).__name__)
|
|
715
|
+
finally:
|
|
716
|
+
os.chdir(cwd)
|
|
717
|
+
else:
|
|
718
|
+
skip('D7-local literal filenames', 'real ffmpeg or ffprobe unavailable')
|
|
719
|
+
|
|
720
|
+
if real_ff:
|
|
721
|
+
r = L.coach(wav, None, {1, 2}, env={'PATH': os.path.dirname(real_ff)})
|
|
722
|
+
chk('D8 진짜 ffmpeg 팔 → 같은 덩어리 8개 · exit 0', r['rc'] == 0 and r['n_chunks'] == 8,
|
|
723
|
+
'rc=%d chunks=%s' % (r['rc'], r.get('n_chunks')))
|
|
724
|
+
else:
|
|
725
|
+
skip('D8 진짜 ffmpeg 팔', '이 기계에 ffmpeg 가 없다')
|
|
726
|
+
|
|
727
|
+
# 되돌림 — 지역 문턱을 전역 문턱으로 바꾸면 잡음 바닥이 오른 구간의 쉼이 사라져야 한다
|
|
728
|
+
print('L16 되돌림 프로브')
|
|
729
|
+
s = Synth(9)
|
|
730
|
+
for _ in range(65):
|
|
731
|
+
s.tone(0.6, amp=8000, namp=20, harmonics=1).sil(0.4, namp=20)
|
|
732
|
+
for _ in range(65):
|
|
733
|
+
s.tone(0.6, amp=8000, namp=400, harmonics=1).sil(0.4, namp=400)
|
|
734
|
+
db = L.frame_db(s.arr())
|
|
735
|
+
base, _ = L.segment(db)
|
|
736
|
+
orig = L.thr_series
|
|
737
|
+
try:
|
|
738
|
+
L.thr_series = lambda d, *a, **k: [L.pct(d, 10) + L.C('rel_db')] * len(d)
|
|
739
|
+
assert L.thr_series is not orig # 적용 확인 — 바꿔 끼운 것이 실제로 쓰이는가
|
|
740
|
+
mut, _ = L.segment(db)
|
|
741
|
+
finally:
|
|
742
|
+
L.thr_series = orig
|
|
743
|
+
after, _ = L.segment(db)
|
|
744
|
+
chk('R1 지역 문턱 → 잡음 바닥이 오른 구간도 덩어리로 가른다(≥90/130)', len(base) >= 90, 'BASE %d' % len(base))
|
|
745
|
+
chk('R1-b 전역 문턱으로 되돌리면 그 구간이 붙는다(≥20 감소)', len(mut) <= len(base) - 20,
|
|
746
|
+
'BASE %d → MUT %d' % (len(base), len(mut)))
|
|
747
|
+
chk('R1-c 복원 후 BASE 와 같다', len(after) == len(base), 'AFTER %d' % len(after))
|
|
748
|
+
|
|
749
|
+
|
|
750
|
+
if __name__ == '__main__':
|
|
751
|
+
sys.exit(main())
|