Merge origin/sub_laptop_7 (50-3 ①②⑤ 서고 서버) into sub_laptop_2

- 충돌 M02_Labor_Doc.calc — sub7 run_line 을 취하고 50-4 「줄」 실음을 run_line 으로 옮김
- 단가승격 펼침 · 참조 줄 답에 원 로직 키 · 「줄」 실음(50-3 ④ 줄 상세용)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MgChuAcyBqUkhHMTXomQC7
This commit is contained in:
2026-10-05 18:53:01 +09:00
co-authored by Claude Opus 5.5
12 changed files with 970 additions and 56 deletions
+13 -9
View File
@@ -221,19 +221,21 @@ def check_saved(files: dict, changed: list[str], book: dict, narrowed=None) -> l
def _labor_files() -> list[tuple[str, Path]]:
"""모든 층(마스터 · 회사 · 개인)의 일위대가 문서 `labor/<열>.json` — (어디, 파일)."""
"""모든 층(마스터 · 회사 · 개인)의 일위대가 `labor/<열>.json` · 단가승격 `promote/<키>.json`
— (어디, 파일)."""
from M02_MasterTemplete import M02_Template_Layers as layers # M02 가 M01 을 부름 — 늦게
root = layers.storage_root()
found = [("마스터", p) for p in sorted((layers.system_dir() / "labor").glob("*.json"))]
found += [(f"회사 {p.parts[-4]}", p) for p in sorted(root.glob("*/templates/labor/*.json"))]
personal = sorted(root.glob("*/*/templates/labor/*.json"))
return found + [(f"개인 {p.parts[-5]}/{p.parts[-4]}", p) for p in personal]
return [
(f"{what} {where}", path)
for kind, what in (("labor", "일위대가"), ("promote", "단가승격"))
for where, path in layers.layer_files(kind)
]
def labor_errors(whole) -> list[str]:
"""일위대가 문서가 담은 로직이 마스터에 없음(39-1d) — 로직 지우기를 막음 · 어디서 쓰는지 알림.
전부터 깨진 것은 `save` 가 고치기 전 검사와 견주어 뺌."""
"""일위대가 · 단가승격 문서가 담은 로직이 마스터에 없음(39-1d · 50-3) — 로직 지우기를 막음 ·
어디서 쓰는지 알림 · 참조 줄(로직 없음)은 건너뜀. 전부터 깨진 것은 `save` 가 고치기 전 검사와
견주어 뺌."""
out = []
for where, path in _labor_files():
try:
@@ -243,10 +245,12 @@ def labor_errors(whole) -> list[str]:
name = (doc.get("일위대가번") if isinstance(doc, dict) else None) or path.stem
for one in (doc.get("담은로직") if isinstance(doc, dict) else None) or []:
key = str(one.get("로직") or "") if isinstance(one, dict) else ""
if not key:
continue
try:
whole.logic(key)
except cm.mf.FormulaError:
out.append(f"일위대가 {where} 「{name}」 이 로직 「{key}」 을 씀 — 거기서 먼저 뺌")
out.append(f"{where} 「{name}」 이 로직 「{key}」 을 씀 — 거기서 먼저 뺌")
return out