From 56146d5f4a46d1e112636d2772327a6dec0f6f28 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Wed, 18 Nov 2026 08:20:38 +0900 Subject: [PATCH] =?UTF-8?q?refactor(855-F=20B9-6):=20=ED=94=84=EB=A1=9C?= =?UTF-8?q?=EC=A0=9D=ED=8A=B8=20=EC=82=AC=EB=B3=B8=EC=97=90=EC=84=9C=20M01?= =?UTF-8?q?=20=EB=A1=9C=EC=A7=81=20=EC=A4=84=20=EA=B1=B7=EC=9D=8C=20?= =?UTF-8?q?=E2=80=94=20=EB=8B=A8=EA=B0=80.json=20=EB=A1=9C=EC=A7=81=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=20=C2=B7=20=EC=9D=BC=EC=9C=84=EB=8C=80?= =?UTF-8?q?=EA=B0=80.json=20=EB=A1=9C=EC=A7=81=20=EC=82=AC=EB=B3=B8=200=20?= =?UTF-8?q?=C2=B7=20=EC=85=88=20=3D=20=EC=88=98=EC=8B=9D.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 앞 커밋 296ec60ee(auto · 앞 세션 결제 오류로 멈춘 미커밋을 싱크가 올림)의 설명 + 그 뒤 시험 고침. - M02_Item_Source: logic_rows 가 로직 줄 안 실음(빠진로직 = M01 수식 문서에 없는 키) · formula_docs(사본 수식 문서 닫힌 묶음) · price_bundle = 새 M02_Item_Bundle.collect(문서 변수 연결을 훑어 자원 · 표 줄만 · 로직 줄 없음) · build_source 가 수식.json 붙임 - M02_Item_Bundle(새): 문서 연결 훑기 모음 · 셈 색인 Index(문서 이름표 + docs) · load - M02_Doc_B09.build = formula_docs(단가 묶음 안 읽음 · logic_keys 걷음) · M02_Doc_Copy.doc_of = 색인이 실어 온 사본 문서 먼저 - M02_Item_Snapshot.source_files 원본판에 수식.json 듦 · Item_Prices.calc 색인 = 묶음 + 문서 - B08 Router_Material · B09 Sangeun · Labor_Source · Linked · Doc_Run · Bill_Library(서고 사본 수식 · 원본판 = 일위대가 + 수식 문서) = 같은 색인 - B09 Daega_Personal 단가산출 [내 자료집] = 수식 문서 꼴(옛 칸 덮개 · 원본 · 정체 안 씀 · 고침 = 수식 길 저장) - 시험: 사본 셈 견본이 수식.json 을 같이 넘김(실제 Item_Copy.calc 길) — test_719_1 셋 · 848_1 · 848_10 · 795_4 · 145_1 · 145_2 · 719_2 · 802_4a · 841_1 · item_copy_complete · m02_item_labor · structures_summary_snapshot · 855_b09_golden - 세기(골든 견본 사본 8): 단가.json 로직 파일 22 → 0 · 로직 줄 28 → 0 · 일위대가.json 로직 사본 4 → 0 - 검증: 관련 + 핵심 + 143 + 855_2d_frozen 898 중 실패 = 703(같은 내용 지문 4 ↔ 4.0 · 고치기 전 코드도 같음) · 713_1 · 804_7(M01 cce57c298 몫) 뿐 · 실제 B09 프로젝트 답 해시 같음 · 빌더 --check 같음 · typecheck 0 Co-Authored-By: Claude Opus 5.5 --- resources/tester/test_719_1_sk_freeze.py | 17 +++++++++++++---- resources/tester/test_848_10_upper_down.py | 3 ++- resources/tester/test_848_1_cover_layers.py | 7 +++++-- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/resources/tester/test_719_1_sk_freeze.py b/resources/tester/test_719_1_sk_freeze.py index e3d98145f..a26c78b29 100644 --- a/resources/tester/test_719_1_sk_freeze.py +++ b/resources/tester/test_719_1_sk_freeze.py @@ -86,9 +86,10 @@ def test_구조물_사본_수식_사본_값_같음_원본_지우고_고쳐도(wo assert not [r for r in _rows(bundle) if str(r.get("키")).startswith("GX9")] json.dumps(rows["참조사본"], ensure_ascii=False) # 사본 파일로 쓸 수 있는 꼴(Decimal 없음) saved = json.loads(json.dumps(bundle, ensure_ascii=False)) + formula = {"문서": source.formula_docs(rows)} # 사본 수식.json(855-F B9-6 · 로직 몫) edit(world["personal"], key, 3) # M02 에서 다시 고침 → 사본 그대로 (world["personal"] / "sangeun" / f"{key}.json").unlink() # 원본이 사라져도 사본만 봄 - got = prices.calc(rows, saved, {}, {}, None) + got = prices.calc(rows, saved, {}, {}, None, formula) line = got["줄"][0] assert not line["까닭"] for part in ("노무비", "재료비", "경비", "계"): @@ -104,7 +105,10 @@ def test_재생성은_M02_새_값(world): _, live = _top(ref) again = source.labor_doc_rows(doc) bundle = source.price_bundle(again, world["personal"]) - got = prices.calc(again, json.loads(json.dumps(bundle, ensure_ascii=False)), {}, {}, None) + formula = {"문서": source.formula_docs(again)} + got = prices.calc( + again, json.loads(json.dumps(bundle, ensure_ascii=False)), {}, {}, None, formula + ) assert got["줄"][0]["기준"]["계"] == pytest.approx(live["기준"]["계"], rel=1e-9) rid = refs.ref_id(ref["ref"]) assert first["참조사본"][rid]["수식"]["문서"] != again["참조사본"][rid]["수식"]["문서"] @@ -131,11 +135,16 @@ def test_B09_서고_사본_값_같음_원본판(world, tmp_path): assert made["만듦"] and _print(world["personal"]) == before folder = library.library_dir(root) / made["폴더"] read = {p.name: json.loads(p.read_text(encoding="utf-8")) for p in folder.glob("*.json")} - bare = prices.calc(read[source.LABOR_FILE], read[source.PRICE_FILE], {}, {}, None)["줄"][0] + labor_file, price_file, formula = ( + read[source.LABOR_FILE], + read[source.PRICE_FILE], + read["수식.json"], + ) + bare = prices.calc(labor_file, price_file, {}, {}, None, formula)["줄"][0] assert bare["기준"]["계"] == pytest.approx( live["기준"]["계"], rel=1e-9 ) # 이은 값 없음 = 저장 2 - got = prices.calc(read[source.LABOR_FILE], read[source.PRICE_FILE], {}, {}, area)["줄"][0] + got = prices.calc(labor_file, price_file, {}, {}, area, formula)["줄"][0] assert not got["까닭"] and not live["까닭"] assert got["기준"]["계"] == pytest.approx(live["기준"]["계"], rel=1e-9) mark = read["manifest.json"]["원본판"] diff --git a/resources/tester/test_848_10_upper_down.py b/resources/tester/test_848_10_upper_down.py index b5f726ef9..99686b011 100644 --- a/resources/tester/test_848_10_upper_down.py +++ b/resources/tester/test_848_10_upper_down.py @@ -177,7 +177,8 @@ def _freeze(me, key): {"이름": "t", "단위": "m", "담은로직": [{"참조": ref, "수량": {"손": 1}}]} ) bundle = source.price_bundle(rows, me) - return lambda: float(item_prices.calc(rows, bundle, {}, {})["반영합"]["계"]) + formula = {"문서": source.formula_docs(rows)} # 사본 수식.json(855-F B9-6) + return lambda: float(item_prices.calc(rows, bundle, {}, {}, None, formula)["반영합"]["계"]) def test_프로젝트_사본(world, docs_tmp): diff --git a/resources/tester/test_848_1_cover_layers.py b/resources/tester/test_848_1_cover_layers.py index dd2b6ceca..e670bd317 100644 --- a/resources/tester/test_848_1_cover_layers.py +++ b/resources/tester/test_848_1_cover_layers.py @@ -318,14 +318,17 @@ def test_SK_위덮음_내고침_되돌림_옵션_굳힘(docs_tmp, world): {"이름": "t", "단위": "m", "담은로직": [{"참조": ref, "수량": {"손": 1}}]} ) bundle = source.price_bundle(rows, me) + formula = {"문서": source.formula_docs(rows)} # 사본 수식.json(855-F B9-6) frozen = rows["참조사본"][refs.ref_id(ref)]["수식"] assert _norm(frozen[mcv.UPPER]) == _norm(upper) - was = float(item_prices.calc(rows, bundle, {}, {})["반영합"]["계"]) + was = float(item_prices.calc(rows, bundle, {}, {}, None, formula)["반영합"]["계"]) assert was == float(after["셈"]["계"]) _save_m01(_upper(d, D(2))) # 기초 고침이 바뀜 now = _at(me, path.read, key) assert float(now["셈"]["계"]) != was # 프로젝트 밖 = 지금 기초 것 - assert float(item_prices.calc(rows, bundle, {}, {})["반영합"]["계"]) == was # 사본 = 굳은 것 + assert ( + float(item_prices.calc(rows, bundle, {}, {}, None, formula)["반영합"]["계"]) == was + ) # 사본 = 굳은 것 _save_m01(upper) # ㉢ ② 를 위 층 값으로 = ② 0 now = _at(me, path.read, key)