Merge remote-tracking branch 'origin/sub_desktop_1' into main_laptop_1 — 줄 구실 잣대 axis_policy.json 받음 · 열쇠 모듈은 그쪽 설계(잣대를 자료에서 읽음) 취함 · 건설 총칙 뿌리를 잣대에서 읽어 CP-01-01(37줄) 표시(미확정 둘은 안 넣음) · 평평한 목록을 잣대대로 표가 붙은 줄(산림 365 · 건설 997 · stats.work_items) · 이름표 건설 칸을 대기 자리에서 merged_tables 로 옮김(서버가 kind 를 냄)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BW6Jdsh18WPtYUR6THZJqn
This commit is contained in:
2026-09-17 13:27:14 +09:00
co-authored by Claude Opus 5
12 changed files with 263 additions and 195 deletions
+7 -6
View File
@@ -1,6 +1,7 @@
"""Z01 공종 축 — 산림·건설 두 kind 를 기초단가와 **같은 계약**으로(2026-09-17 브레인 · PLAN_공종축 8-4).
줄 = **잎**(아래 마디 없고 품셈 표가 붙은 마디) — 일위대가가 붙는 단위. 갈래(`variant_keys`)는 칸으로(편 수 = `stats.units`).
줄 = **품셈 표가 붙은 마디**(`axis_policy.json` `flat_list_filter: pum_tables > 0` — 잎으로 거르면 부모에 붙은 표가 안 뜸) ·
갈래(`variant_keys`)는 칸으로(편 수 = `stats.units`).
이름 = 뿌리부터 전체 경로(「토공 › 토사깍기 › 기계」 · 건설은 부문부터) — 잎 이름만으론 겹침.
계산 규칙 = 표 수준 `rules`(부모 마디 choose_one · sum_steps) + 줄 칸 `rule`·`step_weight`
— 빠지면 발파암(절취 0.1 + 깍기 0.9 + 집토 1) 금액이 틀어짐.
@@ -78,7 +79,7 @@ def base_rows(kind: str) -> list[dict[str, Any]]:
items, by, children = _tree(d)
rows = []
for item in items:
if item["work_item_code"] in children or not item.get("tables"):
if not item.get("tables"):
continue
parent = by.get(item.get("parent_code")) or {}
weight = next(
@@ -144,12 +145,12 @@ def notice(kind: str) -> list[str]:
def extra(kind: str) -> dict[str, Any]:
"""표 수준 덧붙임 — 계산 규칙 · 수 · 갈래 편 수(쪽 나누기와 무관하게 전체)."""
leaves = base_rows(kind)
"""표 수준 덧붙임 — 계산 규칙 · 수 · 갈래 편 수(쪽 나누기와 무관하게 전체)."""
rows = base_rows(kind)
return {
"rules": rules(kind),
"stats": {
"leaves": len(leaves),
"units": sum(max(1, len(r["variant_keys"])) for r in leaves),
"work_items": len(rows),
"units": sum(max(1, len(r["variant_keys"])) for r in rows),
},
}