feat(master_data): 인력_자체 — 막힌 절 7개 세움 · 범위규칙 이상·이하

- 인력_자체.json: 중급기술자 · 절단공 · 특수비계공(값 null · 관리자가 채움)
- 2-9-12 · 2-11-8 · 2-11-9 · 2-12-4(조립해체 · 추진 · 이동설치) · 5-1-7 인장 · 6-2-5 · 6-3-6 해체 로직
- 2-1-1 · 2-1-2 범위규칙 이상·미만 · 2-12-4 범위규칙 이상·이하
- master_formula: 이상·이하(양 끝 포함 · 겹치면 위 끝이 가장 작은 줄) · _틀.md 한 줄
- 재료_자체: 아세틸렌가스(ℓ)

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V1MKKZKpUHTPKb513FneU8
This commit is contained in:
2026-09-19 18:14:16 +09:00
co-authored by Claude Opus 5
parent 4dda21d67d
commit 31dd7a7e24
10 changed files with 1004 additions and 10 deletions
@@ -273,6 +273,8 @@ def _match(table: dict, row: dict, cond: str, want) -> bool:
)
if rule == "이하": # 칸마다 위 끝만 — 맞는 줄 가운데 위 끝이 가장 작은 줄(find)
return (low is None or want > low) and (high is None or want <= high)
if rule == "이상·이하": # 양 끝 포함 — 이웃 칸 끝이 겹치면 위 끝이 가장 작은 줄(find)
return (low is None or want >= low) and (high is None or want <= high)
raise FormulaError(f"모르는 범위규칙 「{table.get('범위규칙')}")
return have == want
@@ -282,7 +284,7 @@ def find(table: dict, conds: dict, want: str | None = None) -> dict:
if cond not in table.get("조건", {}):
raise FormulaError(f"{table['열쇠']}」 에 없는 조건 「{cond}")
hits = [row for row in table[""] if all(_match(table, row, c, v) for c, v in conds.items())]
if len(hits) > 1 and table.get("범위규칙", "").split(" · ")[0] == "이하":
if len(hits) > 1 and table.get("범위규칙", "").split(" · ")[0] in ("이하", "상·이"):
for c in conds:
ups = [r[c][1] for r in hits if table["조건"].get(c) == "범위" and r.get(c)]
if ups and None not in ups: