@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.
- package/.claude/rules/fh_4axis_gate.md +35 -1
- package/.claude-plugin/marketplace.json +2 -2
- package/AGENTS.md +50 -0
- package/CLAUDE.md +14 -1
- package/README.ja.md +3 -3
- package/README.ko.md +3 -3
- package/README.md +4 -4
- package/README.zh.md +3 -3
- package/docs/ETHOS.md +21 -0
- package/docs/IDENTITIES.md +83 -0
- package/knowledge/shared/harness-core/fh_detail_protocols.md +77 -1
- package/knowledge/shared/harness-core/measurement-integrity-checklist.md +80 -0
- package/knowledge/shared/harness-core/ship_readiness_gate.md +199 -5
- package/knowledge/shared/learnings/subagent_invocations_log.yaml +173 -0
- package/knowledge/shared/rules/multi_session_close_protocol.md +7 -1
- package/package.json +23 -2
- package/plugins/fh-commons/.claude-plugin/plugin.json +2 -2
- package/plugins/fh-commons/skills/preprep/README.md +45 -0
- package/plugins/fh-commons/skills/preprep/SKILL.md +214 -0
- package/plugins/fh-commons/skills/preprep/canon_terms.example.yaml +36 -0
- package/plugins/fh-commons/skills/preprep/fixtures/adjdup_known_negative.md +7 -0
- package/plugins/fh-commons/skills/preprep/fixtures/adjdup_known_positive.md +8 -0
- package/plugins/fh-commons/skills/preprep/fixtures/progression_known_negative.md +13 -0
- package/plugins/fh-commons/skills/preprep/fixtures/progression_known_positive.md +13 -0
- package/plugins/fh-commons/skills/preprep/fixtures/promise_known_negative.md +9 -0
- package/plugins/fh-commons/skills/preprep/fixtures/promise_known_positive.md +7 -0
- package/plugins/fh-commons/skills/preprep/interslide_deps.py +223 -0
- package/plugins/fh-commons/skills/preprep/jargon_terms.example.yaml +40 -0
- package/plugins/fh-commons/skills/preprep/lane_adjacent_dup.py +86 -0
- package/plugins/fh-commons/skills/preprep/lane_progression.py +81 -0
- package/plugins/fh-commons/skills/preprep/lane_promise.py +121 -0
- package/plugins/fh-commons/skills/preprep/ooxml/c1_baseline.txt +12 -0
- package/plugins/fh-commons/skills/preprep/ooxml/gate.py +164 -0
- package/plugins/fh-commons/skills/preprep/preprep.py +789 -0
- package/plugins/fh-commons/skills/preprep/presentation_checklist.md +310 -0
- package/plugins/fh-commons/skills/preprep/surfaces.example.yaml +148 -0
- package/plugins/fh-meta/.claude-plugin/plugin.json +1 -1
- package/plugins/fh-meta/CHANGELOG.md +140 -0
- package/plugins/fh-meta/skills/install-wizard/SKILL.md +39 -0
- package/scripts/com.forge-harness.daily-report.plist +44 -0
- package/scripts/context_continuity_score.sh +894 -0
- package/scripts/daily_report.sh +208 -0
- package/scripts/digest_landing_check.sh +71 -0
- package/scripts/directional_diff_gate.sh +11 -4
- package/scripts/fh_session_load.sh +19 -0
- package/scripts/field_canon_preload.sh +44 -0
- package/scripts/fixture_guard_lib.sh +55 -0
- package/scripts/lane_runner_check.sh +34 -1
- package/scripts/launchd_wiring_check.sh +182 -0
- package/scripts/mapped_tracks.sh +69 -0
- package/scripts/novelty_claim_check.sh +5 -1
- package/scripts/package_coverage_check.sh +39 -0
- package/scripts/portability_lint.sh +117 -0
- package/scripts/prepush_guard_check.sh +2 -2
- package/scripts/public_surface_scan_files.sh +36 -1
- package/scripts/selfcheck.sh +171 -1
- package/scripts/session_close_check.sh +17 -0
- package/scripts/shell_name_boundary_scan.sh +30 -0
- package/scripts/sim_isolated_run.sh +484 -0
- package/scripts/test_branch_claim_lanes.sh +8 -3
- package/scripts/test_env_purity_lanes.sh +4 -1
- package/scripts/test_lane_runner_lanes.sh +75 -0
- package/scripts/test_mapped_tracks_lanes.sh +64 -2
- package/scripts/test_marker_address_lanes.sh +78 -0
- package/scripts/test_marker_soul_check_lanes.sh +36 -0
- package/scripts/test_memory_link_check.sh +3 -1
- package/scripts/test_node_check_lanes.sh +5 -2
- package/scripts/test_node_infra_delta_lanes.sh +3 -1
- package/scripts/test_peer_worktree_detect_lanes.sh +3 -1
- package/scripts/test_precommit_staged_drift_lanes.sh +91 -0
- package/scripts/test_preprep_adjacent_dup_lanes.sh +57 -0
- package/scripts/test_preprep_drift_anchor.sh +65 -0
- package/scripts/test_preprep_progression_lanes.sh +53 -0
- package/scripts/test_preprep_promise_lanes.sh +56 -0
- package/scripts/test_preprep_retired_lanes.sh +54 -0
- package/scripts/test_prepush_destructive_lanes.sh +5 -2
- package/scripts/test_prepush_stdin_integrity.sh +2 -2
- package/scripts/test_regression_guard_ci_lanes.sh +4 -1
- package/scripts/test_selfcheck_state_lanes.sh +19 -4
- package/scripts/test_session_close_lanes.sh +5 -5
- package/scripts/test_sim_isolated_run_lanes.sh +265 -0
- package/scripts/test_skill_canon_preload_lanes.sh +58 -0
- package/scripts/test_target_freeze_lanes.sh +3 -1
- package/scripts/test_verdict_watermark_lanes.sh +427 -0
- package/scripts/test_wizard_snippet_merge_lanes.sh +4 -1
- package/scripts/universal_guard_check.sh +1 -1
- package/templates/.git-hooks/pre-commit +426 -8
- package/templates/.git-hooks/pre-push +8 -3
- package/templates/predelete_check.sh +4 -2
- package/templates/regression_guard.sh +7 -1
|
@@ -0,0 +1,789 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""발표 준비 하네스 v0.1 — 발표 자산군 전체(덱 + 기술문서 + Q&A + 초록)를 한 번에 얼라인한다.
|
|
3
|
+
|
|
4
|
+
챔버 런 #14 (`tracks/_chamber/multisurface-reading-harness/`) 의 EMIT 산출물.
|
|
5
|
+
「다표면 읽기」는 이 하네스의 **한 렌즈(L2)** 이지 전체 이름이 아니다(운영자 위계 정정 2026-08-20).
|
|
6
|
+
|
|
7
|
+
레인:
|
|
8
|
+
L1 canon — 원장 「🚫 인용금지 / ⚠️ 조건필수」를 **전 표면**에 건다 (한글 낭독형 포함)
|
|
9
|
+
L2 unit-ref — 표면 쌍의 단위 참조 정합 (대상의 «은퇴 선언 어휘»를 존중 — 안 하면 20% FP)
|
|
10
|
+
L3 inventory — 선언된 표면이 실물로 있나 (부재 = UNMEASURED, **0 이 아니다**)
|
|
11
|
+
L4 getput — 왕복 no-op 컨트롤. **v0.1 미배선 → NOT_WIRED 로 말한다**(거짓 초록 금지)
|
|
12
|
+
|
|
13
|
+
exit 0 = 전 레인 통과 · 1 = 발견 있음 · 2 = 계기 오류/미측정으로 판정 불가 (PASS 아님)
|
|
14
|
+
|
|
15
|
+
usage: preprep.py [surfaces.yaml] [--lane L1,L2,...]
|
|
16
|
+
"""
|
|
17
|
+
import sys, os, re, ast, zipfile, yaml
|
|
18
|
+
|
|
19
|
+
HERE = os.path.dirname(os.path.abspath(__file__))
|
|
20
|
+
ANSI_OK, ANSI_BAD, ANSI_UNK = '🟢', '🟥', '⚠️'
|
|
21
|
+
|
|
22
|
+
def load(path):
|
|
23
|
+
with open(path, encoding='utf-8') as f: return yaml.safe_load(f)
|
|
24
|
+
|
|
25
|
+
def resolve(root, p):
|
|
26
|
+
return os.path.normpath(os.path.join(root, os.path.expanduser(p)))
|
|
27
|
+
|
|
28
|
+
# 🟥 2026-08-25 신설 — 선언 경로가 판번호로 하드코딩돼 stale 해지는 클래스(G2).
|
|
29
|
+
# 실측: surfaces.yaml 이 v4.6 을 가리키는 동안 실제 산출물은 v7.5 였다(12판 차이).
|
|
30
|
+
# ⚠️ **최신본으로 자동 추종하지 않는다** — 옛 판을 «일부러» 재는 경우를 뺏기 때문이다.
|
|
31
|
+
# 대신 ⓐ 무엇을 쟀는지 항상 출력하고 ⓑ 선언 ≠ 디스크 최신본이면 그 자체를 발견으로 낸다.
|
|
32
|
+
def version_drift(path):
|
|
33
|
+
import glob
|
|
34
|
+
d, b = os.path.dirname(path), os.path.basename(path)
|
|
35
|
+
m = re.match(r'(.*?_v)(\d+)\.(\d+)(\.pptx)$', b)
|
|
36
|
+
if not m: return None
|
|
37
|
+
cand = []
|
|
38
|
+
for f in glob.glob(os.path.join(d, m.group(1) + '*' + m.group(4))):
|
|
39
|
+
mm = re.match(r'.*?_v(\d+)\.(\d+)\.pptx$', os.path.basename(f))
|
|
40
|
+
if mm: cand.append(((int(mm.group(1)), int(mm.group(2))), os.path.basename(f)))
|
|
41
|
+
if not cand: return None
|
|
42
|
+
newest = max(cand)
|
|
43
|
+
here = (int(m.group(2)), int(m.group(3)))
|
|
44
|
+
if newest[0] > here:
|
|
45
|
+
return (b, newest[1])
|
|
46
|
+
return None
|
|
47
|
+
|
|
48
|
+
# ── 표면 읽기 어댑터 ───────────────────────────────────────────────────────────
|
|
49
|
+
def read_text(path, kind):
|
|
50
|
+
"""표면의 «읽을 수 있는 텍스트». 못 읽으면 예외 — 호출자가 UNMEASURED 로 계상한다.
|
|
51
|
+
🟥 pptx 는 XML 텍스트 레이어만 읽는다. **이미지에 구워진 텍스트는 구조적으로 안 보인다**
|
|
52
|
+
(실측 2026-08-18) — L1 이 그 한계를 출력에 명시한다. 미측정을 0 으로 접지 않는다."""
|
|
53
|
+
if kind in ('markdown', 'html', 'note_map'):
|
|
54
|
+
return open(path, encoding='utf-8', errors='replace').read()
|
|
55
|
+
if kind == 'pptx':
|
|
56
|
+
out = []
|
|
57
|
+
with zipfile.ZipFile(path) as z:
|
|
58
|
+
for n in z.namelist():
|
|
59
|
+
if re.match(r'ppt/(slides|notesSlides)/\w+\.xml$', n):
|
|
60
|
+
out.append(re.sub(r'<[^>]+>', ' ', z.read(n).decode('utf-8', 'replace')))
|
|
61
|
+
return '\n'.join(out)
|
|
62
|
+
if kind == 'figure_source':
|
|
63
|
+
# 🟥 2026-08-21 신설 — 이 파일 헤더가 「이미지에 구워진 텍스트는 구조적으로 안 보인다」고
|
|
64
|
+
# 선언해 뒀는데, 그 사각에서 같은 날 **두 건이 물었다**: 도해 안의 「초록이 는 게
|
|
65
|
+
# 아닙니다」(오타 + 덱이 버린 은어)와 도해 전면의 「계열」(덱은 「모델/종류」로 갔다).
|
|
66
|
+
# 둘 다 화면에는 떠 있고 텍스트 레이어엔 없어서, 눈으로 보기 전엔 아무 레인도 못 잡았다.
|
|
67
|
+
# ⇒ **그림은 못 읽지만 그림을 그리는 소스는 읽을 수 있다.** 생성기의 문자열 리터럴만
|
|
68
|
+
# 뽑아 표면으로 세운다. 이러면 L1(원장 금칙)·L5(조어)가 도해까지 덮는다.
|
|
69
|
+
# ⚠️ 이건 «그림을 읽는 것»이 아니다 — 생성기를 안 거친 그림(손으로 넣은 png)은
|
|
70
|
+
# 여전히 안 보인다. 사각이 좁아진 것이지 닫힌 게 아니다.
|
|
71
|
+
src = open(path, encoding='utf-8', errors='replace').read()
|
|
72
|
+
lits = re.findall(r'"([^"\n]{2,})"|\'([^\'\n]{2,})\'', src)
|
|
73
|
+
return '\n'.join(a or b for a, b in lits)
|
|
74
|
+
if kind == 'keynote':
|
|
75
|
+
raise RuntimeError('keynote: 사람만 읽는 면 — 기계 어댑터 없음')
|
|
76
|
+
raise RuntimeError(f'unknown kind: {kind}')
|
|
77
|
+
|
|
78
|
+
def note_map_ids(path):
|
|
79
|
+
src = open(path, encoding='utf-8').read()
|
|
80
|
+
m = re.search(r'^NOTE_MAP\s*=\s*\{', src, re.M)
|
|
81
|
+
if not m: raise RuntimeError('NOTE_MAP 미발견')
|
|
82
|
+
start, depth = m.end() - 1, 0
|
|
83
|
+
for i in range(start, len(src)):
|
|
84
|
+
if src[i] == '{': depth += 1
|
|
85
|
+
elif src[i] == '}':
|
|
86
|
+
depth -= 1
|
|
87
|
+
if depth == 0:
|
|
88
|
+
return {v[0] for v in ast.literal_eval(src[start:i+1]).values() if v[0]}
|
|
89
|
+
raise RuntimeError('NOTE_MAP 괄호 불균형')
|
|
90
|
+
|
|
91
|
+
def manuscript_ids(path, pattern, retire_markers):
|
|
92
|
+
"""🟥 은퇴 선언을 **헤딩에서만** 찾던 초판은 4장을 살아있는 것으로 계상했다.
|
|
93
|
+
실측(2026-08-20): S19 만 헤딩에 선언이 있고, S20-c·S20-d 는 **인용줄**에,
|
|
94
|
+
S8·S18-b 는 **아예 선언이 없다**. ⇒ 판정면을 «장 블록»으로 넓힌다.
|
|
95
|
+
선언이 없는 장은 그대로 남아 진짜 발견이 된다(그게 이 레인이 잡아야 할 것이다).
|
|
96
|
+
(블라인드 challenger 가 소스 직독으로 지목 → 거버너가 grep 으로 확정)"""
|
|
97
|
+
src = open(path, encoding='utf-8').read()
|
|
98
|
+
ids = []
|
|
99
|
+
heads = list(re.finditer(pattern + r'([^\n]*)', src, re.M))
|
|
100
|
+
for i, m in enumerate(heads):
|
|
101
|
+
end = heads[i+1].start() if i+1 < len(heads) else len(src)
|
|
102
|
+
block = src[m.start():end][:1500] # 선언은 장 앞부분에 온다
|
|
103
|
+
if any(t in block for t in retire_markers): continue
|
|
104
|
+
ids.append(m.group(1))
|
|
105
|
+
if not ids: raise RuntimeError('섹션 헤딩 0건 — 포맷 불일치')
|
|
106
|
+
return set(ids)
|
|
107
|
+
|
|
108
|
+
# ── use vs mention ─────────────────────────────────────────────────────────────
|
|
109
|
+
# 🟥 이 구분이 L1 의 하중선이다. 첫 실행에서 40건이 나왔는데 손검증 3/3 이 **«쓰지 마라»고 적은
|
|
110
|
+
# 줄**이었다 — 원장 자신이 기록한 자기참조 결함(«세는 대상 안에 출처 문서가 들어 있어, 계기가
|
|
111
|
+
# 자기 정의를 착지로 셌다»)이 이 계기에 그대로 재현됐다.
|
|
112
|
+
# 🟥 그렇다고 **걸러서 지우지 않는다** — 죽은 필터가 진짜를 죽인다. 두 부류로 **갈라서 낸다**.
|
|
113
|
+
_HIST = re.compile(r'^\s*>\s*(🆕|🟥|⚠️|✅|🔵|🎯|📌|\*\*20\d\d-|운영자[ :]|원인\(|기전|\*"|정본 ?=)')
|
|
114
|
+
|
|
115
|
+
MENTION_CUES = ('🚫', '금지', '대신 쓸 것', '폐기', 'stale', '반증', '원장', '오기',
|
|
116
|
+
'쓰지 않는다', '안 쓴다', '등재', '철회', '죽었', '틀린',
|
|
117
|
+
# 손검증에서 나온 추가 큐 (2026-08-20, USE 표본 손대조) — 정정 서술의 어휘
|
|
118
|
+
'교체', '원문', '건너뛴', '구값', '대체', '재측정 필수', '→')
|
|
119
|
+
|
|
120
|
+
def classify(line):
|
|
121
|
+
"""USE(살아있는 사용) / MENTION(그것을 말하지 말라고 적은 줄). 보수적으로 — 애매하면 USE.
|
|
122
|
+
|
|
123
|
+
🟥 초판은 `>` 로 시작하면 무조건 MENTION 이었다. **이 코퍼스는 낭독도 `>` 다**(1232줄).
|
|
124
|
+
그래서 원고 표면의 L1 판정 건수가 **0** 이었다 — 가장 중요한 표면을 통째로 못 봤고,
|
|
125
|
+
출력은 초록으로 보였다. 「죽은 필터가 진짜를 죽인다」를 이 파일이 경고해놓고 저질렀다.
|
|
126
|
+
(블라인드 페르소나 2인이 각각 지목 · 거버너 자력 적발 0 · 실행 한 번으로 확정)
|
|
127
|
+
⇒ 판별자는 인용부호가 아니라 **주석 어휘**다. `>` 는 이제 아무 정보도 아니다."""
|
|
128
|
+
t = line.strip().lstrip('> ').strip()
|
|
129
|
+
if t.startswith('#'): return 'MENTION' # 소스 주석 — 청중이 안 본다
|
|
130
|
+
# 대본 안의 «*(화면: …)*» 는 낭독이 아니라 화면 지시다. 원장이 그 둘을 다르게 규정한다
|
|
131
|
+
# (절대수: 화면 허용 · 낭독 금지) — 표면 단위로만 갈면 이 줄이 오탐으로 남는다(실측).
|
|
132
|
+
if t.startswith('*(화면') or t.startswith('(화면'): return 'MENTION'
|
|
133
|
+
if t.startswith('>'): return 'MENTION' # 인용/주석 블록
|
|
134
|
+
if t.startswith('|') and any(c in t for c in MENTION_CUES): return 'MENTION' # 원장 표 행
|
|
135
|
+
if any(c in t for c in MENTION_CUES): return 'MENTION'
|
|
136
|
+
return 'USE'
|
|
137
|
+
|
|
138
|
+
def hits(text, lit, speech_marker=None): # yields (cls, line_no, line)
|
|
139
|
+
"""speech_marker 가 선언되면 **그 표시가 여는 블록 안**만 USE 후보다 — 대상 자신의 어휘로
|
|
140
|
+
범위를 좁힌다(은퇴 표기와 같은 원리, 그쪽은 실측으로 20% FP 를 없앴다)."""
|
|
141
|
+
in_speech = speech_marker is None
|
|
142
|
+
for no, ln in enumerate(text.split('\n'), 1):
|
|
143
|
+
if speech_marker:
|
|
144
|
+
# 🟥 «줄 안에 있으면» 이 아니라 «줄이 그것으로 시작하면». 2026-08-20 실측:
|
|
145
|
+
# 이 코퍼스의 앞머리에 `각 장의 \`🗣\` = 발표자가 말할 것` 이라는 **범례**가 있어,
|
|
146
|
+
# 기호를 설명하는 줄이 기호로 읽히고 그 뒤 앞머리 75줄이 통째로 «낭독»이 됐다.
|
|
147
|
+
# 실제 낭독 블록은 항상 줄머리에 표시자가 온다(L98 등) — 그게 판별자다.
|
|
148
|
+
if ln.lstrip().startswith(speech_marker): in_speech = True
|
|
149
|
+
elif ln.startswith('###') or ln.startswith('🖥') or ln.startswith('⏱'): in_speech = False
|
|
150
|
+
# 🟥 이력 블록이 열리면 낭독 블록은 끝난 것이다. 이 코퍼스는 개정 이력을 낭독과
|
|
151
|
+
# **같은 `>` 인용 블록 안**에 이어 붙이고(구판 문장을 통째로 인용하는 일이 흔하다),
|
|
152
|
+
# 그래서 「그럼 이 적대검증이 … 보여 드리겠습니다」 같은 **폐기된 낭독**이 살아있는
|
|
153
|
+
# 낭독으로 계상됐다. 표시자로 열고 이력 표시로 닫는다 — 이 판별은 이 파일이 이미
|
|
154
|
+
# L2 에서 쓰는 «대상 자신의 어휘로 범위를 좁힌다»와 같은 원리다. (2026-08-20 실측)
|
|
155
|
+
elif _HIST.match(ln): in_speech = False
|
|
156
|
+
if lit in ln:
|
|
157
|
+
cls = classify(ln)
|
|
158
|
+
if cls == 'USE' and not in_speech: cls = 'mention'
|
|
159
|
+
yield cls, no, ln.strip()
|
|
160
|
+
|
|
161
|
+
# ── L1 canon ──────────────────────────────────────────────────────────────────
|
|
162
|
+
def lane_canon(cfg, root, texts, surf_meta):
|
|
163
|
+
terms = load(resolve(HERE, cfg['canon_terms']) if not os.path.isabs(cfg['canon_terms'])
|
|
164
|
+
else cfg['canon_terms'])
|
|
165
|
+
findings, notes = [], []
|
|
166
|
+
|
|
167
|
+
# L1-a 원장 ↔ 기계 목록 커버리지 (이 하네스가 잡는 결함이 자기 자신에게도 난다)
|
|
168
|
+
ledger = resolve(root, cfg['canon_ledger'])
|
|
169
|
+
try:
|
|
170
|
+
rows = [l for l in open(ledger, encoding='utf-8') if l.startswith('| **') ]
|
|
171
|
+
n_terms = (len(terms.get('banned', [])) + len(terms.get('conditional', []))
|
|
172
|
+
+ len(terms.get('retired', [])))
|
|
173
|
+
notes.append(f'L1-a 원장 표 행 {len(rows)} ↔ 기계 항목 {n_terms} — '
|
|
174
|
+
+ ('커버 비율은 판정 안 한다(행≠항목 1:1 아님). 갈림 감시용 수치' ))
|
|
175
|
+
except Exception as e:
|
|
176
|
+
notes.append(f'L1-a UNCOVERED: 원장을 못 읽었다 ({e})')
|
|
177
|
+
|
|
178
|
+
for sid, (text, kind) in texts.items():
|
|
179
|
+
for entry in terms.get('banned', []):
|
|
180
|
+
if entry.get('spoken_only') and not surf_meta.get(sid, {}).get('spoken'):
|
|
181
|
+
continue # 낭독 표면에서만 판정하는 항목
|
|
182
|
+
for lit in entry['literals'] + entry.get('ko_spoken', []):
|
|
183
|
+
if not lit: continue
|
|
184
|
+
for cls, no, ln in hits(text, lit, surf_meta.get(sid, {}).get('marker')):
|
|
185
|
+
# 리터럴이 너무 일반적일 때: 같은 줄에 맥락 어휘가 있어야 판정한다
|
|
186
|
+
# (실측: «0.44» 가 슬라이드 y좌표 0.44 를 세 번 잡았다)
|
|
187
|
+
if cls == 'USE' and entry.get('context_required') and \
|
|
188
|
+
not any(c in ln for c in entry['context_required']):
|
|
189
|
+
cls = 'mention'
|
|
190
|
+
findings.append((f'{sid}:{no}', 'BANNED' if cls == 'USE' else 'mention',
|
|
191
|
+
entry['id'], lit, (entry['why'] + ' ▸ ' + ln[:110]) if cls == 'USE' else ln[:110]))
|
|
192
|
+
# ── L1-c 폐어(retired) — «리뷰가 걷어낸 낱말이 되돌아왔나» ────────────────
|
|
193
|
+
# 🟥 실사고: 리뷰가 명시적으로 걷어내라 한 「재다」가 **나흘 뒤** 재유입됐고
|
|
194
|
+
# **아무 검사도 안 울렸다**(운영자가 잡았다). `jargon_terms` 는 조어→풀이를,
|
|
195
|
+
# `banned` 는 수치 인용 금지를 다뤄서 «걷어낸 말»을 담을 자리가 없었다.
|
|
196
|
+
# 🟥 왜 새 레인이 아니라 여기인가: 기계는 «리터럴을 전 표면에서 찾기»로 같은데
|
|
197
|
+
# **처방이 다르다**(폐어=대체어를 써라 / 금지인용=그 재측정을 대라). 태그와 처방만
|
|
198
|
+
# 가르면 «판정은 맞고 처방이 틀린 게이트»를 피하면서 레인 하나를 안 늘린다.
|
|
199
|
+
# 🟥 그리고 USE↔MENTION 이 여기서 하중을 진다 — 폐어를 «걷어냈다»고 적은 원장 자신이
|
|
200
|
+
# 그 낱말을 담는다. 못 가르면 원장이 자기를 위반으로 신고한다.
|
|
201
|
+
for entry in terms.get('retired', []):
|
|
202
|
+
for lit in entry['literals'] + entry.get('ko_spoken', []):
|
|
203
|
+
if not lit: continue
|
|
204
|
+
for cls, no, ln in hits(text, lit, surf_meta.get(sid, {}).get('marker')):
|
|
205
|
+
if cls != 'USE':
|
|
206
|
+
findings.append((f'{sid}:{no}', 'mention', entry['id'], lit, ln[:110]))
|
|
207
|
+
continue
|
|
208
|
+
prov = ' · '.join(x for x in (entry.get('retired_by'), entry.get('retired_at')) if x)
|
|
209
|
+
rep = entry.get('replacement')
|
|
210
|
+
msg = (entry.get('why', '리뷰가 걷어낸 낱말')
|
|
211
|
+
+ (f" ▸ 대신: «{rep}»" if rep else " ▸ 🟥 대체어 미기재 — 처방 없는 판정이다")
|
|
212
|
+
+ (f" ({prov})" if prov else '') + ' ▸ ' + ln[:110])
|
|
213
|
+
findings.append((f'{sid}:{no}', 'RETIRED', entry['id'], lit, msg))
|
|
214
|
+
for entry in terms.get('conditional', []):
|
|
215
|
+
for lit in entry['literals']:
|
|
216
|
+
if lit and lit in text:
|
|
217
|
+
for cls, no, ln in hits(text, lit, surf_meta.get(sid, {}).get('marker')):
|
|
218
|
+
if cls != 'USE': continue
|
|
219
|
+
# 조건 어휘는 **같은 줄**에서 본다 — 문서 전체에서 보면 언제나 통과한다
|
|
220
|
+
if not any(r in ln for r in entry['require_nearby']):
|
|
221
|
+
findings.append((f'{sid}:{no}', 'UNCONDITIONED', entry['id'], lit,
|
|
222
|
+
entry['why'] + ' ▸ ' + ln[:110]))
|
|
223
|
+
return findings, notes
|
|
224
|
+
|
|
225
|
+
# ── L2 unit-ref ───────────────────────────────────────────────────────────────
|
|
226
|
+
def lane_unitref(cfg, root, surf):
|
|
227
|
+
findings, notes = [], []
|
|
228
|
+
for a, b in cfg.get('pairs', []):
|
|
229
|
+
sa, sb = surf[a], surf[b]
|
|
230
|
+
try:
|
|
231
|
+
ids_a = manuscript_ids(resolve(root, sa['path']), sa['unit_pattern'],
|
|
232
|
+
sa.get('retire_markers', []))
|
|
233
|
+
ids_b = note_map_ids(resolve(root, sb['path']))
|
|
234
|
+
except Exception as e:
|
|
235
|
+
notes.append(f'L2 INSTRUMENT ERROR ({a}↔{b}): {e} — 미측정이지 0 이 아니다')
|
|
236
|
+
continue
|
|
237
|
+
only_a, only_b = sorted(ids_a - ids_b), sorted(ids_b - ids_a)
|
|
238
|
+
if only_a: findings.append((a, 'DEAD-REF', b, ', '.join(only_a),
|
|
239
|
+
f'{a} 만 참조 — 독자에겐 살아 보이지만 {b} 에 없다'))
|
|
240
|
+
if only_b: findings.append((b, 'ORPHAN', a, ', '.join(only_b),
|
|
241
|
+
f'{b} 에만 있다 — 원고 없는 단위가 빌드된다'))
|
|
242
|
+
if not only_a and not only_b:
|
|
243
|
+
notes.append(f'L2 {a}↔{b}: 드리프트 0 ({len(ids_a)} 단위 일치)')
|
|
244
|
+
return findings, notes
|
|
245
|
+
|
|
246
|
+
# ── L4 getput (왕복 no-op 컨트롤) ───────────────────────────────────────────────
|
|
247
|
+
# BX/lens 의 **GetPut 법칙**에서 빌려왔다: 뷰를 안 고쳤으면 소스도 안 바뀌어야 한다.
|
|
248
|
+
# 🟥 지금까지 있던 것은 PutGet 하나뿐이었다(사람이 고친 뒤 «반영됐나» 28/28). GetPut 이 없으면
|
|
249
|
+
# **왕복기가 항상 무언가 바꾸는 상태여도 초록이 난다** — 컨트롤 없는 계기다.
|
|
250
|
+
# 기계만으로 도는 축을 쓴다: 원고 🗣 → [빌드] → pptx 노트 → 정규화 → 원고와 대조.
|
|
251
|
+
# 사람 편집이 0 인 구간이므로 **차이는 전부 왕복기 손실**이다.
|
|
252
|
+
# ⚠️ Keynote 경로(osascript)는 사람 면이라 여기서 안 쓴다 — 그쪽은 영구 UNMEASURED.
|
|
253
|
+
def lane_getput(cfg, root, surf):
|
|
254
|
+
import importlib.util
|
|
255
|
+
findings, notes = [], []
|
|
256
|
+
scripts_dir = os.path.normpath(os.path.join(root, '..', 'scripts'))
|
|
257
|
+
pull = os.path.join(scripts_dir, 'ifkakao_pull_notes.py')
|
|
258
|
+
if not os.path.exists(pull):
|
|
259
|
+
return [], ['L4 NOT_WIRED — 왕복기 부재 (UNMEASURED, 통과 아님)']
|
|
260
|
+
try:
|
|
261
|
+
spec = importlib.util.spec_from_file_location('pn', pull)
|
|
262
|
+
pn = importlib.util.module_from_spec(spec); spec.loader.exec_module(pn)
|
|
263
|
+
tags = pn.builder_tags(); nm = pn.note_map()
|
|
264
|
+
draft, _sc = pn.draft_speech()
|
|
265
|
+
except Exception as e:
|
|
266
|
+
return [], [f'L4 INSTRUMENT ERROR: {e} — 미측정이지 0 이 아니다']
|
|
267
|
+
|
|
268
|
+
deck = resolve(root, surf['built_deck']['path'])
|
|
269
|
+
notes.append(f'L4 잰 산출물: {os.path.basename(deck)}') # 무엇을 쟀는지가 판정의 일부다
|
|
270
|
+
_vd = version_drift(deck)
|
|
271
|
+
if _vd:
|
|
272
|
+
findings.append(('roundtrip', 'DECLARED-STALE', 'surfaces.yaml',
|
|
273
|
+
f'선언 {_vd[0]} 인데 디스크 최신본은 {_vd[1]}',
|
|
274
|
+
'의도적으로 옛 판을 재는 것이면 사유를 선언에 적어라. '
|
|
275
|
+
'아니면 surfaces.yaml 의 built_deck 을 갱신해라 — 이 레인은 선언을 따른다'))
|
|
276
|
+
try:
|
|
277
|
+
# 🟥 2026-08-25 수리 — notesSlide 「파일 번호」를 「발표 순번」으로 쓰면 안 된다.
|
|
278
|
+
# OOXML 은 그 둘을 관계(rels)로 잇지 파일명으로 잇지 않는다. 실측: 이 덱의 노트는
|
|
279
|
+
# 3~55 번을 쓰는데 슬라이드는 1~53 이고, slide19→notesSlide18 처럼 어긋난다.
|
|
280
|
+
# 옛 코드는 notes_xml[파일번호] 를 notes_xml[순번] 으로 조회해 **전건을 밀린 채** 쟀다.
|
|
281
|
+
# 매핑은 sldIdLst(순서) → presentation.rels(슬라이드 파일) → slides/_rels(노트 파일).
|
|
282
|
+
def _para_text(raw):
|
|
283
|
+
paras = []
|
|
284
|
+
for pm in re.finditer(r'<a:p>(.*?)</a:p>', raw, re.S):
|
|
285
|
+
t = ''.join(re.findall(r'<a:t>([^<]*)</a:t>', pm.group(1)))
|
|
286
|
+
if t.strip(): paras.append(t)
|
|
287
|
+
return '\n'.join(paras)
|
|
288
|
+
|
|
289
|
+
notes_xml = {}
|
|
290
|
+
no_note = []
|
|
291
|
+
with zipfile.ZipFile(deck) as z:
|
|
292
|
+
pres = z.read('ppt/presentation.xml').decode('utf-8', 'replace')
|
|
293
|
+
prels = z.read('ppt/_rels/presentation.xml.rels').decode('utf-8', 'replace')
|
|
294
|
+
rid2t = dict(re.findall(r'Id="(rId\d+)"[^>]*Target="([^"]+)"', prels))
|
|
295
|
+
order = re.findall(r'<p:sldId [^>]*r:id="(rId\d+)"', pres)
|
|
296
|
+
for pos, rid in enumerate(order, start=1):
|
|
297
|
+
tgt = rid2t.get(rid)
|
|
298
|
+
if not tgt:
|
|
299
|
+
no_note.append(pos); continue
|
|
300
|
+
base = os.path.basename(tgt)
|
|
301
|
+
srel = 'ppt/slides/_rels/%s.rels' % base
|
|
302
|
+
if srel not in z.namelist():
|
|
303
|
+
no_note.append(pos); continue
|
|
304
|
+
nm_ = re.search(r'Target="([^"]*notesSlide[^"]*)"',
|
|
305
|
+
z.read(srel).decode('utf-8', 'replace'))
|
|
306
|
+
if not nm_:
|
|
307
|
+
no_note.append(pos); continue
|
|
308
|
+
npath = 'ppt/notesSlides/' + os.path.basename(nm_.group(1))
|
|
309
|
+
if npath not in z.namelist():
|
|
310
|
+
no_note.append(pos); continue
|
|
311
|
+
notes_xml[pos] = _para_text(z.read(npath).decode('utf-8', 'replace'))
|
|
312
|
+
except Exception as e:
|
|
313
|
+
return [], [f'L4 INSTRUMENT ERROR: pptx 노트 추출 실패 — {e} (UNMEASURED)']
|
|
314
|
+
|
|
315
|
+
# 🟥 컨트롤이 살아 있나부터 본다 — 노트가 0장이면 «차이 0» 은 통과가 아니라 미측정이다
|
|
316
|
+
if not notes_xml:
|
|
317
|
+
return [], ['L4 UNMEASURED — pptx 에 노트 슬라이드 0장. «차이 0» 아님']
|
|
318
|
+
|
|
319
|
+
# 판정에서 빼는 단위는 **선언으로** 받는다 — 코드에 박으면 그게 다음 드리프트다
|
|
320
|
+
skip_units = set(cfg.get('getput_skip_units', []))
|
|
321
|
+
compared = skipped = unmeasured = 0
|
|
322
|
+
for idx, tag in enumerate(tags, start=1):
|
|
323
|
+
ent = nm.get(tag)
|
|
324
|
+
if not ent or not ent[0]: continue
|
|
325
|
+
sid = ent[0]
|
|
326
|
+
if sid not in draft: continue
|
|
327
|
+
if idx not in notes_xml:
|
|
328
|
+
unmeasured += 1; continue # 🟥 조용히 넘기면 «대조 N절» 의 N 만 줄어 «차이 0» 쪽으로 열화된다
|
|
329
|
+
if sid in skip_units:
|
|
330
|
+
skipped += 1; continue
|
|
331
|
+
a = pn.norm_lines(draft[sid]); b = pn.norm_lines(notes_xml[idx])
|
|
332
|
+
compared += 1
|
|
333
|
+
if a != b:
|
|
334
|
+
# 🟥 «다르다» 를 한 덩어리로 내면 처방이 뭉개진다. 두 부류는 처방이 정반대다:
|
|
335
|
+
# ORDER-DRIFT = 재빌드(내용은 다 있다) · GETPUT-LOSS = 왕복기 수리(내용이 없다)
|
|
336
|
+
owner = next((o for o in draft
|
|
337
|
+
if o != sid and o not in skip_units and pn.norm_lines(draft[o]) == b), None)
|
|
338
|
+
if owner:
|
|
339
|
+
findings.append(('roundtrip', 'ORDER-DRIFT', f'slide{idx}',
|
|
340
|
+
f'배선은 {sid} 인데 산출물엔 {owner} 의 낭독이 들어 있다',
|
|
341
|
+
'내용 손실 아님 — 산출물이 현재 배선 순서를 안 따른다(재빌드 필요). '
|
|
342
|
+
'🟥 그 전에 그 산출물에 사람 손첨삭이 있는지 봐라 — 재빌드가 덮는다'))
|
|
343
|
+
else:
|
|
344
|
+
only = len([x for x in a if x not in b]) + len([x for x in b if x not in a])
|
|
345
|
+
findings.append(('roundtrip', 'GETPUT-LOSS', sid,
|
|
346
|
+
f'{len(a)}문장 vs {len(b)}문장 · 불일치 {only}',
|
|
347
|
+
'사람 편집 0 구간인데 왕복이 안 닫힌다 — 차이는 왕복기 손실이다'))
|
|
348
|
+
notes.append(f'L4 getput: 대조 {compared}절 · 근사구간 skip {skipped}절 (S5·S15, 왕복기 명시 한계) '
|
|
349
|
+
f'· 🟥 UNMEASURED {unmeasured}절 (노트 매핑 없음 — 0 아님)')
|
|
350
|
+
if no_note:
|
|
351
|
+
notes.append(f'L4 노트 없는 슬라이드 {len(no_note)}장 (위치 {no_note[:8]}{"…" if len(no_note)>8 else ""}) — UNMEASURED')
|
|
352
|
+
if compared == 0:
|
|
353
|
+
notes.append('L4 🟥 UNMEASURED — 대조된 절이 0. 컨트롤이 죽었다, «차이 0» 아님')
|
|
354
|
+
return findings, notes
|
|
355
|
+
|
|
356
|
+
# ── main ──────────────────────────────────────────────────────────────────────
|
|
357
|
+
# ── L5 jargon ─────────────────────────────────────────────────────────────────
|
|
358
|
+
def lane_jargon(cfg, root, texts, surf_meta):
|
|
359
|
+
"""선언된 조어가 **낭독면 첫 등장에 풀이를 달고 있는가**.
|
|
360
|
+
|
|
361
|
+
🟥 판정하는 것은 «이 단어가 어려운가»가 아니다 — 그건 결론이고 코드로 굳히면 천장이 된다.
|
|
362
|
+
재는 것은 기록의 성질 하나다: 선언 목록에 있는 어휘의 첫 USE 둘레에 풀이 어휘가 있는가.
|
|
363
|
+
어느 단어를 조어로 볼지는 `jargon_terms.yaml` 에 사람이 적는다.
|
|
364
|
+
🟥 낭독면(spoken: true)만 본다. 화면 텍스트·원장·Q&A 는 다른 규약이라 여기 섞으면 오탐이다.
|
|
365
|
+
미선언 어휘는 구조적으로 안 보인다 — 이 레인의 0 은 «조어가 없다»가 아니라
|
|
366
|
+
«선언한 것 중 풀이 없는 게 없다»이다. 0 을 «깨끗하다»로 읽지 말 것."""
|
|
367
|
+
cfgp = cfg.get('jargon_terms')
|
|
368
|
+
if not cfgp: return [], ['L5 jargon : 선언 파일 없음 — NOT_CONFIGURED (0 아님)']
|
|
369
|
+
spec = load(resolve(HERE, cfgp) if not os.path.isabs(cfgp) else cfgp)
|
|
370
|
+
win = int(spec.get('gloss_window', 2))
|
|
371
|
+
findings, notes = [], []
|
|
372
|
+
spoken = [sid for sid, m in surf_meta.items() if m.get('spoken')]
|
|
373
|
+
if not spoken:
|
|
374
|
+
return [], ['L5 jargon : 낭독면 선언 0 — UNMEASURED (0 아님)']
|
|
375
|
+
checked = glossed = 0
|
|
376
|
+
for sid in spoken:
|
|
377
|
+
if sid not in texts: continue
|
|
378
|
+
text, _ = texts[sid]
|
|
379
|
+
# 🟥 대상이 스스로 «STALE / 고치지 마라» 라고 선언했으면 판정 대상이 아니다.
|
|
380
|
+
# L2 가 이미 «대상의 은퇴 선언 어휘를 존중»하는 것과 같은 원리 — 안 하면 폐기된
|
|
381
|
+
# 사본을 고치라고 지시하게 되고, 그건 이 코퍼스가 이미 세 번 겪은 이중 소스 사고다.
|
|
382
|
+
head = '\n'.join(text.split('\n')[:40])
|
|
383
|
+
if 'STATUS: STALE' in head or '이 파일을 고치지 마라' in head:
|
|
384
|
+
notes.append(f'L5 jargon : {sid} 는 자기선언 STALE — 판정 제외 (0 아님, RETIRED)')
|
|
385
|
+
continue
|
|
386
|
+
lines = text.split('\n')
|
|
387
|
+
marker = surf_meta[sid].get('marker')
|
|
388
|
+
for t in spec['terms']:
|
|
389
|
+
first = None
|
|
390
|
+
for lit in t['literals']:
|
|
391
|
+
for cls, no, ln in hits(text, lit, marker):
|
|
392
|
+
if cls != 'USE': continue
|
|
393
|
+
# 🟥 이력/주석 블록 배제 (2026-08-20 첫 실사용에서 이 레인이 낸 오탐).
|
|
394
|
+
# 이 코퍼스의 개정 이력은 낭독과 **같은 `>` 인용 블록**에 살고, 앞머리
|
|
395
|
+
# 이모지로만 갈린다. 전역 classify 를 고치지 않는 이유: L1 이 그 함수에
|
|
396
|
+
# 붙어 있고 이 델타는 L5 만 고치기로 한 범위다(회귀 위험 > 중복 비용).
|
|
397
|
+
if _HIST.match(ln): continue
|
|
398
|
+
if first is None or no < first[0]: first = (no, lit, ln)
|
|
399
|
+
if first is None: continue
|
|
400
|
+
checked += 1
|
|
401
|
+
no, lit, ln = first
|
|
402
|
+
lo, hi = max(0, no - 1 - win), min(len(lines), no + win)
|
|
403
|
+
around = '\n'.join(lines[lo:hi])
|
|
404
|
+
if any(g in around for g in t.get('gloss', [])):
|
|
405
|
+
glossed += 1
|
|
406
|
+
findings.append((f'{sid}:L5', 'mention', f'{t["id"]}@{no}', lit,
|
|
407
|
+
'첫 등장에 풀이 있음 — 통과'))
|
|
408
|
+
else:
|
|
409
|
+
findings.append((sid, 'JARGON-UNGLOSSED', f'{t["id"]}@{no}', lit,
|
|
410
|
+
f'선언된 조어인데 첫 등장 ±{win}줄에 풀이가 없다 '
|
|
411
|
+
f'▸ 권장: {t["plain"]} ▸ {ln[:60]}'))
|
|
412
|
+
notes.append(f'L5 jargon : 선언 {len(spec["terms"])}항 · 낭독면 등장 {checked}항 · '
|
|
413
|
+
f'첫 등장 풀이 있음 {glossed}항 '
|
|
414
|
+
f'(⚠️ 미선언 어휘는 구조적으로 안 보인다 — 0 을 «조어 없음»으로 읽지 말 것)')
|
|
415
|
+
return findings, notes
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
def lane_pacing(cfg, root, texts, surf_meta):
|
|
419
|
+
"""L6 — **장당 발화가 상한을 넘는가.** 넘으면 쪼개거나 줄이라고 «권고»한다.
|
|
420
|
+
|
|
421
|
+
🟥 재는 것은 기록의 성질 하나다: 이 장에 붙은 낭독의 길이. «이 장이 지루한가»가 아니다
|
|
422
|
+
— 그건 결론이고, 코드로 굳히면 오늘의 취향이 내일의 천장이 된다.
|
|
423
|
+
🟥 상한은 **`surfaces.yaml speech_pacing` 에 사람이 적는다.** 문헌엔 «한 장 N초»가 없다
|
|
424
|
+
(그 근거는 그 yaml 주석에 적어 뒀다). 기본값은 이 코퍼스 n=1 실측이므로 새 발표는
|
|
425
|
+
분포부터 다시 재라 — 그래서 이 레인은 상한 위반뿐 아니라 **평균·중앙값·이봉 여부**를
|
|
426
|
+
항상 같이 출력한다. 분포를 안 보여주면 남의 숫자를 그대로 쓰게 된다.
|
|
427
|
+
🟥 **단위가 «장»인지 «절»인지 반드시 밝힌다.** 빌드된 덱(pptx)이 있으면 장 단위로 재고,
|
|
428
|
+
없으면 원고의 절 단위로 재면서 그 사실을 라벨에 박는다 — 한 절이 여러 장으로 쪼개져
|
|
429
|
+
있으면 절 단위 수치는 **과대**다. 조용히 절을 장이라고 부르면 그 순간 계기가 거짓말한다.
|
|
430
|
+
"""
|
|
431
|
+
pac = cfg.get('speech_pacing')
|
|
432
|
+
if not pac:
|
|
433
|
+
return [], ['L6 pacing : speech_pacing 선언 없음 — NOT_CONFIGURED (0 아님)']
|
|
434
|
+
lo = float(pac.get('chars_per_sec', [5.18, 5.35])[0])
|
|
435
|
+
hard, soft = float(pac.get('hard_sec', 45)), float(pac.get('soft_sec', 30))
|
|
436
|
+
|
|
437
|
+
unit, rows = None, []
|
|
438
|
+
deck = cfg.get('surfaces_by_id', {}).get('built_deck')
|
|
439
|
+
dpath = resolve(root, deck['path']) if deck else None
|
|
440
|
+
if dpath and os.path.exists(dpath):
|
|
441
|
+
try:
|
|
442
|
+
from pptx import Presentation # noqa
|
|
443
|
+
prs = Presentation(dpath)
|
|
444
|
+
for i, sl in enumerate(prs.slides, 1):
|
|
445
|
+
t = sl.notes_slide.notes_text_frame.text
|
|
446
|
+
if t.startswith('[간지]') or t.startswith('[진행]') or not t.strip():
|
|
447
|
+
continue
|
|
448
|
+
rows.append((f'p{i}', len(re.sub(r'\s', '', t.replace('(이어서) ', '')))))
|
|
449
|
+
unit = '장'
|
|
450
|
+
except ImportError:
|
|
451
|
+
pass
|
|
452
|
+
if unit is None:
|
|
453
|
+
# 🟥 절 단위 폴백. **첫 구현이 6.5배 틀렸다**(18.0분짜리 원고를 116.8분으로 셌다) —
|
|
454
|
+
# 낭독과 개정 이력이 **같은 `>` 인용 블록**에 살아서, 「> 로 시작하면 낭독」 규칙이
|
|
455
|
+
# 이력을 통째로 삼켰다. 6.5배 틀린 계기에 «절 단위라 과대» 라벨만 달아 내보내면
|
|
456
|
+
# 그 라벨이 오히려 오차를 정상으로 보이게 만든다 — 라벨은 오차의 변명이 아니다.
|
|
457
|
+
# ⇒ 규칙을 정확히 옮긴다: 🗣 뒤의 `>` 를 **빈 줄로 블록 분할**하고, 각 블록의
|
|
458
|
+
# **첫 글자가 한글/영숫자인 것만** 낭독으로 센다(이력 블록은 🆕/🟥/⚠️ 로 시작한다).
|
|
459
|
+
spoken = [sid for sid, m in surf_meta.items() if m.get('spoken')]
|
|
460
|
+
if not spoken:
|
|
461
|
+
return [], ['L6 pacing : 낭독면 선언 0 — UNMEASURED (0 아님)']
|
|
462
|
+
_STRIP = '*_"\'«»『「(> '
|
|
463
|
+
for sid in spoken:
|
|
464
|
+
if sid not in texts: continue
|
|
465
|
+
text, _ = texts[sid]
|
|
466
|
+
marker = surf_meta[sid].get('marker') or '\U0001f5e3'
|
|
467
|
+
unit_re = re.compile(surf_meta[sid].get('unit_pattern') or r'^###\s+(\S+)')
|
|
468
|
+
state = {'cur': None, 'blocks': [], 'blk': []}
|
|
469
|
+
def _flush():
|
|
470
|
+
if state['blk']:
|
|
471
|
+
state['blocks'].append(list(state['blk'])); state['blk'].clear()
|
|
472
|
+
def _emit():
|
|
473
|
+
if not state['cur']: return
|
|
474
|
+
body = []
|
|
475
|
+
for b in state['blocks']:
|
|
476
|
+
probe = b[0].lstrip(_STRIP)
|
|
477
|
+
if not probe: continue
|
|
478
|
+
c = probe[0]
|
|
479
|
+
if not (('가' <= c <= '힣') or c.isalnum()): continue
|
|
480
|
+
body.extend(b)
|
|
481
|
+
joined = re.sub(r'\*\*|`|\*', '', ''.join(body))
|
|
482
|
+
rows.append((state['cur'], len(re.sub(r'\s', '', joined))))
|
|
483
|
+
mode = 'out'
|
|
484
|
+
for raw in text.split('\n'):
|
|
485
|
+
st = raw.strip()
|
|
486
|
+
m = unit_re.match(raw)
|
|
487
|
+
if m:
|
|
488
|
+
_flush(); _emit()
|
|
489
|
+
state['cur'], state['blocks'], mode = m.group(1), [], 'out'; continue
|
|
490
|
+
if state['cur'] is None: continue
|
|
491
|
+
if st.startswith(marker): _flush(); mode = 'speech'; continue
|
|
492
|
+
if st[:1] in ('\U0001f5a5', '⏱') or st.startswith('##'):
|
|
493
|
+
_flush(); mode = 'out'; continue
|
|
494
|
+
if mode != 'speech': continue
|
|
495
|
+
if st == '' or st == '---': _flush(); continue
|
|
496
|
+
if not st.startswith('>'): _flush(); mode = 'out'; continue
|
|
497
|
+
state['blk'].append(st.lstrip('> '))
|
|
498
|
+
_flush(); _emit()
|
|
499
|
+
unit = '절'
|
|
500
|
+
# 🟥 배선에 없는 절은 **무대에 안 선다** — 세면 과대다. 실측: 폴백이 26절 21.2분을 냈는데
|
|
501
|
+
# 배선된 절만 세면 24절이고, 차이 2절이 그대로 3.2분이었다. 배선 표면이 있으면 거른다.
|
|
502
|
+
if unit == '절':
|
|
503
|
+
wsurf = cfg.get('surfaces_by_id', {}).get('wiring')
|
|
504
|
+
try:
|
|
505
|
+
live = note_map_ids(resolve(root, wsurf['path'])) if wsurf else None
|
|
506
|
+
except Exception as e:
|
|
507
|
+
live = None; notes_pre = f'배선 파싱 실패({e})'
|
|
508
|
+
else:
|
|
509
|
+
notes_pre = None
|
|
510
|
+
if live:
|
|
511
|
+
dead = [k for k, _ in rows if k not in live]
|
|
512
|
+
rows = [(k, n) for k, n in rows if k in live]
|
|
513
|
+
if dead: _dead_note = f'L6 pacing : 배선에 없어 제외한 절 {len(dead)}개 — {", ".join(dead)}'
|
|
514
|
+
else: _dead_note = 'L6 pacing : 배선에 없는 절 0'
|
|
515
|
+
else:
|
|
516
|
+
_dead_note = ('L6 pacing : 🟥 배선 대조 못 함' + (f' ({notes_pre})' if notes_pre else '')
|
|
517
|
+
+ ' — 무대에 안 서는 절이 섞여 **과대**일 수 있다. 이건 0 이 아니라 미대조다')
|
|
518
|
+
else:
|
|
519
|
+
_dead_note = None
|
|
520
|
+
rows = [(k, n) for k, n in rows if n]
|
|
521
|
+
if not rows:
|
|
522
|
+
return [], ['L6 pacing : 낭독 추출 0 — UNMEASURED (0 아님, 계기가 못 읽은 것일 수 있다)']
|
|
523
|
+
|
|
524
|
+
secs = sorted(n / lo for _, n in rows)
|
|
525
|
+
mean, med = sum(secs) / len(secs), secs[len(secs) // 2]
|
|
526
|
+
# 이봉 판정 — 상한 근처 ±5초 대역이 전체의 5% 미만이면 «사이가 비었다»
|
|
527
|
+
band = [x for x in secs if abs(x - soft) <= 5]
|
|
528
|
+
findings, notes = [], []
|
|
529
|
+
if _dead_note: notes.append(_dead_note)
|
|
530
|
+
notes.append(f'L6 pacing : 단위={unit} · {len(rows)}개 · 평균 {mean:.0f}초 · 중앙값 {med:.0f}초 '
|
|
531
|
+
f'· 총 {sum(secs)/60:.1f}분 (자수÷실측속도 — 전환·호흡 제외. '
|
|
532
|
+
f'**실낭독 실측·배분 합은 원고 ⏱ 가 정본이고 이 값보다 길다**) '
|
|
533
|
+
f'· 상한 HARD {hard:.0f}/SOFT {soft:.0f}초'
|
|
534
|
+
+ ('' if unit == '장' else ' ⚠️ 절 단위라 장 단위보다 **과대**하다'))
|
|
535
|
+
notes.append(f'L6 pacing : SOFT±5초 대역에 {len(band)}개({len(band)/len(rows)*100:.0f}%) — '
|
|
536
|
+
+ ('분포가 갈려 있다(이봉). 상한을 몇 초로 두든 걸리는 것이 거의 같다'
|
|
537
|
+
if len(band)/len(rows) < 0.05 else
|
|
538
|
+
'경계 대역에 몰려 있다 — 상한을 바꾸면 결과가 크게 흔들린다. 숫자를 신중히'))
|
|
539
|
+
for k, n in sorted(rows, key=lambda r: -r[1]):
|
|
540
|
+
sec = n / lo
|
|
541
|
+
if sec > hard:
|
|
542
|
+
findings.append((k, 'PACING-OVER-HARD', f'{n}자', f'{sec:.0f}초',
|
|
543
|
+
f'{unit} 하나가 상한 {hard:.0f}초를 넘는다 ▸ 쪼개거나 줄여라'))
|
|
544
|
+
elif sec > soft:
|
|
545
|
+
findings.append((f'{k}:L6', 'mention', f'{n}자', f'{sec:.0f}초',
|
|
546
|
+
f'권고 대역 초과({soft:.0f}초) — 판단은 사람'))
|
|
547
|
+
return findings, notes
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
# ── L8 interslide ─────────────────────────────────────────────────────────────
|
|
551
|
+
def lane_interslide(cfg, root):
|
|
552
|
+
"""L8 — **장 사이 의존이 깨졌나.** 챔버 런 #15 가 배출한 계기를 하네스 안에서 돌린다.
|
|
553
|
+
|
|
554
|
+
실사고: S8 을 빼자 S9 가 성립 불가가 됐다(S9 는 S8 의 화면을 재사용). 렌더를 한 장씩 다 봐도 구조적으로 안 잡혔다 — **운영자가 잡았다** — 한 장씩 보기 때문이다. 사람이 잡았지 계기가 아니었다.
|
|
555
|
+
|
|
556
|
+
🟥 **advisory 고정 — findings 를 내지 않는다(종료코드에 안 태운다).**
|
|
557
|
+
판정문(챔버 #15 EMISSION_VERDICT)이 못박은 운용 형태다. 이 계기의 오탐을
|
|
558
|
+
최저비용으로 무마하는 길이 «지시어 삭제»라서, 종료코드에 태우면 원고를
|
|
559
|
+
**나쁜 방향으로 미는** 압력이 된다.
|
|
560
|
+
⚠️ UNRESOLVED 는 «안 깨졌다»가 아니라 **미측정**이다. 0 으로 접지 않는다.
|
|
561
|
+
"""
|
|
562
|
+
spec = cfg.get('interslide')
|
|
563
|
+
if not spec:
|
|
564
|
+
return [], ['L8 interslide : 선언 없음 — NOT_CONFIGURED (0 아님)']
|
|
565
|
+
mod_p = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'interslide_deps.py')
|
|
566
|
+
if not os.path.exists(mod_p):
|
|
567
|
+
return [], [f'L8 interslide : 계기 부재({mod_p}) — NOT_WIRED (0 아님)']
|
|
568
|
+
surf_by_id = {x['id']: x for x in cfg.get('surfaces', [])}
|
|
569
|
+
ms = surf_by_id.get(spec.get('manuscript'))
|
|
570
|
+
if not ms:
|
|
571
|
+
return [], [f'L8 interslide : 원고 표면 «{spec.get("manuscript")}» 미선언 — NOT_CONFIGURED (0 아님)']
|
|
572
|
+
draft_p, build_p = resolve(root, ms['path']), resolve(root, spec['builder'])
|
|
573
|
+
for label, p in (('원고', draft_p), ('배선 정본', build_p)):
|
|
574
|
+
if not os.path.exists(p):
|
|
575
|
+
return [], [f'L8 interslide : {label} 실물 없음({p}) — UNMEASURED (0 아님)']
|
|
576
|
+
try:
|
|
577
|
+
import importlib.util
|
|
578
|
+
sp = importlib.util.spec_from_file_location('interslide_deps', mod_p)
|
|
579
|
+
m = importlib.util.module_from_spec(sp); sp.loader.exec_module(m)
|
|
580
|
+
r = m.analyze(draft_p, build_p)
|
|
581
|
+
except Exception as e:
|
|
582
|
+
return [], [f'L8 interslide : 계기 오류({e}) — UNMEASURED (0 아님)']
|
|
583
|
+
if r.get('error'):
|
|
584
|
+
return [], [f'L8 interslide : {r["error"]} — UNMEASURED (0 아님)']
|
|
585
|
+
|
|
586
|
+
hard = sum(1 for e in r['edges'] if e[2] == 'HARD')
|
|
587
|
+
notes = [f'L8 interslide : 절 {r["n_units"]} · 배선 {r["n_wired"]} · HARD 의존 {hard}건 '
|
|
588
|
+
f'· 깨짐 {len(r["broken"])} · UNRESOLVED {len(r["unresolved"])} (advisory)']
|
|
589
|
+
for sid, prev, _ in r['broken']:
|
|
590
|
+
notes.append(f' {ANSI_BAD} L8 깨진 의존: {sid} 가 {prev} 를 필요로 하는데 {prev} 는 안 만들어진다')
|
|
591
|
+
for sid, terms, _ in r['unresolved']:
|
|
592
|
+
notes.append(f' {ANSI_UNK} L8 UNRESOLVED: {sid} — 대상어 {terms} (미측정, 0 아님)')
|
|
593
|
+
return [], notes
|
|
594
|
+
|
|
595
|
+
def lane_regen(cfg, root):
|
|
596
|
+
"""L7 — **재생성이 사람 편집을 삼켰나.** 생성면 ↔ 사람이 만진 사본을 대조한다.
|
|
597
|
+
|
|
598
|
+
🟥 이 레인은 README 「다음(미착수)」 2번(**표면별 정본 축 선언** — 문자열=원고 /
|
|
599
|
+
서식=Keynote, Jupytext paired-notebook 원리)이 **실제로 터진 뒤에** 생겼다.
|
|
600
|
+
2026-08-21 실측: 빌더가 발표자 노트를 **전량 덮어써서** 사람이 손으로 쓴 발화
|
|
601
|
+
**20곳**이 소리 없이 사라졌다. 빌드는 성공했고, 원고↔빌드 대조는 «원고대로»였다.
|
|
602
|
+
⇒ 대조 축이 «원본 ↔ 생성물» 하나뿐이면 **사람 편집면은 구조적으로 안 보인다.**
|
|
603
|
+
|
|
604
|
+
🟥 최소 길이 필터를 두지 않는다(minlen 없음). 같은 날 실측: 회수 도구에 12자 필터를
|
|
605
|
+
걸었더니 「계측기→검증 장치」·「—→.」 같은 **짧지만 의도가 분명한 수정 14곳**이
|
|
606
|
+
통째로 안 보였다. 필터는 노이즈를 줄인 게 아니라 **신호를 지웠다.**
|
|
607
|
+
|
|
608
|
+
⚠️ 이 레인의 «0» 은 «두 사본이 같다»가 아니라 **«사람 사본에만 있는 조각이 없다»**이다.
|
|
609
|
+
생성물에만 있는 것(원고에서 온 정상 갱신)은 세지 않는다 — 방향이 있는 대조다.
|
|
610
|
+
"""
|
|
611
|
+
spec = cfg.get('regen_recovery')
|
|
612
|
+
if not spec:
|
|
613
|
+
return [], ['L7 regen : regen_recovery 선언 없음 — NOT_CONFIGURED (0 아님)']
|
|
614
|
+
gen_p, hum_p = resolve(root, spec['generated']), resolve(root, spec['human'])
|
|
615
|
+
for label, p in (('generated', gen_p), ('human', hum_p)):
|
|
616
|
+
if not os.path.exists(p):
|
|
617
|
+
return [], [f'L7 regen : {label} 실물 없음({p}) — UNMEASURED (0 아님). '
|
|
618
|
+
f'사람 사본은 **내보내야** 생긴다(키노트 → pptx). 안 내보내면 이 레인은 못 잰다']
|
|
619
|
+
try:
|
|
620
|
+
from pptx import Presentation
|
|
621
|
+
except ImportError:
|
|
622
|
+
return [], ['L7 regen : python-pptx 없음 — UNMEASURED (0 아님)']
|
|
623
|
+
import difflib
|
|
624
|
+
|
|
625
|
+
def notes(path):
|
|
626
|
+
pr = Presentation(path)
|
|
627
|
+
return [re.sub(r'\s+', ' ', (s.notes_slide.notes_text_frame.text
|
|
628
|
+
if s.has_notes_slide else '')
|
|
629
|
+
.replace('(이어서) ', '')).strip() for s in pr.slides]
|
|
630
|
+
A, B = notes(gen_p), notes(hum_p)
|
|
631
|
+
findings, notes_out = [], []
|
|
632
|
+
if len(A) != len(B):
|
|
633
|
+
notes_out.append(f'L7 regen : 🟥 장 수가 다르다 — 생성 {len(A)} · 사람 {len(B)}. '
|
|
634
|
+
f'앞에서부터 짝지으므로 **어긋난 뒤 결과는 못 믿는다**(부분 측정)')
|
|
635
|
+
for i, (a, b) in enumerate(zip(A, B), 1):
|
|
636
|
+
if a == b:
|
|
637
|
+
continue
|
|
638
|
+
sm = difflib.SequenceMatcher(None, a, b)
|
|
639
|
+
gone = [b[j1:j2] for t, _, _, j1, j2 in sm.get_opcodes()
|
|
640
|
+
if t in ('replace', 'insert') and b[j1:j2].strip()]
|
|
641
|
+
for g in gone:
|
|
642
|
+
findings.append((f'p{i}', 'REGEN-ATE-EDIT', '사람 사본에만 있음', g.strip()[:70],
|
|
643
|
+
'재생성이 삼켰다 — **원본(생성 소스)으로 옮겨라.** 사본에 두면 다음 빌드가 또 지운다'))
|
|
644
|
+
notes_out.append(f'L7 regen : {min(len(A), len(B))}장 대조 · 사람 사본에만 있는 조각 {len(findings)}건 '
|
|
645
|
+
f'(⚠️ 0 은 «같다»가 아니라 «삼킨 게 없다»이다)')
|
|
646
|
+
return findings, notes_out
|
|
647
|
+
|
|
648
|
+
|
|
649
|
+
def selftest_pacing():
|
|
650
|
+
"""known-pair. 계기가 «상한 초과»와 «이내»를 실제로 가르는지 — 안 가르면 장식이다."""
|
|
651
|
+
cfg = {'speech_pacing': {'chars_per_sec': [5.0, 5.0], 'hard_sec': 10, 'soft_sec': 5}}
|
|
652
|
+
meta = {'s': {'spoken': True, 'marker': '🗣', 'unit_pattern': r'^###\s+(\S+)'}}
|
|
653
|
+
long_ = '가' * 60 # 60자 / 5.0 = 12초 > HARD 10
|
|
654
|
+
short = '가' * 20 # 20자 / 5.0 = 4초 < SOFT 5
|
|
655
|
+
cases = [
|
|
656
|
+
('known-positive(상한 초과)', f'### A\n🗣\n> {long_}\n', 1),
|
|
657
|
+
('known-negative(상한 이내)', f'### A\n🗣\n> {short}\n', 0),
|
|
658
|
+
('control(낭독 마커 없음)', f'### A\n> {long_}\n', 0),
|
|
659
|
+
]
|
|
660
|
+
ok = True
|
|
661
|
+
for name, body, want in cases:
|
|
662
|
+
f, _ = lane_pacing(cfg, '.', {'s': (body, 'markdown')}, meta)
|
|
663
|
+
got = len([x for x in f if x[1] == 'PACING-OVER-HARD'])
|
|
664
|
+
hit = got == want
|
|
665
|
+
ok &= hit
|
|
666
|
+
print(f' L6 {name}: got {got} want {want} {"PASS" if hit else "FAIL"}')
|
|
667
|
+
print('L6 SELFTEST:', 'PASS' if ok else 'FAIL — 이 레인의 출력을 쓰지 마라')
|
|
668
|
+
return 0 if ok else 1
|
|
669
|
+
|
|
670
|
+
|
|
671
|
+
def selftest_jargon():
|
|
672
|
+
"""known-pair. 계기가 «풀이 있음»과 «없음»을 실제로 가르는지 — 안 가르면 이 레인은 장식이다."""
|
|
673
|
+
import tempfile, textwrap
|
|
674
|
+
ok = True
|
|
675
|
+
spec = {'gloss_window': 2, 'terms': [
|
|
676
|
+
{'id': 'T', 'literals': ['탈상관'], 'plain': 'p', 'gloss': ['만든 회사'], 'why': 'w'}]}
|
|
677
|
+
cases = [('known-negative(풀이 있음)', '🗣\n> 셋째, 탈상관입니다.\n> 만든 회사를 섞습니다.\n', 0),
|
|
678
|
+
('known-positive(풀이 없음)', '🗣\n> 셋째, 탈상관입니다.\n> 그래서 섞습니다.\n', 1),
|
|
679
|
+
('control(어휘 부재)', '🗣\n> 아무 상관 없는 문장입니다.\n', 0)]
|
|
680
|
+
with tempfile.TemporaryDirectory() as d:
|
|
681
|
+
sp = os.path.join(d, 'j.yaml')
|
|
682
|
+
with open(sp, 'w', encoding='utf-8') as f: yaml.safe_dump(spec, f, allow_unicode=True)
|
|
683
|
+
for label, body, expect in cases:
|
|
684
|
+
f, _ = lane_jargon({'jargon_terms': sp}, d, {'s': (body, 'markdown')},
|
|
685
|
+
{'s': {'marker': '🗣', 'spoken': True}})
|
|
686
|
+
got = len([x for x in f if x[1] == 'JARGON-UNGLOSSED'])
|
|
687
|
+
good = got == expect
|
|
688
|
+
ok &= good
|
|
689
|
+
print(f" {'PASS' if good else 'FAIL'} {label}: expect={expect} got={got}")
|
|
690
|
+
print('L5 SELFTEST:', 'PASS — 계기가 짝을 가른다' if ok else 'FAIL — 판별력 없음')
|
|
691
|
+
return 0 if ok else 2
|
|
692
|
+
|
|
693
|
+
|
|
694
|
+
def main():
|
|
695
|
+
if '--self-test' in sys.argv: return selftest_jargon() or selftest_pacing()
|
|
696
|
+
# 🟥 2026-09-01 — «자기 판»을 config 로드 «전»에 찍는다. 오늘 실사고: 갈라진 옛 포크
|
|
697
|
+
# (동반 저장소의 preprep, 724줄)를 돌려놓고 「설치본에 레인이 없다」고 보고했다 — 레인은
|
|
698
|
+
# 정본(776줄)에 있었고 귀속이 틀렸다. 🟥 첫 판은 이 줄을 `cfg` 로드 «뒤»에 뒀는데,
|
|
699
|
+
# config 가 없으면 안 찍힌다 — 「내가 어느 판인가」가 «가장 필요한 순간»에 침묵한다.
|
|
700
|
+
# ⚠️ 내장 `lane_*` 함수만으로는 판별이 «안 된다»(정본·포크 둘 다 7). 갈리는 것은
|
|
701
|
+
# 별도 모듈 레인(L9/L10/L11)이라 둘 다 센다.
|
|
702
|
+
# [[feedback_rule_misdescribes_its_own_machine]] · [[feedback_instrument_vs_target_and_budget]]
|
|
703
|
+
_lanes = sorted(n[5:] for n in globals() if n.startswith('lane_') and callable(globals()[n]))
|
|
704
|
+
_mods = sorted(m for m in ('lane_promise', 'lane_adjacent_dup', 'lane_progression')
|
|
705
|
+
if os.path.exists(os.path.join(HERE, m + '.py')))
|
|
706
|
+
print(f"── 발표 준비 하네스 v0.1 ──")
|
|
707
|
+
print(f" 판: {os.path.realpath(__file__)}")
|
|
708
|
+
print(f" 레인 {len(_lanes)}(내장): {' · '.join(_lanes)}")
|
|
709
|
+
print(f" 레인 {len(_mods)}(모듈): {' · '.join(m[5:] for m in _mods) if _mods else '🟥 없음 — 갈라진 사본일 수 있다'}")
|
|
710
|
+
cfg_path = sys.argv[1] if len(sys.argv) > 1 and not sys.argv[1].startswith('--') \
|
|
711
|
+
else os.path.join(HERE, 'surfaces.yaml')
|
|
712
|
+
cfg = load(cfg_path)
|
|
713
|
+
root = os.path.expanduser(cfg['root'])
|
|
714
|
+
surf = {s['id']: s for s in cfg['surfaces']}
|
|
715
|
+
|
|
716
|
+
|
|
717
|
+
# L3 inventory — 먼저 돈다. 무엇을 못 읽었는지가 뒤 레인의 계상 범위를 정한다
|
|
718
|
+
texts, missing, unreadable = {}, [], []
|
|
719
|
+
for s in cfg['surfaces']:
|
|
720
|
+
p = resolve(root, s['path'])
|
|
721
|
+
if not os.path.exists(p): missing.append(s['id']); continue
|
|
722
|
+
try: texts[s['id']] = (read_text(p, s['kind']), s['kind'])
|
|
723
|
+
except Exception as e: unreadable.append((s['id'], str(e)))
|
|
724
|
+
print(f"L3 inventory : 읽음 {len(texts)} · 부재 {len(missing)} · 기계로 못 읽음 {len(unreadable)}")
|
|
725
|
+
for m in missing: print(f" {ANSI_BAD} 선언됐는데 디스크에 없다: {m} (UNMEASURED, 0 아님)")
|
|
726
|
+
for i, why in unreadable: print(f" {ANSI_UNK} 기계 어댑터 없음: {i} — {why} (UNMEASURED)")
|
|
727
|
+
|
|
728
|
+
findings, notes = [], []
|
|
729
|
+
surf_meta = {s['id']: {'marker': s.get('speech_marker'), 'spoken': s.get('spoken', False)}
|
|
730
|
+
for s in cfg['surfaces']}
|
|
731
|
+
f1, n1 = lane_canon(cfg, root, texts, surf_meta); findings += f1; notes += n1
|
|
732
|
+
try:
|
|
733
|
+
import lane_promise
|
|
734
|
+
import importlib.util as _iu2
|
|
735
|
+
_sp2 = _iu2.spec_from_file_location('interslide_deps', os.path.join(HERE, 'interslide_deps.py'))
|
|
736
|
+
_im2 = _iu2.module_from_spec(_sp2); _sp2.loader.exec_module(_im2)
|
|
737
|
+
_f11, _n11 = lane_promise.scan(texts, surf_meta, mod=_im2)
|
|
738
|
+
notes += _n11 # advisory 고정 — findings 에 안 태운다
|
|
739
|
+
except Exception as _e:
|
|
740
|
+
notes.append('L11 promise : 계기 미실행 — NOT_WIRED (%s: %s) (0 아님)' % (type(_e).__name__, _e))
|
|
741
|
+
try:
|
|
742
|
+
import lane_adjacent_dup, importlib.util as _ilu
|
|
743
|
+
_mp = os.path.join(HERE, 'interslide_deps.py')
|
|
744
|
+
_sp = _ilu.spec_from_file_location('interslide_deps', _mp)
|
|
745
|
+
_im = _ilu.module_from_spec(_sp); _sp.loader.exec_module(_im)
|
|
746
|
+
_f10, _n10 = lane_adjacent_dup.scan(cfg, texts, surf_meta, _im)
|
|
747
|
+
findings += _f10; notes += _n10
|
|
748
|
+
except Exception as _e:
|
|
749
|
+
notes.append('L10 adjacent-dup : 계기 미실행 — NOT_WIRED (%s: %s) (0 아님)' % (type(_e).__name__, _e))
|
|
750
|
+
try:
|
|
751
|
+
import lane_progression
|
|
752
|
+
_f9, _n9 = lane_progression.scan(cfg, texts, surf_meta)
|
|
753
|
+
findings += _f9; notes += _n9 # 차단 — 선언된 것만 보므로 오탐이 선언에 갇혀 있다
|
|
754
|
+
except Exception as _e:
|
|
755
|
+
# 계기 부재/오류를 «통과»로 렌더하지 않는다. 부재 != 0.
|
|
756
|
+
notes.append('L9 progression : 계기 미실행 — NOT_WIRED (%s: %s) (0 아님)' % (type(_e).__name__, _e))
|
|
757
|
+
|
|
758
|
+
f2, n2 = lane_unitref(cfg, root, surf); findings += f2; notes += n2
|
|
759
|
+
f4, n4 = lane_getput(cfg, root, surf); findings += f4; notes += n4
|
|
760
|
+
f5, n5 = lane_jargon(cfg, root, texts, surf_meta); findings += f5; notes += n5
|
|
761
|
+
# L6 은 built_deck 표면을 장 단위로 읽고 싶어 하므로 id→선언 맵을 넘겨준다
|
|
762
|
+
cfg['surfaces_by_id'] = {x['id']: x for x in cfg.get('surfaces', [])}
|
|
763
|
+
f6, n6 = lane_pacing(cfg, root, texts, surf_meta); findings += f6; notes += n6
|
|
764
|
+
f7, n7 = lane_regen(cfg, root); findings += f7; notes += n7
|
|
765
|
+
f8, n8 = lane_interslide(cfg, root); findings += f8; notes += n8
|
|
766
|
+
|
|
767
|
+
for n in notes: print(f" · {n}")
|
|
768
|
+
use = [f for f in findings if f[1] != 'mention']
|
|
769
|
+
men = [f for f in findings if f[1] == 'mention']
|
|
770
|
+
print(f"\n판정 대상(USE) {len(use)}건 · 참고(MENTION — «쓰지 마라»고 적은 줄) {len(men)}건")
|
|
771
|
+
print("🟥 둘을 합치지 않는다. MENTION 은 0 이 아니라 **다른 것**이다.")
|
|
772
|
+
for sid, kind, ref, lit, why in use:
|
|
773
|
+
print(f" {ANSI_BAD} [{kind}] {sid} ← {ref}: «{lit}»\n {why}")
|
|
774
|
+
if men:
|
|
775
|
+
print(f"\n ({ANSI_UNK} MENTION {len(men)}건 — 표면별: "
|
|
776
|
+
+ ', '.join(f'{s}×{sum(1 for m in men if m[0].split(":")[0]==s)}'
|
|
777
|
+
for s in sorted({m[0].split(':')[0] for m in men})) + ")")
|
|
778
|
+
findings = use
|
|
779
|
+
|
|
780
|
+
print(f"\n{ANSI_UNK} 계기 한계(명시): pptx 는 XML 텍스트 레이어만 본다 — "
|
|
781
|
+
f"이미지에 구워진 텍스트는 구조적으로 안 보인다. Keynote 는 사람만 읽는다.")
|
|
782
|
+
if unreadable or missing: return 2 if not findings else 1
|
|
783
|
+
return 1 if findings else 0
|
|
784
|
+
|
|
785
|
+
# 🟥 `__main__` 가드 — 이게 없으면 **import 가 곧 실행**이라 아무도 이 파일을 라이브러리로
|
|
786
|
+
# 못 쓴다(레인 하나만 부르려 해도 전체가 돌고 종료한다). 배포본이 된 뒤에 드러난 결함이다:
|
|
787
|
+
# 스킬 문서가 «레인을 골라 부를 수 있다»는 인상을 주는데 실제로는 CLI 한 형태뿐이었다.
|
|
788
|
+
if __name__ == '__main__':
|
|
789
|
+
sys.exit(main())
|