@chrono-meta/fh-gate 3.7.0 → 3.9.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/regression/probes_live.yaml +108 -6
- package/.claude-plugin/marketplace.json +4 -4
- package/CLAUDE.md +1 -1
- package/knowledge/shared/harness-core/governance_engineering_definition.md +7 -3
- package/knowledge/shared/harness-core/self_evolution_routine.md +14 -0
- package/knowledge/shared/harness-core/sonnet_floor_doctrine.md +75 -0
- package/knowledge/shared/learnings/subagent_invocations_log.yaml +71 -0
- package/package.json +5 -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 +97 -0
- package/plugins/fh-meta/skills/asset-placement-gate/SKILL.md +30 -0
- package/plugins/fh-preprep/.claude-plugin/plugin.json +1 -1
- package/plugins/fh-preprep/skills/preprep/SKILL.md +7 -1
- package/plugins/fh-preprep/skills/preprep/fixtures/font_revert_probe.py +6 -4
- package/plugins/fh-preprep/skills/preprep/lane_attr_consistency.py +77 -6
- package/plugins/fh-preprep/skills/preprep/lane_font.py +105 -16
- package/plugins/fh-preprep/skills/preprep/lane_screen_parity.py +14 -1
- package/plugins/fh-preprep/skills/preprep/test_lane_font.py +170 -21
- package/plugins/fh-preprep/skills/preprep/test_preprep_lanes_rp.py +73 -3
- package/plugins/fh-qp/.claude-plugin/plugin.json +1 -1
- package/scripts/adapters/peer_resolve.sh +4 -0
- package/scripts/cluster_capability_scan.sh +21 -2
- package/scripts/com.forge-harness.live-eval.plist +5 -2
- package/scripts/fh-run.sh +19 -2
- package/scripts/fh_track_resolve.sh +22 -0
- package/scripts/probe_live_eval.sh +117 -3
- package/scripts/probe_live_eval_lib.py +178 -5
- package/scripts/remote_marker_gate.sh +186 -0
- package/scripts/selfcheck.sh +25 -0
- package/scripts/test_adapter_lanes.sh +46 -1
- package/scripts/test_fh_run_resolver_lanes.sh +20 -3
- package/scripts/test_probe_live_eval_lanes.sh +271 -10
- package/scripts/test_remote_marker_gate_lanes.sh +190 -0
- package/scripts/test_temper_check_lanes.sh +307 -0
- package/scripts/test_track_resolve_lanes.sh +51 -7
|
@@ -200,10 +200,16 @@ python3 "$SKILL/preprep.py"
|
|
|
200
200
|
같은 85건이 있다**(해시 동일, 2026-09-11 실측). 저자는 그 글자를 찍은 적이 없다. 진짜 이탈은 3런
|
|
201
201
|
하나뿐이었고(코드 데모의 고정폭 서체) 그건 «의도»였다. ⇒ 판별자는 **영역 + 템플릿 해시 대조**이지
|
|
202
202
|
서체 이름이 아니다. 뒤집으면, 템플릿에서 **갈라진** 마스터·레이아웃은 반대로 **저자 책임**이라 그
|
|
203
|
-
사실을 따로 보고한다. 코드: `lane_font.py` · self-test: `test_lane_font.py`(
|
|
203
|
+
사실을 따로 보고한다. 코드: `lane_font.py` · self-test: `test_lane_font.py`(**42항** — 5라운드에서 30→42) · 레인 래퍼 `scripts/test_preprep_font_lanes.sh`
|
|
204
204
|
(되돌림 프로브 `fixtures/font_revert_probe.py`). known-negative 가 «서체 하나뿐인 덱»이 아니라
|
|
205
205
|
**«마스터에 이질 서체가 있지만 템플릿과 동일한 덱»** 인 것이 핵심이다 — 그게 실제로 틀렸던 자리다.
|
|
206
206
|
|
|
207
|
+
🟥 **이 레인이 «안 읽는» 자리는 0 이 아니라 UNMEASURED 로 나간다** (5라운드 신설). 차트
|
|
208
|
+
(`ppt/charts/`)·SmartArt(`ppt/diagrams/`) 안의 글자는 화면에 렌더되지만 `slides/` 밖이라 스캔
|
|
209
|
+
범위가 아니고, DrawingML 을 `a` 가 아닌 접두사로 묶은 장도 이 정규식 스캐너가 못 읽는다. 둘 다
|
|
210
|
+
**그런 자리가 있으면 세어서 노트로 낸다** — 「안 읽었다」를 「이탈 없다」로 렌더하지 않는 것이
|
|
211
|
+
이 레인 전체의 규율이다([[feedback_not_found_is_not_zero_family]]).
|
|
212
|
+
|
|
207
213
|
🟥 **cross-family 2라운드가 판정을 한 번 뒤집었고, 그 되돌림 자체가 계약이다.** 1라운드는
|
|
208
214
|
«템플릿 자신의 마스터/레이아웃이 쓰는 서체는 오탐이니 노트로 강등하라»고 했고 그렇게 고쳤다.
|
|
209
215
|
2라운드가 그것을 **fail-open 으로 지목했다** — 배포 템플릿의 레이아웃은 쓰이지도 않는 자리에
|
|
@@ -41,15 +41,17 @@ import test_lane_font as T # noqa: E402
|
|
|
41
41
|
|
|
42
42
|
def _widen(z):
|
|
43
43
|
"""뮤턴트: 상속 영역까지 판정 대상에 넣는다 = 영역 분리를 죽인다."""
|
|
44
|
-
rows, n
|
|
44
|
+
# 🟥 반환 모양은 slide_runs 의 계약이다 — 2026-09-14(5라운드)에 `(rows, n)` 에서
|
|
45
|
+
# `(rows, n, foreign_ns)` 로 늘었고, 이 프로브가 **옳게 빨개졌다**(BASE 0 MUT 0 —
|
|
46
|
+
# 뮤턴트가 2-튜플을 돌려줘 scan() 이 «계기 오류» 로 떨어졌다). 지우지 말고 교체한다.
|
|
47
|
+
rows, n, foreign = _widen.orig(z)
|
|
45
48
|
for name in z.namelist():
|
|
46
49
|
if re.match(r'ppt/(slideMasters|slideLayouts)/[^/]+\.xml$', name):
|
|
47
50
|
for tf in L._typefaces(z, name):
|
|
48
51
|
if tf and not L.THEME_REF.match(tf):
|
|
49
|
-
# 🟥
|
|
50
|
-
# 계약이 바뀌면 이 프로브가 빨개진다. 빨개지는 것이 옳다.
|
|
52
|
+
# 🟥 행 모양도 계약이다 — (장, 서체, 슬롯, 텍스트, 출처).
|
|
51
53
|
rows.append((0, tf, 'latin', '(상속)', 'inherited'))
|
|
52
|
-
return rows, n
|
|
54
|
+
return rows, n, foreign
|
|
53
55
|
|
|
54
56
|
|
|
55
57
|
def separation(d):
|
|
@@ -136,7 +136,8 @@ def load(path):
|
|
|
136
136
|
# ── 면제 채널 (P1 과 같은 규율: 선언되었나만 본다 · 사유 필수 · 조용히 안 삼킨다) ──────
|
|
137
137
|
|
|
138
138
|
def _intent_index(intended):
|
|
139
|
-
idx, errs =
|
|
139
|
+
"""(idx, errs, by_n). `by_n[n] = (axis, shapes_tuple, declared_slides)` — 죽은 선언의 근사 진단용."""
|
|
140
|
+
idx, errs, by_n = collections.defaultdict(list), [], {}
|
|
140
141
|
for n, e in enumerate(intended or [], 1):
|
|
141
142
|
if not isinstance(e, dict):
|
|
142
143
|
errs.append(f'attr_consistency.intended[{n}] : 매핑이 아니다 — 면제 안 함')
|
|
@@ -163,7 +164,10 @@ def _intent_index(intended):
|
|
|
163
164
|
continue
|
|
164
165
|
for s in sl:
|
|
165
166
|
idx[(ax, int(s))].append((tuple(sorted(e.get('shapes') or [])), why, n))
|
|
166
|
-
|
|
167
|
+
# 🟥 선언별 원장 — «죽은 선언» 을 보고할 때 «왜» 죽었는지 말하려면 선언 자신을 다시 봐야 한다.
|
|
168
|
+
# idx 는 (축,장) 으로 흩어 놓은 형태라 선언 하나를 되짚을 수 없다.
|
|
169
|
+
by_n[n] = (ax, tuple(sorted(e.get('shapes') or [])), sorted(int(v) for v in sl))
|
|
170
|
+
return idx, errs, by_n
|
|
167
171
|
|
|
168
172
|
|
|
169
173
|
AMBIG = '\u2205' # «같은 장 안에 같은 이름 둘» — 선언으로 못 가르는 표식(R5 A6). 어떤 선언과도 안 맞는다.
|
|
@@ -178,6 +182,39 @@ def _mark_ambig(shapes_):
|
|
|
178
182
|
return names
|
|
179
183
|
|
|
180
184
|
|
|
185
|
+
def _dead_intent_msg(n, intent_by_n, seen_groups):
|
|
186
|
+
"""죽은 선언 한 줄 — **왜** 죽었는지까지 말한다.
|
|
187
|
+
|
|
188
|
+
🟥 이 함수가 있는 이유(2026-09-13 실측). 이 덱에서 죽은 선언이 **12개** 나왔는데, 원인은
|
|
189
|
+
전부 하나였다: `shapes` 는 정확히 맞는데 `slides` 에 그룹의 **한 장만** 적혀 있었다.
|
|
190
|
+
echo 후보는 여러 장에 걸치고, 매칭은 «그 장 전부가 같은 선언에 걸려야» 면제한다(R3 B14 —
|
|
191
|
+
부분 선언이 완전 선언을 가리지 않게 한 그 규칙). 그 규칙이 들어올 때 기존 설정이 안 따라왔다.
|
|
192
|
+
|
|
193
|
+
종전 메시지는 「지우거나 고쳐라」뿐이라, 사람이 12줄을 받아들고 **무엇이 어긋났는지를
|
|
194
|
+
직접 재현해야** 했다. 어긋남을 아는 쪽은 기계다. 그래서 여기서 말한다.
|
|
195
|
+
|
|
196
|
+
⚠️ 근사 진단이지 판정이 아니다 — 이름집합이 같은 후보 그룹을 찾아 장 차집합을 보일 뿐이고,
|
|
197
|
+
「그러니 그 장들을 적어라」는 사람이 정한다(그 후보가 정말 같은 의도인지는 의미 판단이다).
|
|
198
|
+
"""
|
|
199
|
+
base = f'attr_consistency.intended[{n}] : 🟥 죽은 선언 — 이 덱에서 아무 후보도 면제하지 않는다. 지우거나 고쳐라'
|
|
200
|
+
rec = intent_by_n.get(n)
|
|
201
|
+
if not rec:
|
|
202
|
+
return base
|
|
203
|
+
ax, want, declared = rec
|
|
204
|
+
if not want:
|
|
205
|
+
# shapes 를 안 적은 선언 = 그 장의 그 축 전체. 그 축 후보가 그 장에 아예 없다는 뜻이다.
|
|
206
|
+
return base + f' (축 {ax} · 선언 장 {declared} — 그 장에 이 축 후보가 없다)'
|
|
207
|
+
got = seen_groups.get((ax, want))
|
|
208
|
+
if got is None:
|
|
209
|
+
return base + f' (축 {ax} · 도형 {list(want)} — 이 이름 조합의 후보 자체가 없다. 도형 이름이 바뀌었나)'
|
|
210
|
+
missing = [s_ for s_ in got if s_ not in declared]
|
|
211
|
+
if missing:
|
|
212
|
+
return (base + f' ← 근사: 도형 {list(want)} 는 맞는데 **장이 모자란다** — '
|
|
213
|
+
f'선언 {declared} · 실제 후보 그룹 {got} (빠진 장 {missing}). '
|
|
214
|
+
'면제는 «그룹의 모든 장» 이 같은 선언에 걸려야 성립한다')
|
|
215
|
+
return base + f' (축 {ax} · 도형 {list(want)} · 장 {declared} — 후보 그룹 {got} 와 장은 맞는데 안 걸렸다)'
|
|
216
|
+
|
|
217
|
+
|
|
181
218
|
def _why_all(idx, axis, slide, names):
|
|
182
219
|
"""이 장·축·도형 집합에 걸리는 «모든» 선언 [(why, n) …]. R3 B14: 첫 선언만 고르면 순서 의존이 된다.
|
|
183
220
|
R5 A6: 같은 이름이 둘이면 «어느 것» 인지 선언으로 못 가른다 — 면제 불가(집합화가 셋째 도형을 지웠다)."""
|
|
@@ -210,15 +247,43 @@ def ax_dash(S, sw, cfg):
|
|
|
210
247
|
f"{sn:>3}p [dash] «{d}» 굵기가 갈린다 — {detail}"
|
|
211
248
|
|
|
212
249
|
|
|
250
|
+
def _algn_key(a):
|
|
251
|
+
"""도형의 «정렬» 비교 키 — 균일하면 그 값 하나, 섞였으면 문단 패턴 그대로.
|
|
252
|
+
|
|
253
|
+
문단 수가 정렬 차이로 둔갑하지 않게 하면서(실물 47·48p), 순서 차이는 그대로 남긴다(A11).
|
|
254
|
+
"""
|
|
255
|
+
al = tuple(a['algn'])
|
|
256
|
+
uniq = set(al)
|
|
257
|
+
return next(iter(uniq)) if len(uniq) == 1 else al
|
|
258
|
+
|
|
259
|
+
|
|
213
260
|
def ax_algn(S, sw, cfg):
|
|
214
|
-
"""같은 장에서 «같은 폭 · 같은 y»(= 한 줄)인데 정렬 방식이 갈리는가.
|
|
261
|
+
"""같은 장에서 «같은 폭 · 같은 y»(= 한 줄)인데 정렬 방식이 갈리는가.
|
|
262
|
+
|
|
263
|
+
🟥 비교 키는 «시퀀스 그대로» 가 아니다 (2026-09-13 실측 수리). 종전에는 문단별 정렬을
|
|
264
|
+
튜플 그대로 비교해서 `('ctr','ctr')` 과 `('ctr',)` 이 «갈린다» 로 보고됐다 — **문단 수가
|
|
265
|
+
다를 뿐 전부 가운데 정렬인데도.** 실물 덱 47·48p 가 정확히 그 형태였고(도형 다섯 전부
|
|
266
|
+
`ctr`, `rv-b1` 만 문단이 둘), 그 둘이 이 덱의 마지막 P4 후보였다. 축이 자기 docstring 의
|
|
267
|
+
질문(«정렬 방식이 갈리는가»)이 아니라 다른 질문(«시퀀스가 갈리는가»)을 답하고 있었다.
|
|
268
|
+
|
|
269
|
+
🟥 그런데 **집합으로 바꾸면 반대쪽이 깨진다.** 기존 레인 A11 이 `('ctr', 기본)` 과
|
|
270
|
+
`(기본, 'ctr')` 을 «갈린다» 로 못 박고 있고 그건 옳다 — 문단 수가 같고 **순서가 다르면**
|
|
271
|
+
첫 문단이 한쪽은 가운데, 다른 쪽은 기본이다. 실제로 갈린 것이다.
|
|
272
|
+
(초판이 집합으로 바꿨다가 A11 이 빨개져서 잡혔다. 기존 레인이 내 과교정을 막았다.)
|
|
273
|
+
|
|
274
|
+
⇒ 판별자는 **«균일하면 그 값 하나, 섞였으면 패턴 그대로»** 다:
|
|
275
|
+
('ctr','ctr') → 'ctr' ('ctr',) → 'ctr' → 같다 (실물 47·48p)
|
|
276
|
+
('ctr', 기본) → 그 튜플 (기본,'ctr') → 그 튜플 → 다르다 (A11)
|
|
277
|
+
한 도형이 한 가지 정렬만 쓰면 그 도형의 정렬은 문단 수와 무관하게 그 값이고, 섞어 쓰면
|
|
278
|
+
그 패턴 자체가 그 도형의 정렬이다.
|
|
279
|
+
"""
|
|
215
280
|
for sn, sh in enumerate(S, 1):
|
|
216
281
|
rows = collections.defaultdict(list)
|
|
217
282
|
for a in sh:
|
|
218
283
|
if a['text']: # 글자 있는 도형만이 «정렬»을 가진다 — 크기가 상속이어도 정렬은 있다
|
|
219
284
|
rows[(round(a['w'], 2), round(a['y'], 1))].append(a)
|
|
220
285
|
for (w, y), v in rows.items():
|
|
221
|
-
if len(v) > 1 and len({a
|
|
286
|
+
if len(v) > 1 and len({_algn_key(a) for a in v}) > 1:
|
|
222
287
|
detail = ' · '.join(f"{a['name'][:12]}={'/'.join(a['algn'])}" for a in v)
|
|
223
288
|
yield sn, _mark_ambig(v), \
|
|
224
289
|
f"{sn:>3}p [algn] 폭 {w}\" y {y}\" 한 줄인데 정렬이 갈린다 — {detail}"
|
|
@@ -291,7 +356,7 @@ AXIS_FN = {'dash': ax_dash, 'algn': ax_algn, 'mirror': ax_mirror, 'echo': ax_ech
|
|
|
291
356
|
def collect(path, cfg):
|
|
292
357
|
"""(lines, suppressed, errors, stats)"""
|
|
293
358
|
S, sw = load(path)
|
|
294
|
-
idx, errors = _intent_index(cfg.get('intended'))
|
|
359
|
+
idx, errors, intent_by_n = _intent_index(cfg.get('intended'))
|
|
295
360
|
want = [a for a in (cfg.get('axes') or AXES) if a in AXIS_FN]
|
|
296
361
|
unknown = [a for a in (cfg.get('axes') or []) if a not in AXIS_FN]
|
|
297
362
|
errors += [f'attr_consistency.axes : 모르는 축 «{a}» — 무시 (있는 축: {AXES})' for a in unknown]
|
|
@@ -301,9 +366,15 @@ def collect(path, cfg):
|
|
|
301
366
|
stats['shapes'] = sum(len(sh) for sh in S)
|
|
302
367
|
stats['sized'] = sum(1 for sh in S for a in sh if a['szs'])
|
|
303
368
|
hits = collections.Counter()
|
|
369
|
+
# 🟥 (축, 이름집합) → 그 후보 그룹이 실제로 걸친 장 목록. «죽은 선언» 의 근사 진단에 쓴다.
|
|
370
|
+
# 정확 키(면제)가 이미 있어도 이걸 같이 모은다 — 근사 스캔을 «정확 키가 없을 때만» 돌리면
|
|
371
|
+
# 「왜 안 걸렸나」를 물어야 하는 바로 그 순간에 자료가 없다.
|
|
372
|
+
seen_groups = {}
|
|
304
373
|
for ax in want:
|
|
305
374
|
for slide, names, line in AXIS_FN[ax](S, sw, cfg):
|
|
306
375
|
slides_all = list(slide) if isinstance(slide, tuple) else [slide]
|
|
376
|
+
_key = (ax, tuple(sorted(set(n_ for n_ in names if n_ != AMBIG))))
|
|
377
|
+
seen_groups.setdefault(_key, sorted(set(int(x) for x in slides_all)))
|
|
307
378
|
# 그룹이 여러 장에 걸치면(echo) 전부 «같은 선언 n» 에 걸려야 면제 — R3 B14: 장마다 첫 선언을 고르지 말고
|
|
308
379
|
# 장 전체에 공통인 n 을 찾는다(부분 선언이 완전 선언을 가리지 않게)
|
|
309
380
|
per = [dict((n_, w_) for w_, n_ in _why_all(idx, ax, sl_, names)) for sl_ in slides_all]
|
|
@@ -321,7 +392,7 @@ def collect(path, cfg):
|
|
|
321
392
|
# 🟥 죽은 선언 보고 — 아무 후보도 안 거는 intended 항목(덱 세션 실측 09-11: 유령 후보에 붙은 why)
|
|
322
393
|
for n in sorted({n for v in idx.values() for _w, _y, n in v}):
|
|
323
394
|
if hits.get(n, 0) == 0:
|
|
324
|
-
errors.append(
|
|
395
|
+
errors.append(_dead_intent_msg(n, intent_by_n, seen_groups))
|
|
325
396
|
stats['dead_intended'] += 1
|
|
326
397
|
return lines, suppressed, errors, dict(stats)
|
|
327
398
|
|
|
@@ -39,6 +39,11 @@ Mono, 그리고 그건 «의도»였다). ⇒ 판별자는 **영역 + 템플릿
|
|
|
39
39
|
🟥 **이 레인이 구조적으로 못 보는 것**: ⓐ 이미지에 구워진 글자 ⓑ 폰트가 설치돼 있는지
|
|
40
40
|
(파일은 이름만 적는다 — 없는 서체는 렌더러가 조용히 대체한다) ⓒ 같은 가족의 굵기 변형이
|
|
41
41
|
실제로 존재하는지. 셋 다 **파일 밖**의 사실이라 여기서 0 으로 세지 않는다.
|
|
42
|
+
ⓓ **차트(`ppt/charts/`)·SmartArt(`ppt/diagrams/`) 안의 글자** — 화면에 렌더되지만 별도
|
|
43
|
+
부품이라 `slides/` 스캔이 안 닿는다(cross-family R5/codex 지목, 실측 재현). 셋과 달리
|
|
44
|
+
이건 **파일 «안»**의 사실이라 언젠가 읽을 수 있다 ⇒ 0 으로 세지 않고 **그런 부품이
|
|
45
|
+
있으면 «UNMEASURED» 노트로 세어 낸다**(`_unscanned_text_parts`). 「안 읽었다」를
|
|
46
|
+
「이탈 없다」로 렌더하지 않는 것이 이 레인 전체의 규율이다.
|
|
42
47
|
"""
|
|
43
48
|
import os
|
|
44
49
|
import re
|
|
@@ -66,7 +71,22 @@ _FONT_TAG = re.compile(r'<a:(latin|ea|cs|sym)\b([^>]*?)/?>')
|
|
|
66
71
|
# `r:id="rId2"` 를 `id="rId2"` 로 잘못 읽고 **엉뚱한 값을 `id` 키에 넣는다** — 3라운드에서
|
|
67
72
|
# 속성 순서를 고치며 내가 심은 결함이고, 4라운드가 잡았다(실측: 실물 덱이 그 형태라
|
|
68
73
|
# 장 순서가 계속 파일명 순 폴백으로 돌고 있었다).
|
|
69
|
-
|
|
74
|
+
# 🟥 XML 은 **작은따옴표 속성**도 허용한다. 큰따옴표만 읽으면 `typeface='X'` 를 통째로
|
|
75
|
+
# 놓치고 — 그런데 **다른 토큰이 하나라도 읽히면 UNMEASURED 도 안 나간다**(아래 참조).
|
|
76
|
+
# 즉 «부분 추출 실패»가 자신 있는 0 으로 렌더된다(cross-family R5/codex 지목).
|
|
77
|
+
_ATTR_RAW = re.compile(r'([\w:.-]+)=(?:"([^"]*)"|\'([^\']*)\')')
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
class _Attr:
|
|
81
|
+
"""`findall` 이 (이름, 값) 쌍을 내도록 감싼다 — 호출부(`dict(_ATTR.findall(...))`)를
|
|
82
|
+
안 바꾸려고. 큰따옴표 값이 비어 있으면 작은따옴표 조에서 온 값을 쓴다(둘 중 하나만 찬다)."""
|
|
83
|
+
|
|
84
|
+
@staticmethod
|
|
85
|
+
def findall(x):
|
|
86
|
+
return [(k, dq if dq else sq) for k, dq, sq in _ATTR_RAW.findall(x)]
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
_ATTR = _Attr()
|
|
70
90
|
|
|
71
91
|
|
|
72
92
|
def font_refs(xml):
|
|
@@ -85,6 +105,18 @@ def font_names(xml):
|
|
|
85
105
|
return [t for _, t in font_refs(xml)]
|
|
86
106
|
|
|
87
107
|
|
|
108
|
+
# 🟥 **주석은 어디서도 렌더되지 않는다** — 그런데 정규식 스캔에는 그대로 잡힌다.
|
|
109
|
+
# cross-family R5(codex) 지적: 템플릿 장표에 주석으로 남은 `<a:latin typeface="X"/>` 가
|
|
110
|
+
# 허용 집합으로 «승격»되어, 덱의 진짜 X 이탈이 조용히 통과한다(실측 재현).
|
|
111
|
+
# 읽는 모든 자리에서 먼저 죽인다 — 유도 쪽과 판정 쪽 **양쪽**에.
|
|
112
|
+
_XML_COMMENT = re.compile(r'<!--.*?-->', re.S)
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
def live_xml(x):
|
|
116
|
+
"""렌더 후보만 남긴 XML — 주석 제거. 유도·판정 어느 쪽에서도 같은 것을 본다."""
|
|
117
|
+
return _XML_COMMENT.sub('', x)
|
|
118
|
+
|
|
119
|
+
|
|
88
120
|
_PART = re.compile(r'ppt/(slides|slideLayouts|slideMasters|theme)/[^/]+\.xml$')
|
|
89
121
|
|
|
90
122
|
|
|
@@ -100,7 +132,7 @@ def _parts(z):
|
|
|
100
132
|
|
|
101
133
|
def _typefaces(z, name):
|
|
102
134
|
"""한 부품이 쓰는 서체 이름들 (등장 순서 유지, 중복 포함)."""
|
|
103
|
-
return font_names(z.read(name).decode('utf-8', 'replace'))
|
|
135
|
+
return font_names(live_xml(z.read(name).decode('utf-8', 'replace')))
|
|
104
136
|
|
|
105
137
|
|
|
106
138
|
def theme_fonts(z):
|
|
@@ -108,7 +140,7 @@ def theme_fonts(z):
|
|
|
108
140
|
got = set()
|
|
109
141
|
for n in z.namelist():
|
|
110
142
|
if re.match(r'ppt/theme/theme\d+\.xml$', n):
|
|
111
|
-
x = z.read(n).decode('utf-8', 'replace')
|
|
143
|
+
x = live_xml(z.read(n).decode('utf-8', 'replace'))
|
|
112
144
|
for tag in ('majorFont', 'minorFont'):
|
|
113
145
|
m = re.search(r'<a:%s>.*?</a:%s>' % (tag, tag), x, re.S)
|
|
114
146
|
if m:
|
|
@@ -135,6 +167,7 @@ def _occurrences(xml, where):
|
|
|
135
167
|
달라졌다»로 떴다(2026-09-11). 있지도 않은 글자의 서체는 이탈이 아니다.
|
|
136
168
|
"""
|
|
137
169
|
out = []
|
|
170
|
+
xml = live_xml(xml)
|
|
138
171
|
# ① 런과 필드 — 찍힌 글자가 있다
|
|
139
172
|
for tag in ('r', 'fld'):
|
|
140
173
|
for m in re.finditer(r'<a:%s[ >].*?</a:%s>' % (tag, tag), xml, re.S):
|
|
@@ -191,12 +224,13 @@ def slide_runs(z):
|
|
|
191
224
|
# 순서를 못 읽어도 «못 읽었다»로 끝내지 않는다 — 파일명 순으로라도 센다(번호는 근사).
|
|
192
225
|
order = sorted(int(re.search(r'slide(\d+)', n).group(1)) for n in z.namelist()
|
|
193
226
|
if re.match(r'ppt/slides/slide\d+\.xml$', n))
|
|
194
|
-
rows = []
|
|
227
|
+
rows, foreign = [], set()
|
|
195
228
|
for i, sn in enumerate(order, 1):
|
|
196
229
|
x = z.read('ppt/slides/slide%d.xml' % sn).decode('utf-8', 'replace')
|
|
230
|
+
foreign |= set(foreign_dml_prefixes(x))
|
|
197
231
|
for tf, slot, txt, src in _occurrences(x, 'slide'):
|
|
198
232
|
rows.append((i, tf, slot, txt, src))
|
|
199
|
-
return rows, len(order)
|
|
233
|
+
return rows, len(order), sorted(foreign)
|
|
200
234
|
|
|
201
235
|
|
|
202
236
|
def drifted_occurrences(z, drifted, zt=None):
|
|
@@ -221,12 +255,13 @@ def drifted_occurrences(z, drifted, zt=None):
|
|
|
221
255
|
try:
|
|
222
256
|
before = set(font_names(re.sub(
|
|
223
257
|
r'<a:endParaRPr\b[^>]*(?:/>|>.*?</a:endParaRPr>)', '',
|
|
224
|
-
zt.read(name).decode('utf-8', 'replace'), flags=re.S)))
|
|
258
|
+
live_xml(zt.read(name).decode('utf-8', 'replace')), flags=re.S)))
|
|
225
259
|
except Exception:
|
|
226
260
|
before = set() # 템플릿에 없던 부품(신설) — 전부가 새 것이다
|
|
227
261
|
# 🟥 렌더되지 않는 자리는 여기서도 안 센다 — `_occurrences` 만 엄격하고 여기는
|
|
228
262
|
# 파일 전체를 훑으면, 빈 문단의 `endParaRPr` 하나로 갈라짐 오탐이 난다(R3-5).
|
|
229
|
-
scanned = re.sub(r'<a:endParaRPr\b[^>]*(?:/>|>.*?</a:endParaRPr>)', '',
|
|
263
|
+
scanned = re.sub(r'<a:endParaRPr\b[^>]*(?:/>|>.*?</a:endParaRPr>)', '',
|
|
264
|
+
live_xml(x), flags=re.S)
|
|
230
265
|
for slot, tf in font_refs(scanned):
|
|
231
266
|
if not THEME_REF.match(tf) and tf not in before:
|
|
232
267
|
rows.append((area, name, tf, slot))
|
|
@@ -234,21 +269,27 @@ def drifted_occurrences(z, drifted, zt=None):
|
|
|
234
269
|
|
|
235
270
|
|
|
236
271
|
def _allow_from_template(zt):
|
|
237
|
-
"""템플릿의 slides/ 가 실제로
|
|
272
|
+
"""템플릿의 slides/ 가 실제로 **렌더하는** 서체 = 허용 집합. 「덱 자신의 분포가 기준」.
|
|
238
273
|
|
|
239
274
|
🟥 **마스터·레이아웃은 일부러 안 넣는다.** 넣으면 상속된 잠재 기본값(이 코퍼스의
|
|
240
275
|
Helvetica Neue)까지 «규정된 서체»가 되어 탐지력이 깎인다. 대신 `_template_own_fonts()`
|
|
241
276
|
가 그 집합을 따로 들고, 거기 있는 서체의 지적은 **finding 이 아니라 노트로 강등**한다
|
|
242
|
-
(cross-family agy 지적 A2 — 오탐이되, 허용으로 승격시킬 일은 아니다).
|
|
277
|
+
(cross-family agy 지적 A2 — 오탐이되, 허용으로 승격시킬 일은 아니다).
|
|
278
|
+
|
|
279
|
+
🟥 **유도는 판정과 «같은 함수»로 한다 — 이 비대칭이 두 번 뚫렸다.**
|
|
280
|
+
4라운드(R4-3)가 템플릿 `endParaRPr` 잔재의 승격을 잡았고 그 한 자리만 깁었는데,
|
|
281
|
+
5라운드(codex)가 **같은 뿌리의 다른 자리**를 냈다: 글자 없는 빈 런(`<a:r>` 에 `<a:t>`
|
|
282
|
+
가 비었거나 없음)의 서체도 승격된다 — 실측 재현, 컨트롤(빈 런 없는 템플릿)은 finding 1.
|
|
283
|
+
한 군데씩 깁는 대신 **`_occurrences()` 를 그대로 재사용**한다: 판정이 세지 않는 것은
|
|
284
|
+
유도도 못 센다. 한쪽만 관대한 정규화가 «한쪽에서만 통과하는 입력» 을 만드는 형태다
|
|
285
|
+
([[feedback_divergent_leniency_duplicate_normalizers]] ·
|
|
286
|
+
[[feedback_half_fix_propagation_boundary]])."""
|
|
243
287
|
got = set()
|
|
244
288
|
for n in zt.namelist():
|
|
245
289
|
if re.match(r'ppt/slides/slide\d+\.xml$', n):
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
x = re.sub(r'<a:endParaRPr\b[^>]*(?:/>|>.*?</a:endParaRPr>)', '',
|
|
250
|
-
zt.read(n).decode('utf-8', 'replace'), flags=re.S)
|
|
251
|
-
got |= {t for t in font_names(x) if t and not THEME_REF.match(t)}
|
|
290
|
+
x = zt.read(n).decode('utf-8', 'replace')
|
|
291
|
+
got |= {tf for tf, _slot, _t, _src in _occurrences(x, 'slide')
|
|
292
|
+
if tf and not THEME_REF.match(tf)}
|
|
252
293
|
return got | theme_fonts(zt)
|
|
253
294
|
|
|
254
295
|
|
|
@@ -261,6 +302,44 @@ def _template_own_fonts(zt):
|
|
|
261
302
|
return got
|
|
262
303
|
|
|
263
304
|
|
|
305
|
+
_DML_NS = 'http://schemas.openxmlformats.org/drawingml/2006/main'
|
|
306
|
+
_NS_DECL = re.compile(r'xmlns:([\w.-]+)="' + re.escape(_DML_NS) + r'"')
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
def foreign_dml_prefixes(xml):
|
|
310
|
+
"""DrawingML 네임스페이스를 `a` 가 아닌 접두사로 묶은 자리 — 이 레인은 못 읽는다.
|
|
311
|
+
|
|
312
|
+
🟥 XML 에서 접두사는 «이름»이 아니라 **바인딩**이라 `a:` 가 의무가 아니다. PowerPoint 는
|
|
313
|
+
항상 `a:` 를 쓰지만 제3자 생성기는 그렇지 않을 수 있다. 정규식 스캐너는 그걸 못 읽고,
|
|
314
|
+
더 나쁘게는 **다른 런이 하나라도 읽히면 `seen` 이 비지 않아 UNMEASURED 도 안 나간다**.
|
|
315
|
+
⇒ 0 으로 세지 말고 **못 쟀다고 세라**(cross-family R5/codex 지목, 실측 재현).
|
|
316
|
+
"""
|
|
317
|
+
return sorted({p for p in _NS_DECL.findall(xml) if p != 'a'})
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
_TEXT_PART = re.compile(r'ppt/(charts|diagrams|notesSlides)/[^/]+\.xml$')
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
def _unscanned_text_parts(z):
|
|
324
|
+
"""`slides/` 밖인데 **서체를 들고 있는** 부품 — 이 레인이 안 읽는 자리.
|
|
325
|
+
|
|
326
|
+
🟥 반환은 «개수»다. 0 이면 「그런 부품이 없다」이고, N 이면 「N 개를 **안 쟀다**」다.
|
|
327
|
+
둘을 같은 0 으로 접으면 그것이 이 저장소가 이름으로 관리하는
|
|
328
|
+
[[feedback_not_found_is_not_zero_family]] 다."""
|
|
329
|
+
out = collections.Counter()
|
|
330
|
+
for n in z.namelist():
|
|
331
|
+
m = _TEXT_PART.match(n)
|
|
332
|
+
if not m:
|
|
333
|
+
continue
|
|
334
|
+
try:
|
|
335
|
+
x = live_xml(z.read(n).decode('utf-8', 'replace'))
|
|
336
|
+
except Exception:
|
|
337
|
+
continue
|
|
338
|
+
if [t for t in font_names(x) if t and not THEME_REF.match(t)]:
|
|
339
|
+
out[m.group(1)] += 1
|
|
340
|
+
return out
|
|
341
|
+
|
|
342
|
+
|
|
264
343
|
def _norm(s):
|
|
265
344
|
return re.sub(r'\s+', ' ', s).strip().lower()
|
|
266
345
|
|
|
@@ -326,7 +405,7 @@ def scan(cfg, root):
|
|
|
326
405
|
|
|
327
406
|
try:
|
|
328
407
|
z = zipfile.ZipFile(deck)
|
|
329
|
-
rows, nslides = slide_runs(z)
|
|
408
|
+
rows, nslides, foreign_ns = slide_runs(z)
|
|
330
409
|
parts = _parts(z)
|
|
331
410
|
th = theme_fonts(z)
|
|
332
411
|
except Exception as e:
|
|
@@ -446,6 +525,16 @@ def scan(cfg, root):
|
|
|
446
525
|
f'허용 {len(allow)}가족 · 이탈 {len(offenders)}종 · 선언 면제 {sum(exempted.values())}회 · '
|
|
447
526
|
f'그중 템플릿 자신도 쓰는 이름 {sum(demoted.values())}회'
|
|
448
527
|
+ ('' if rows else ' — 🟥 0 이면 UNMEASURED, 「이탈 없음」이 아니다'))
|
|
528
|
+
if foreign_ns:
|
|
529
|
+
notes.append('L15 font : 🟥 DrawingML 을 `a` 가 아닌 접두사로 묶은 장이 있다 ('
|
|
530
|
+
+ ' · '.join(foreign_ns) + ') — 이 스캐너는 `a:` 만 읽는다. '
|
|
531
|
+
'그 자리의 서체는 UNMEASURED (0 아님)')
|
|
532
|
+
unscanned = _unscanned_text_parts(z)
|
|
533
|
+
if unscanned:
|
|
534
|
+
notes.append('L15 font : 🟥 이 레인이 **안 읽는** 부품에 서체가 있다 — '
|
|
535
|
+
+ ' · '.join(f'{k} {v}개' for k, v in sorted(unscanned.items()))
|
|
536
|
+
+ '. 화면에 렌더되지만 `slides/` 밖이라 스캔 범위가 아니다 — '
|
|
537
|
+
'UNMEASURED (0 아님. 「이탈 없음」으로 읽지 마라)')
|
|
449
538
|
if inherited_ok:
|
|
450
539
|
notes.append('L15 font : 상속 확인(템플릿과 해시 동일) — ' + ' · '.join(sorted(inherited_ok))
|
|
451
540
|
+ ' 의 서체는 저자 산물이 아니므로 판정하지 않는다')
|
|
@@ -75,7 +75,20 @@ def deck_screens_grouped(path):
|
|
|
75
75
|
|
|
76
76
|
|
|
77
77
|
def _norm(t):
|
|
78
|
-
|
|
78
|
+
"""비교용 정규화 — 공백 제거 + **HTML 엔티티 해제**.
|
|
79
|
+
|
|
80
|
+
🟥 엔티티 해제를 2026-09-13 에 더했다. 실물 원고(`manuscript.md:1563`)에 `Q & A` 가
|
|
81
|
+
**문자 그대로** 들어 있고 화면은 `Q&A` 라, 같은 문자열이 «문구만 다른 줄» 로 보고됐다.
|
|
82
|
+
같은 내용을 다르게 적은 것을 «어긋남» 으로 렌더한 것이므로 계기 쪽 오탐이다.
|
|
83
|
+
|
|
84
|
+
덱 쪽은 XML 파싱에서 이미 풀려 나오고(`lane_attr_consistency` A12 가 `&` ≡ `&`
|
|
85
|
+
를 이미 그렇게 못 박았다), 원고 쪽만 안 풀려 있었다 — **한쪽만 관대한 정규화**가
|
|
86
|
+
한쪽에서만 통과하는 입력을 만든 형태다. 양쪽을 같은 함수로 지나게 둔다.
|
|
87
|
+
|
|
88
|
+
⚠️ 잃는 것: 원고가 화면에 «&» 라는 글자를 그대로 띄우려고 적은 경우를 이제 못 가른다.
|
|
89
|
+
그 형태는 이 덱에 없고, 생기면 원고 쪽 교정 문제지 화면 대조 문제가 아니다.
|
|
90
|
+
"""
|
|
91
|
+
return re.sub(r'\s', '', html.unescape(t))
|
|
79
92
|
|
|
80
93
|
|
|
81
94
|
def compare(man, deck, threshold=0.60, skip=(), deck_groups=None):
|