@chrono-meta/fh-gate 2.12.1 → 2.14.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 +17 -0
- package/CHEATSHEET.md +19 -1
- package/CLAUDE.md +34 -9
- package/README.ja.md +186 -649
- package/README.ko.md +207 -698
- package/README.md +186 -698
- package/README.zh.md +167 -601
- package/docs/ETHOS.md +73 -1
- package/docs/IDENTITIES.md +83 -0
- package/docs/MODEL_SETUP.md +111 -0
- package/docs/OUTPUT_EVIDENCE.md +10 -2
- package/knowledge/shared/harness-core/fh_detail_protocols.md +131 -1
- package/knowledge/shared/harness-core/fh_three_layer_canon.md +15 -0
- package/knowledge/shared/harness-core/field_harness_diagnostic.md +30 -0
- package/knowledge/shared/harness-core/gate_locality_principle.md +29 -0
- package/knowledge/shared/harness-core/measurement-integrity-checklist.md +80 -0
- package/knowledge/shared/harness-core/ship_readiness_gate.md +103 -15
- package/knowledge/shared/learnings/subagent_invocations_log.yaml +120 -0
- package/knowledge/shared/rules/multi_session_close_protocol.md +7 -1
- package/package.json +22 -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 +776 -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 +150 -0
- package/plugins/fh-meta/skills/install-wizard/SKILL.md +39 -0
- package/scripts/activity_log.sh +144 -0
- package/scripts/com.forge-harness.daily-report.plist +44 -0
- package/scripts/context_continuity_score.sh +435 -0
- package/scripts/daily_report.sh +208 -0
- package/scripts/digest_landing_check.sh +71 -0
- package/scripts/fh_session_load.sh +71 -2
- package/scripts/field_canon_preload.sh +44 -0
- package/scripts/gate_pathspec_check.sh +10 -4
- 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/package_coverage_check.sh +28 -11
- package/scripts/portability_lint.sh +30 -0
- package/scripts/selfcheck.sh +98 -1
- package/scripts/sim_isolated_run.sh +339 -0
- package/scripts/test_heavy_classifier_lanes.sh +4 -1
- package/scripts/test_lane_runner_lanes.sh +75 -0
- package/scripts/test_mapped_tracks_lanes.sh +58 -0
- package/scripts/test_marker_address_lanes.sh +78 -0
- package/scripts/test_marker_soul_check_lanes.sh +36 -0
- 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_sim_isolated_run_lanes.sh +219 -0
- package/scripts/test_skill_canon_preload_lanes.sh +58 -0
- package/scripts/universal_guard_check.sh +20 -8
- package/templates/.git-hooks/pre-commit +465 -8
- package/templates/regression_guard.sh +40 -1
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"""L10 adjacent-dup — **인접 장 대본이 같은 문장을 다시 읽나.**
|
|
2
|
+
|
|
3
|
+
## 실사고
|
|
4
|
+
|
|
5
|
+
한 장을 여러 프레임으로 쪼개면 대본도 갈라야 한다. 뒤 프레임에 원본을 **통째로** 남기면
|
|
6
|
+
앞 장에서 이미 읽은 문장을 다시 읽는다. 실측: 규율 상세를 두 프레임으로 쪼갤 때 앞
|
|
7
|
+
프레임엔 뒷부분만 넣고 뒤 프레임엔 원본을 통째로 남겨 **117자 중 82자가 중복**이었다.
|
|
8
|
+
|
|
9
|
+
## 왜 «인접» 인가
|
|
10
|
+
|
|
11
|
+
빌드 프레임은 **붙어 있다.** 멀리 떨어진 두 장이 같은 문장을 쓰는 것은 수미상관이거나
|
|
12
|
+
의도된 반복일 수 있고, 그건 취향이다. 붙어 있는 두 장이 같은 문장을 읽는 것은 대개
|
|
13
|
+
**쪼개다 만 것**이다. 그래서 창을 인접으로 좁힌다 — 넓히면 오탐이 취향을 침범한다.
|
|
14
|
+
|
|
15
|
+
## 구조는 범용 · 임계는 발표마다 다르다
|
|
16
|
+
|
|
17
|
+
이 코퍼스의 지배적 형태가 «규칙(A)과 값(B)이 한 줄에 붙어 있고 값이 규칙을 타고 넘는»
|
|
18
|
+
것이라, 여기서는 **갈라 놓는다**: 「인접 장 중복 자수를 재고 임계를 넘으면 낸다」가 구조이고,
|
|
19
|
+
임계값은 `surfaces.yaml` 에 사람이 적는다. 미기재면 **재기만 하고 판정하지 않는다**.
|
|
20
|
+
|
|
21
|
+
🟥 재사용: 절 분할과 🖥/🗣 분리는 `interslide_deps` 의 `units()`·`blocks()` 를 그대로 쓴다.
|
|
22
|
+
그 함수들은 원고의 **주석 블록**(🟥·실측·2026-0…)을 이미 배제한다 — 안 배제하면 정정
|
|
23
|
+
기록이 낭독으로 계상돼 known-negative 가 통째로 실패한다(런 #14 에서 실제로 겪었다).
|
|
24
|
+
"""
|
|
25
|
+
import re
|
|
26
|
+
|
|
27
|
+
_SENT = re.compile(r'[^.!?。…\n]+[.!?。…]?')
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def _sentences(text):
|
|
31
|
+
"""문장 후보. 짧은 조각은 버린다 — 「네.」 같은 것이 인접 장마다 있는 건 중복이 아니다."""
|
|
32
|
+
out = []
|
|
33
|
+
for raw in _SENT.findall(text or ''):
|
|
34
|
+
s = raw.strip().lstrip('>').strip()
|
|
35
|
+
if len(s) >= 12: # 임계 미만은 상투어라 신호가 아니다
|
|
36
|
+
out.append(s)
|
|
37
|
+
return out
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def scan(cfg, texts, surf_meta, mod):
|
|
41
|
+
"""(findings, notes). mod = interslide_deps 모듈(units/blocks 재사용)."""
|
|
42
|
+
spec = cfg.get('adjacent_dup') or {}
|
|
43
|
+
limit = spec.get('max_dup_chars') # 사람이 적는다. 없으면 재기만 한다
|
|
44
|
+
spoken = [sid for sid, m in surf_meta.items() if m.get('spoken')]
|
|
45
|
+
if not spoken:
|
|
46
|
+
return [], ['L10 adjacent-dup : 낭독면 선언 0 — UNMEASURED (0 아님)']
|
|
47
|
+
findings, notes = [], []
|
|
48
|
+
for sid in sorted(spoken):
|
|
49
|
+
text = texts[sid][0]
|
|
50
|
+
us = [u for u in mod.units(text) if not u[3]] # 은퇴 절 제외
|
|
51
|
+
if len(us) < 2:
|
|
52
|
+
notes.append(f'L10 adjacent-dup : {sid} — 절 {len(us)}개, 인접 쌍 없음 (0 아님)')
|
|
53
|
+
continue
|
|
54
|
+
speeches = []
|
|
55
|
+
for uid, _head, body, _r in us:
|
|
56
|
+
_screen, speech = mod.blocks(body)
|
|
57
|
+
# 🟥 `blocks()` 는 리스트가 아니라 **문자열**을 돌려준다. 초판이 join 을 걸어
|
|
58
|
+
# 글자 사이에 개행을 끼워 텍스트를 부쉈고, 그 결과 «인접 쌍 0» 이 나왔다 —
|
|
59
|
+
# 계기가 조용히 «중복 없음» 을 보고한 형태다(부재가 아니라 파손).
|
|
60
|
+
speeches.append((uid, _sentences(speech if isinstance(speech, str)
|
|
61
|
+
else '\n'.join(speech))))
|
|
62
|
+
pairs = dup_total = 0
|
|
63
|
+
for (a_id, a), (b_id, b) in zip(speeches, speeches[1:]):
|
|
64
|
+
if not a or not b:
|
|
65
|
+
continue
|
|
66
|
+
pairs += 1
|
|
67
|
+
shared = [s for s in b if s in a]
|
|
68
|
+
n = sum(len(s) for s in shared)
|
|
69
|
+
if not shared:
|
|
70
|
+
continue
|
|
71
|
+
dup_total += n
|
|
72
|
+
total_b = sum(len(s) for s in b) or 1
|
|
73
|
+
pct = round(100 * n / total_b)
|
|
74
|
+
msg = (f'{a_id}→{b_id} 인접 두 절이 같은 문장 {len(shared)}개를 다시 읽는다 '
|
|
75
|
+
f'({n}자 / 뒤 절 {total_b}자 = {pct}%) ▸ 쪼갤 때 뒤 프레임에 원본을 '
|
|
76
|
+
f'통째로 남겼나 ▸ «{shared[0][:50]}»')
|
|
77
|
+
if limit is None:
|
|
78
|
+
notes.append(f' · {msg} 🟥 임계 미기재 — 재기만 하고 판정 안 한다')
|
|
79
|
+
elif n > limit:
|
|
80
|
+
findings.append((f'{sid}:{b_id}', 'ADJACENT-DUP', a_id, f'{n}자', msg))
|
|
81
|
+
else:
|
|
82
|
+
notes.append(f' · {msg} (임계 {limit}자 이하 — 판정 안 함)')
|
|
83
|
+
notes.append(f'L10 adjacent-dup : {sid} — 인접 쌍 {pairs} · 중복 총 {dup_total}자'
|
|
84
|
+
+ (f' · 임계 {limit}자' if limit is not None
|
|
85
|
+
else ' · 🟥 임계 미기재(surfaces.yaml adjacent_dup.max_dup_chars) — 판정 안 함'))
|
|
86
|
+
return findings, notes
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"""L9 progression — **선언된 단계 중 하나가 화면에서 빠졌나.**
|
|
2
|
+
|
|
3
|
+
## 실사고 (이 레인의 존재 근거)
|
|
4
|
+
|
|
5
|
+
원고가 slide 17~20 에 **단계적 확장**을 깔았다:
|
|
6
|
+
① 좋아진다 → ② 그래도 남는다 → ③ 더 늘려도 안 된다 → ④ 입장을 바꾸면 보인다
|
|
7
|
+
그런데 **①이 화면에서 빠졌고**, 리뷰어가 논지를 **정반대로** 읽었다.
|
|
8
|
+
|
|
9
|
+
🟥 **개별 문장은 전부 옳았다.** 압축 과정에서 첫 칸이 떨어진 것이라 문장 층 교정으로는
|
|
10
|
+
구조적으로 안 잡힌다. 원문의 처방: *«리뷰어가 요약한 뜻이 저자 의도와 반대인가»를 물어야
|
|
11
|
+
잡힌다.* 그 질문의 **기계로 되는 절반**이 이 레인이다.
|
|
12
|
+
|
|
13
|
+
## 무엇을 재고 무엇을 안 재나
|
|
14
|
+
|
|
15
|
+
- 잰다 — 사람이 `surfaces.yaml` 에 **선언한** 단계 각각이, 그 단계가 놓이기로 한
|
|
16
|
+
**화면 표면들 안에 실제로 있는가.** 있거나 없거나다. 애매하지 않다.
|
|
17
|
+
- 안 잰다 — «이 단계 구성이 좋은가» · «리뷰어가 옳게 이해했나». 그건 결론이고, 코드로
|
|
18
|
+
굳히면 오늘의 판단이 내일의 천장이 된다. 되읊음 대조는 사람이 한다.
|
|
19
|
+
|
|
20
|
+
🟥 **L8(interslide) 과 다른 축이다.** L8 은 «가리킨 대상이 있나»(의존)를 보고, 이 레인은
|
|
21
|
+
«선언된 단계가 다 있나»(완결)를 본다. 실측으로 확인: `interslide_deps.py` 에 «단계»·«열거»
|
|
22
|
+
0 히트, «의존» 11 히트.
|
|
23
|
+
|
|
24
|
+
## 왜 advisory 가 아니라 차단인가
|
|
25
|
+
|
|
26
|
+
L8·구 L9(prose)는 오탐의 최저비용 무마가 «그 문장을 지우는 것»이라 advisory 였다. 여기는
|
|
27
|
+
다르다 — **사람이 «이 넷은 한 세트다»라고 명시 선언한 것**만 검사한다. 선언이 없으면
|
|
28
|
+
`NOT_CONFIGURED`(0 아님)이고 아무것도 안 본다. 즉 오탐의 여지가 선언 자체에 갇혀 있고,
|
|
29
|
+
선언한 단계가 화면에 없는 것은 **애매하지 않은 사실**이다.
|
|
30
|
+
"""
|
|
31
|
+
import os
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def scan(cfg, texts, surf_meta):
|
|
35
|
+
"""(findings, notes). 선언이 없으면 아무것도 안 본다 — 그리고 그걸 0 으로 안 읽는다."""
|
|
36
|
+
specs = cfg.get('progressions')
|
|
37
|
+
if not specs:
|
|
38
|
+
return [], ['L9 progression : 선언 없음 — NOT_CONFIGURED (0 아님). '
|
|
39
|
+
'단계가 빠지면 논지가 뒤집히는 자리가 있으면 surfaces.yaml 에 선언해라']
|
|
40
|
+
findings, notes = [], []
|
|
41
|
+
for spec in specs:
|
|
42
|
+
pid = spec.get('id', '?')
|
|
43
|
+
steps = spec.get('steps') or []
|
|
44
|
+
screens = spec.get('screens') or []
|
|
45
|
+
if not steps or not screens:
|
|
46
|
+
notes.append(f'L9 progression : {pid} — steps/screens 미기재, UNMEASURED (0 아님)')
|
|
47
|
+
continue
|
|
48
|
+
# 선언된 화면 중 실제로 읽힌 것만 합친다. 못 읽은 화면은 «없음»이 아니라 미측정이다.
|
|
49
|
+
present, unread = [], []
|
|
50
|
+
for sid in screens:
|
|
51
|
+
if sid in texts:
|
|
52
|
+
present.append(sid)
|
|
53
|
+
else:
|
|
54
|
+
unread.append(sid)
|
|
55
|
+
if unread:
|
|
56
|
+
notes.append(f'L9 progression : {pid} — 선언된 화면 {unread} 를 못 읽었다 '
|
|
57
|
+
f'(UNMEASURED — 이 단계들의 «없음»은 판정하지 않는다)')
|
|
58
|
+
if not present:
|
|
59
|
+
notes.append(f'L9 progression : {pid} — 읽힌 화면 0, 판정 불가 (0 아님)')
|
|
60
|
+
continue
|
|
61
|
+
blob = '\n'.join(texts[sid][0] for sid in present)
|
|
62
|
+
missing = []
|
|
63
|
+
for i, st in enumerate(steps, 1):
|
|
64
|
+
anchor = st.get('anchor') if isinstance(st, dict) else str(st)
|
|
65
|
+
if not anchor:
|
|
66
|
+
notes.append(f'L9 progression : {pid} 단계 {i} — anchor 비어 있음, UNMEASURED')
|
|
67
|
+
continue
|
|
68
|
+
if anchor not in blob:
|
|
69
|
+
missing.append((i, anchor, st.get('why') if isinstance(st, dict) else None))
|
|
70
|
+
notes.append(f'L9 progression : {pid} — 단계 {len(steps)} · 화면 {len(present)}면'
|
|
71
|
+
+ (f' · 미측정 화면 {len(unread)}' if unread else '')
|
|
72
|
+
+ f' · 화면에 없는 단계 {len(missing)}')
|
|
73
|
+
for i, anchor, why in missing:
|
|
74
|
+
findings.append((f'{pid}:L9', 'PROGRESSION-GAP', f'step{i}', anchor,
|
|
75
|
+
'선언된 단계가 화면에 없다 — 압축에서 떨어졌나. '
|
|
76
|
+
'🟥 개별 문장이 다 옳아도 논지가 뒤집힌다'
|
|
77
|
+
+ (f' ▸ {why}' if why else '')))
|
|
78
|
+
if not findings:
|
|
79
|
+
notes.append(' 🟢 선언된 단계가 전부 화면에 있다. '
|
|
80
|
+
'⚠️ 이것은 «구성이 좋다»가 아니라 «선언한 것이 안 빠졌다»이다')
|
|
81
|
+
return findings, notes
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"""L11 promise — **앞에서 예고한 것이 뒤에서 상환되나** (후보 나열, 판정은 사람).
|
|
2
|
+
|
|
3
|
+
## 실사고
|
|
4
|
+
|
|
5
|
+
- 수량 약속: S6 이 «세 번» 을 예고했는데 본편 상환이 **1건**이었다.
|
|
6
|
+
- 주제 약속: §2→§3 전환문이 «가속» 을 약속했는데 **§3 이 그 약속을 못 지켰다**(콜드리드 판정).
|
|
7
|
+
⚠️ 초판은 «정의와 비용 정직«만»» 이라고 적었는데 원출처는 «무엇을 안 냈나»만 적고
|
|
8
|
+
«무엇«만» 냈나»는 안 적는다 — 「~만」은 배포본이 보탠 것이라 뺐다.
|
|
9
|
+
둘 다 콜드리더가 잡았다. 기존 체크리스트는 «결론이 첫 질문에 답하는가»만 봐서, **중반 티저의
|
|
10
|
+
미상환**은 구조적으로 안 잡혔다.
|
|
11
|
+
|
|
12
|
+
## 🟥 판정하지 않는다 — 이 레인은 «채널»이지 «결론»이 아니다
|
|
13
|
+
|
|
14
|
+
«무엇이 상환으로 쳐지는가»는 의미 판정이고, 코드로 굳히면 오늘의 판단이 내일의 천장이 된다.
|
|
15
|
+
그래서 이 레인은 **예고를 찾아 나열하고, 그 뒤에 대상어가 몇 번 나오는지 세기만** 한다.
|
|
16
|
+
숫자가 맞아도 상환이 아닐 수 있고, 숫자가 달라도 상환일 수 있다 — **판정은 사람이 한다.**
|
|
17
|
+
선례: `ko-tech-writer` Step 4-b(전칭 단정 후보 검출 — 오탐 허용, 판정은 사람).
|
|
18
|
+
|
|
19
|
+
🟥 **advisory 고정.** 오탐의 최저비용 무마가 «예고 문장을 지우는 것»이라 종료코드에 태우면
|
|
20
|
+
원고를 나쁜 방향으로 민다 — L8 과 같은 이유다.
|
|
21
|
+
|
|
22
|
+
## 오탐이 어디서 나나 (미리 적는다)
|
|
23
|
+
|
|
24
|
+
대상어 추출이 약하다. 「세 번」 앞의 명사를 집는 단순 규칙이라 조사·수식이 붙으면 빗나간다.
|
|
25
|
+
**빗나가면 대상어 없이 예고만 낸다** — 그게 «못 찾았다»를 «없다»로 접는 것보다 낫다.
|
|
26
|
+
"""
|
|
27
|
+
import re
|
|
28
|
+
|
|
29
|
+
# 수량 예고: 「세 번」 「두 가지」 「네 개」 — 아라비아 숫자와 한글 수사 둘 다.
|
|
30
|
+
_QUANT = re.compile(r'(한|두|세|네|다섯|여섯|일곱|여덟|아홉|열|[0-9]+)\s*(번|가지|개|축|단계)')
|
|
31
|
+
# 시점 예고: 뒤에서 다룬다는 신호
|
|
32
|
+
_FWD = ('뒤에서', '나중에', '곧 ', '잠시 후', '이따', '뒤이어', '다음에 ', '말씀드리겠', '보시겠')
|
|
33
|
+
# 대상어 후보: 수량 앞의 한글 덩어리
|
|
34
|
+
# 🟥 조사를 반드시 떼어낸다. 초판은 `([가-힣]{2,10})` 이 탐욕적이라 «실패를» 을 통째로 집었고,
|
|
35
|
+
# 그걸로 세니 뒤에 「실패는」 이 세 번 나와도 **0회**가 나왔다 — 두 픽스처가 같은 답을 내서
|
|
36
|
+
# 판별력이 0 이었다. 조사 목록을 명시 그룹으로 빼야 어간이 남는다.
|
|
37
|
+
_HEAD = re.compile(r'([가-힣]{2,10}?)(?:을|를|은|는|이|가|의|도|만)?\s*$')
|
|
38
|
+
# 🟥 서수는 예고가 아니라 **상환 그 자체**다 — 「두 번째 실패는…」 은 약속이 아니다.
|
|
39
|
+
# 안 거르면 상환 문장이 미상환 후보로 계상돼 방향이 거꾸로 된다.
|
|
40
|
+
# 미래 지향 표지: «~하겠습니다» «~드립니다» «~보시겠» 류. 회고문(«~했기 때문입니다»)은 안 걸린다.
|
|
41
|
+
_PROSPECTIVE = re.compile(r'(겠습니다|겠어요|드립니다|드리겠|보시면|보겠|말씀드리|소개하|다뤄|다루겠|살펴보)')
|
|
42
|
+
_ORDINAL = re.compile(r'(한|두|세|네|다섯|여섯|일곱|여덟|아홉|열|[0-9]+)\s*번째')
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def _lines(text):
|
|
46
|
+
for i, ln in enumerate(text.split('\n'), 1):
|
|
47
|
+
s = ln.strip().lstrip('>').strip()
|
|
48
|
+
if s:
|
|
49
|
+
yield i, s
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def scan(texts, surf_meta, max_report=8, mod=None):
|
|
53
|
+
"""🟥 `mod`(interslide_deps)가 오면 **낭독 블록만** 본다.
|
|
54
|
+
|
|
55
|
+
실물 실측(2026-08-29, 실제 덱): mod 없이 표면 전체를 읽었더니 후보 **133건**이 나왔고,
|
|
56
|
+
출력에 찍힌 표본에서 **주석·설계 노트**(★ · 🟥 · 「운영자 결정」)가 다수였다.
|
|
57
|
+
⚠️ 초판은 여기 «표본 8건 중 5건» 이라 적었는데 그 분해는 기록에 안 남겼다 — 코퍼스에
|
|
58
|
+
「8건 중 5건」이 **다른 측정**으로 이미 살고 있어(챔버 KILL 등) 빌려온 것처럼 읽힌다.
|
|
59
|
+
수치를 못 대므로 «다수»로 내린다. 대신 대체 후 수치는 남는다: 133 → 36 → 10.
|
|
60
|
+
이 코퍼스의 정정 기록은
|
|
61
|
+
낭독과 **같은 `>` 인용 블록**에 살고 앞머리 이모지로만 갈린다 — 런 #14 에서 이미 겪어
|
|
62
|
+
`interslide_deps` 가 그 방어를 갖고 있는데, 이 레인이 그걸 안 썼다.
|
|
63
|
+
⇒ 있는 걸 안 쓴 형태다. mod 가 없으면 **그렇다고 적고** 전체를 읽는다(조용히 접지 않는다).
|
|
64
|
+
"""
|
|
65
|
+
spoken = [sid for sid, m in surf_meta.items() if m.get('spoken')]
|
|
66
|
+
if not spoken:
|
|
67
|
+
return [], ['L11 promise : 낭독면 선언 0 — UNMEASURED (0 아님)']
|
|
68
|
+
notes = []
|
|
69
|
+
if mod is None:
|
|
70
|
+
notes.append('L11 promise : ⚠️ 낭독 블록 분리기 없이 돈다 — 주석·설계 노트가 예고로 '
|
|
71
|
+
'계상된다(실측: 그 상태에서 후보 133건, 표본 8중 5가 주석). 후보 수를 '
|
|
72
|
+
'신뢰하지 마라')
|
|
73
|
+
for sid in sorted(spoken):
|
|
74
|
+
text = texts[sid][0]
|
|
75
|
+
if mod is not None:
|
|
76
|
+
speech = []
|
|
77
|
+
for _uid, _h, body, _r in mod.units(text):
|
|
78
|
+
_sc, sp = mod.blocks(body)
|
|
79
|
+
speech.append(sp if isinstance(sp, str) else '\n'.join(sp))
|
|
80
|
+
text = '\n'.join(speech) or text
|
|
81
|
+
rows = list(_lines(text))
|
|
82
|
+
promises = []
|
|
83
|
+
for idx, (no, s) in enumerate(rows):
|
|
84
|
+
if _ORDINAL.search(s):
|
|
85
|
+
continue # 상환 문장을 예고로 세지 않는다
|
|
86
|
+
m = _QUANT.search(s)
|
|
87
|
+
fwd = any(w in s for w in _FWD)
|
|
88
|
+
# 🟥 **약속은 정의상 앞을 향한다.** 수량사만으로는 회고문이 걸린다 —
|
|
89
|
+
# 실물 실측: 「두 번 겪었기 **때문입니다**」 · 「한 번은 … 것입니다」 는 과거이지
|
|
90
|
+
# 예고가 아니다. 그래서 수량사 히트는 **미래 지향 표지**를 요구한다.
|
|
91
|
+
# (시점 예고 `_FWD` 는 그 자체가 미래 지향이라 이 검사를 안 탄다.)
|
|
92
|
+
# ⚠️ 이건 볼륨 불만이 아니라 «예고» 의 정의다 — 좁히는 근거가 실측이 아니라 정의다.
|
|
93
|
+
if m and not fwd and not _PROSPECTIVE.search(s):
|
|
94
|
+
continue
|
|
95
|
+
if not m and not fwd:
|
|
96
|
+
continue
|
|
97
|
+
head = None
|
|
98
|
+
if m:
|
|
99
|
+
pre = s[:m.start()]
|
|
100
|
+
hm = _HEAD.search(pre)
|
|
101
|
+
head = hm.group(1) if hm else None
|
|
102
|
+
after = '\n'.join(x[1] for x in rows[idx + 1:])
|
|
103
|
+
cnt = after.count(head) if head else None
|
|
104
|
+
promises.append((no, s, m.group(0) if m else '(시점 예고)', head, cnt))
|
|
105
|
+
if not promises:
|
|
106
|
+
notes.append(f'L11 promise : {sid} — 예고 후보 0. '
|
|
107
|
+
'⚠️ «약속이 없다»가 아니라 «이 패턴으로는 안 잡혔다»이다')
|
|
108
|
+
continue
|
|
109
|
+
notes.append(f'L11 promise : {sid} — 예고 후보 {len(promises)}건 '
|
|
110
|
+
f'🟥 advisory, 상환 여부는 사람이 판정한다 (아래 최대 {max_report})')
|
|
111
|
+
for no, s, q, head, cnt in promises[:max_report]:
|
|
112
|
+
if head is None:
|
|
113
|
+
tail = '대상어 추출 실패 — 사람이 본다 (없다고 접지 않는다)'
|
|
114
|
+
elif cnt == 0:
|
|
115
|
+
tail = f'🟥 뒤에서 «{head}» 가 **0회** — 상환 안 됐을 수 있다'
|
|
116
|
+
else:
|
|
117
|
+
tail = f'뒤에서 «{head}» {cnt}회 — 예고({q})와 맞나'
|
|
118
|
+
notes.append(f' · {no}: «{s[:60]}» ▸ {q} ▸ {tail}')
|
|
119
|
+
if len(promises) > max_report:
|
|
120
|
+
notes.append(f' … 외 {len(promises) - max_report}건')
|
|
121
|
+
return [], notes
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import glob,re,os,sys
|
|
2
|
+
from lxml import etree
|
|
3
|
+
# 작업 트리: 인자 > 환경변수 OOXML_ROOT > 현재 디렉터리(v4 있으면 그쪽)
|
|
4
|
+
_root = sys.argv[1] if len(sys.argv)>1 else os.environ.get('OOXML_ROOT')
|
|
5
|
+
if not _root:
|
|
6
|
+
_root = 'v4' if os.path.isdir('v4/ppt/slides') else '.'
|
|
7
|
+
if not os.path.isdir(os.path.join(_root,'ppt','slides')):
|
|
8
|
+
print('GATE FAIL · 작업 트리를 못 찾음:',_root); sys.exit(1)
|
|
9
|
+
os.chdir(_root)
|
|
10
|
+
ok=True; P='http://schemas.openxmlformats.org/presentationml/2006/main'
|
|
11
|
+
_A='http://schemas.openxmlformats.org/drawingml/2006/main'
|
|
12
|
+
def fail(*a):
|
|
13
|
+
global ok; ok=False; print(' ❌',*a)
|
|
14
|
+
for p in glob.glob('**/*.xml',recursive=True)+glob.glob('**/*.rels',recursive=True):
|
|
15
|
+
try: etree.parse(p)
|
|
16
|
+
except Exception as e: fail('PARSE',p,e)
|
|
17
|
+
# ① 관계 참조 무결성 (repair 다이얼로그의 주범)
|
|
18
|
+
for kind in ('slides','notesSlides','slideLayouts','slideMasters','notesMasters'):
|
|
19
|
+
for p in sorted(glob.glob('ppt/%s/*.xml'%kind)):
|
|
20
|
+
x=open(p).read()
|
|
21
|
+
rp='ppt/%s/_rels/%s.rels'%(kind,os.path.basename(p))
|
|
22
|
+
rmap=set(re.findall(r'Id="([^"]+)"',open(rp).read())) if os.path.exists(rp) else set()
|
|
23
|
+
for attr,rid in re.findall(r'(r:(?:id|embed|link|pict|dm|lo|qs|cs))="([^"]+)"',x):
|
|
24
|
+
if rid not in rmap: fail('DANGLING',p,attr,rid)
|
|
25
|
+
# ② rels 대상 파일 존재
|
|
26
|
+
for rp in glob.glob('**/_rels/*.rels',recursive=True):
|
|
27
|
+
base=os.path.dirname(os.path.dirname(rp))
|
|
28
|
+
for tgt,mode in re.findall(r'Target="([^"]+)"(?:[^>]*TargetMode="([^"]*)")?',open(rp).read()):
|
|
29
|
+
if mode=='External' or tgt.startswith('http'): continue
|
|
30
|
+
f=os.path.normpath(os.path.join(base,tgt))
|
|
31
|
+
if not os.path.exists(f): fail('MISSING TARGET',rp,tgt)
|
|
32
|
+
# ③ cNvPr id 중복 · <a:t> 개행
|
|
33
|
+
for p in sorted(glob.glob('ppt/slides/slide*.xml')):
|
|
34
|
+
ids=[e.get('id') for e in etree.parse(p).iter('{%s}cNvPr'%P)]
|
|
35
|
+
d=[i for i in set(ids) if ids.count(i)>1]
|
|
36
|
+
if d: fail('DUP cNvPr',p,d)
|
|
37
|
+
for m in re.findall(r'<a:t>([^<]*)</a:t>',open(p).read()):
|
|
38
|
+
if '\n' in m or '\r' in m: fail('NEWLINE in a:t',p,repr(m[:30]))
|
|
39
|
+
# ④ 프레젠테이션 등록 / Content_Types / sldId
|
|
40
|
+
pres=open('ppt/presentation.xml').read()
|
|
41
|
+
m={rid:os.path.basename(t) for rid,t in re.findall(r'Id="([^"]+)"[^>]*Target="([^"]+)"',open('ppt/_rels/presentation.xml.rels').read())}
|
|
42
|
+
order=[m[r] for r in re.findall(r'<p:sldId[^>]*r:id="([^"]+)"',pres)]
|
|
43
|
+
ct=open('[Content_Types].xml').read()
|
|
44
|
+
for f in order:
|
|
45
|
+
if '/ppt/slides/%s"'%f not in ct: fail('CT missing',f)
|
|
46
|
+
sld=re.findall(r'<p:sldId id="(\d+)"',pres)
|
|
47
|
+
if len(set(sld))!=len(sld): fail('DUP sldId')
|
|
48
|
+
for p in glob.glob('ppt/slides/slide*.xml'):
|
|
49
|
+
if os.path.basename(p) not in order: fail('ORPHAN slide',p)
|
|
50
|
+
app=open('docProps/app.xml').read()
|
|
51
|
+
if '<Slides>%d</Slides>'%len(order) not in app: fail('app.xml Slides != %d'%len(order))
|
|
52
|
+
if '<Notes>%d</Notes>'%len(order) not in app: fail('app.xml Notes != %d'%len(order))
|
|
53
|
+
|
|
54
|
+
i=app.find('<TitlesOfParts>')
|
|
55
|
+
import re as _re
|
|
56
|
+
n_lp=len(_re.findall(r'<vt:lpstr>',app[i:]))
|
|
57
|
+
sz=int(_re.search(r'<TitlesOfParts><vt:vector size="(\d+)"',app).group(1))
|
|
58
|
+
if n_lp!=sz: fail('app.xml TitlesOfParts vector size %d != lpstr %d'%(sz,n_lp))
|
|
59
|
+
|
|
60
|
+
for _p in sorted(glob.glob('ppt/slides/slide*.xml')):
|
|
61
|
+
_t=etree.parse(_p).getroot().find('.//{%s}cSld/{%s}spTree'%(P,P))
|
|
62
|
+
_k=[etree.QName(e).localname for e in _t]
|
|
63
|
+
if _k[:2]!=['nvGrpSpPr','grpSpPr']: fail('spTree 순서 위반',_p,_k[:3])
|
|
64
|
+
|
|
65
|
+
# ── prstGeom 조정값 이름 검증 (2026-08-27 신설: round2SameRect 에 adj 하나만 줘서 두 번 깨졌다)
|
|
66
|
+
_A='http://schemas.openxmlformats.org/drawingml/2006/main'
|
|
67
|
+
_ADJ={'rect':set(),'ellipse':set(),'line':set(),'roundRect':{'adj'},
|
|
68
|
+
'arc':{'adj1','adj2'},'round2SameRect':{'adj1','adj2'},'round2DiagRect':{'adj1','adj2'},
|
|
69
|
+
'round1Rect':{'adj'},'triangle':{'adj'},'chevron':{'adj'},
|
|
70
|
+
'circularArrow':{'adj1','adj2','adj3','adj4','adj5'},
|
|
71
|
+
'rightArrow':{'adj1','adj2'},'leftArrow':{'adj1','adj2'},
|
|
72
|
+
'upArrow':{'adj1','adj2'},'downArrow':{'adj1','adj2'}}
|
|
73
|
+
for _p in sorted(glob.glob('ppt/slides/slide*.xml')):
|
|
74
|
+
for _g in etree.parse(_p).getroot().iter('{%s}prstGeom'%_A):
|
|
75
|
+
_prst=_g.get('prst')
|
|
76
|
+
if _prst not in _ADJ: continue
|
|
77
|
+
_names={x.get('name') for x in _g.iter('{%s}gd'%_A)}
|
|
78
|
+
if _names and not _names <= _ADJ[_prst]:
|
|
79
|
+
fail('prstGeom 조정값 이름', _p, _prst, sorted(_names), '허용:', sorted(_ADJ[_prst]) or '없음')
|
|
80
|
+
|
|
81
|
+
# ── ⑤ Content_Types 역방향: Override 가 가리키는 파트가 실제로 있나 (2026-08-28 신설)
|
|
82
|
+
# 기존 ④ 는 «등록된 슬라이드가 CT 에 있나» 한 방향만 봤다. 슬라이드를 삭제하면
|
|
83
|
+
# CT 에 죽은 Override 가 남고, 그 파일은 PowerPoint 가 아예 열지 못한다.
|
|
84
|
+
# 실제로 40p 삭제 때 정규식이 ContentType 값의 '/' 때문에 매치되지 않아 2개가 남았다.
|
|
85
|
+
_over = set(re.findall(r'<Override PartName="([^"]+)"', ct))
|
|
86
|
+
for _o in sorted(_over):
|
|
87
|
+
if not _o.startswith(('/ppt/slides/','/ppt/notesSlides/')): continue
|
|
88
|
+
if not os.path.exists(_o.lstrip('/')): fail('CT ORPHAN Override', _o, '(파트 파일 없음)')
|
|
89
|
+
for _f in sorted(glob.glob('ppt/notesSlides/notesSlide*.xml')):
|
|
90
|
+
if '/%s"'%_f not in ct: fail('CT missing (notesSlide)', _f)
|
|
91
|
+
|
|
92
|
+
# ── ⑥ 화면 밖으로 나간 도형 (2026-08-28 신설: 26p 가 우측으로 1,854,400 EMU 벗어나 있었다)
|
|
93
|
+
_W,_H = (int(x) for x in (re.search(r'sldSz cx="(\d+)" cy="(\d+)"', pres).groups()))
|
|
94
|
+
for _p in sorted(glob.glob('ppt/slides/slide*.xml')):
|
|
95
|
+
for _sp in etree.parse(_p).getroot().iter():
|
|
96
|
+
if etree.QName(_sp).localname not in ('sp','pic','cxnSp','graphicFrame'): continue
|
|
97
|
+
_xf=_sp.find('.//{%s}spPr/{%s}xfrm'%(P,_A))
|
|
98
|
+
if _xf is None: _xf=_sp.find('.//{%s}xfrm'%_A)
|
|
99
|
+
if _xf is None: continue
|
|
100
|
+
_off=_xf.find('{%s}off'%_A); _ext=_xf.find('{%s}ext'%_A)
|
|
101
|
+
if _off is None or _ext is None: continue
|
|
102
|
+
_x,_y=int(_off.get('x')),int(_off.get('y')); _cx,_cy=int(_ext.get('cx')),int(_ext.get('cy'))
|
|
103
|
+
if _x+_cx > _W+10000 or _y+_cy > _H+10000 or _x < -10000 or _y < -10000:
|
|
104
|
+
_nv=_sp.find('.//{%s}cNvPr'%P)
|
|
105
|
+
fail('OFF-CANVAS', os.path.basename(_p), _nv.get('name') if _nv is not None else '?',
|
|
106
|
+
'x %d~%d y %d~%d (화면 %dx%d)'%(_x,_x+_cx,_y,_y+_cy,_W,_H))
|
|
107
|
+
|
|
108
|
+
# ── ⑦ 열린 도형에 채움 (2026-08-28 신설: arc 를 카드로 오인해 채우면 부채꼴이 칠해진다)
|
|
109
|
+
_OPEN={'arc','line','straightConnector1','bentConnector2','bentConnector3',
|
|
110
|
+
'curvedConnector2','curvedConnector3','curvedConnector4','curvedConnector5'}
|
|
111
|
+
for _p in sorted(glob.glob('ppt/slides/slide*.xml')):
|
|
112
|
+
for _sp in etree.parse(_p).getroot().iter('{%s}sp'%P):
|
|
113
|
+
_spPr=_sp.find('{%s}spPr'%P)
|
|
114
|
+
if _spPr is None: continue
|
|
115
|
+
_g=_spPr.find('{%s}prstGeom'%_A)
|
|
116
|
+
if _g is None or _g.get('prst') not in _OPEN: continue
|
|
117
|
+
if _spPr.find('{%s}solidFill'%_A) is not None:
|
|
118
|
+
_nv=_sp.find('.//{%s}cNvPr'%P)
|
|
119
|
+
fail('열린 도형에 채움', os.path.basename(_p),
|
|
120
|
+
_nv.get('name') if _nv is not None else '?', _g.get('prst'))
|
|
121
|
+
|
|
122
|
+
# ── ⑧ 선 굵기 토큰 래칫 (2026-08-28 신설)
|
|
123
|
+
# 체크리스트 C1 은 «구조 1pt · 테두리 3pt · 흐름 7pt · 강조 14pt» 네 토큰을 정한다.
|
|
124
|
+
# 그런데 실측하면 도형을 만들 때마다 눈대중으로 새 굵기가 생겨 42% 가 토큰 밖이었다.
|
|
125
|
+
# 🟥 전량 차단하면 첫 실행부터 막혀 --no-verify 를 훈련시킨다(도달불가 Done-When).
|
|
126
|
+
# 그래서 «지금»을 기준선에 박고 **늘어날 때만** 막는다. 줄면 낮추라고 알린다.
|
|
127
|
+
# 🟥 기준선은 «총합»이 아니라 «굵기별»이다 — 총합만 세면 어느 굵기가 새로 생겼는지
|
|
128
|
+
# 못 짚어서, 판정은 맞고 처방은 틀린 게이트가 된다.
|
|
129
|
+
_C1={12700:'구조 1pt',38100:'테두리 3pt',88900:'흐름 7pt',177800:'강조 14pt'}
|
|
130
|
+
_BASE=os.path.join(os.path.dirname(os.path.abspath(__file__)),'c1_baseline.txt')
|
|
131
|
+
_seen={}
|
|
132
|
+
for _p in sorted(glob.glob('ppt/slides/slide*.xml')):
|
|
133
|
+
for _l in etree.parse(_p).iter('{%s}ln'%_A):
|
|
134
|
+
_w=_l.get('w')
|
|
135
|
+
if not _w or int(_w) in _C1: continue
|
|
136
|
+
_seen.setdefault(int(_w),[]).append(os.path.basename(_p))
|
|
137
|
+
_now={k:len(v) for k,v in _seen.items()}
|
|
138
|
+
_dump=lambda d:'\n'.join('%d %d'%(k,d[k]) for k in sorted(d))
|
|
139
|
+
if os.path.exists(_BASE):
|
|
140
|
+
_prev={}
|
|
141
|
+
for _line in open(_BASE):
|
|
142
|
+
_line=_line.split('#')[0].strip()
|
|
143
|
+
if _line: _k,_v=_line.split(); _prev[int(_k)]=int(_v)
|
|
144
|
+
_grew={k:(_prev.get(k,0),v) for k,v in _now.items() if v>_prev.get(k,0)}
|
|
145
|
+
if _grew:
|
|
146
|
+
fail('C1 선 굵기 토큰 밖이 늘었다 —','허용:',' · '.join('%d(%s)'%(k,v) for k,v in _C1.items()))
|
|
147
|
+
for _w,(_a,_b) in sorted(_grew.items()):
|
|
148
|
+
_tag='새 굵기' if _a==0 else '증가'
|
|
149
|
+
print(' w=%-7d (%.2fpt) %d → %d [%s] 예: %s'%(_w,_w/12700,_a,_b,_tag,
|
|
150
|
+
', '.join(sorted(set(_seen[_w]))[:3])))
|
|
151
|
+
print(' ↳ 위 굵기를 네 토큰 중 하나로 바꾸거나, 의도한 값이면 %s 를 갱신해라'%os.path.relpath(_BASE))
|
|
152
|
+
elif sum(_now.values())<sum(_prev.values()):
|
|
153
|
+
print(' ✅ C1 토큰 밖 %d → %d 로 줄었다. 기준선 갱신:'%(sum(_prev.values()),sum(_now.values())))
|
|
154
|
+
print(' python3 %s --write-c1-baseline'%os.path.relpath(__file__))
|
|
155
|
+
else:
|
|
156
|
+
print(' ⚠ C1 기준선 없음 — 토큰 밖 %d곳(%d종). 박으려면:'%(sum(_now.values()),len(_now)))
|
|
157
|
+
print(' python3 %s --write-c1-baseline'%os.path.relpath(__file__))
|
|
158
|
+
if '--write-c1-baseline' in sys.argv:
|
|
159
|
+
open(_BASE,'w').write('# C1 선 굵기 기준선 — «굵기 개수». gate.py ⑧ 이 읽는다.\n'+_dump(_now)+'\n')
|
|
160
|
+
print(' ✍ 기준선 기록: %s (%d종 %d곳)'%(os.path.relpath(_BASE),len(_now),sum(_now.values())))
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
print('GATE','PASS' if ok else 'FAIL','·',len(order),'장')
|
|
164
|
+
sys.exit(0 if ok else 1)
|