From 0d56e727cbb74d7cdf1a9608500da6cb5ccd9cb5 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Thu, 17 Sep 2026 12:58:44 +0900 Subject: [PATCH] =?UTF-8?q?fix(b08):=20=EA=B1=B4=EC=84=A4=20=EC=82=B0?= =?UTF-8?q?=EC=B6=9C=20=EC=9D=B4=EB=A6=84=EC=9D=84=20const=5F=20=EC=95=9E?= =?UTF-8?q?=EA=BC=AC=EB=A6=AC=EB=A1=9C=20=E2=80=94=20=EB=92=A4=EA=BC=AC?= =?UTF-8?q?=EB=A6=AC(work=5Fitem=5Fmaster=5Fconst=5F=E2=80=A6)=EB=A9=B4=20?= =?UTF-8?q?work=5Fitem=5Fmaster=5F*=20=EB=A1=9C=20=EB=81=9D=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=EC=9D=84=20=EA=B3=A0=EB=A5=B4=EB=8A=94=20B08=20?= =?UTF-8?q?=EB=B0=91=EC=88=98=20=EB=8C=80=EC=A1=B0=EA=B0=80=20=EA=B1=B4?= =?UTF-8?q?=EC=84=A4=EC=9D=84=20=EC=A7=91=EC=96=B4=20=EB=8C=80=EC=A1=B0?= =?UTF-8?q?=EA=B0=80=20=ED=86=B5=EC=A7=B8=EB=A1=9C=20=EB=B9=A0=EC=A1=8C?= =?UTF-8?q?=EC=9D=8C(=EC=A0=84=EC=B2=B4=20=EC=8B=9C=ED=97=98=20=EB=B9=A8?= =?UTF-8?q?=EA=B0=95=202)=20=C2=B7=20=EA=B3=A0=EB=A5=B4=EB=8A=94=20?= =?UTF-8?q?=EC=AA=BD=EC=9D=B4=20=EC=82=B0=EB=A6=BC=EC=9D=84=20=EC=A7=91?= =?UTF-8?q?=EB=8A=94=EC=A7=80=20=EC=8B=9C=ED=97=98=20=ED=95=98=EB=82=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01BW6Jdsh18WPtYUR6THZJqn --- B08_Quantity/B08_Quantity_Build_WorkItemMaster.py | 6 +++--- .../B08_Quantity_Build_WorkItemMaster_Const.py | 2 +- Z01_MasterData/Z01_MasterData_WorkItems.py | 2 +- resources/data_work_item_master/_manifest.json | 4 ++-- resources/data_work_item_master/_manifest_const.json | 12 ++++++------ ...1-01.json => const_basis_missing_2026-01-01.json} | 0 ....json => const_form_undetermined_2026-01-01.json} | 0 ...1.json => const_work_item_master_2026-01-01.json} | 4 ++-- .../work_item_master_2026-01-01.json | 2 +- resources/tester/test_work_item_master_const.py | 11 ++++++++++- resources/tester/test_z01_work_items.py | 2 +- 11 files changed, 27 insertions(+), 18 deletions(-) rename resources/data_work_item_master/{basis_missing_const_2026-01-01.json => const_basis_missing_2026-01-01.json} (100%) rename resources/data_work_item_master/{form_undetermined_const_2026-01-01.json => const_form_undetermined_2026-01-01.json} (100%) rename resources/data_work_item_master/{work_item_master_const_2026-01-01.json => const_work_item_master_2026-01-01.json} (99%) diff --git a/B08_Quantity/B08_Quantity_Build_WorkItemMaster.py b/B08_Quantity/B08_Quantity_Build_WorkItemMaster.py index f3eefe3c..66810925 100644 --- a/B08_Quantity/B08_Quantity_Build_WorkItemMaster.py +++ b/B08_Quantity/B08_Quantity_Build_WorkItemMaster.py @@ -357,9 +357,9 @@ def write_outputs(result: tuple, registry_path: Path, tag: str) -> None: save_registry(registry_path, registry) date = master["effective_date"] - master_path = OUT_DIR / f"work_item_master_{tag}{date}.json" - undet_path = OUT_DIR / f"form_undetermined_{tag}{date}.json" - basis_path = OUT_DIR / f"basis_missing_{tag}{date}.json" + master_path = OUT_DIR / f"{tag}work_item_master_{date}.json" + undet_path = OUT_DIR / f"{tag}form_undetermined_{date}.json" + basis_path = OUT_DIR / f"{tag}basis_missing_{date}.json" master_path.write_text(json.dumps(master, ensure_ascii=False, indent=1), encoding="utf-8") undet_path.write_text( diff --git a/B08_Quantity/B08_Quantity_Build_WorkItemMaster_Const.py b/B08_Quantity/B08_Quantity_Build_WorkItemMaster_Const.py index aaf74ca6..a07709df 100644 --- a/B08_Quantity/B08_Quantity_Build_WorkItemMaster_Const.py +++ b/B08_Quantity/B08_Quantity_Build_WorkItemMaster_Const.py @@ -32,7 +32,7 @@ KEY_PREFIX = "CW" # Construction Work item BOOK_NAME = "2026년_건설공사_표준품셈.md" CODE_PREFIX = "CP" # Construction Pumsem — 목차 코드 DATASET_ID = "work_item_master_const" -FILE_TAG = "const" # 산출 파일 이름 꼬리 — 산림 파일과 안 부딪힘 +FILE_TAG = "const" # 산출 파일 이름 **앞**에 붙임 — ⚠ 뒤에 붙이면 `work_item_master_*` 로 산림을 고르는 쪽(B08 밑수 대조 · B09 근거표)이 건설을 집음 DIVISIONS = ("공통부문", "토목부문", "건축부문", "기계설비부문", "유지관리부문") _LEADER = re.compile(r"·{2,}") diff --git a/Z01_MasterData/Z01_MasterData_WorkItems.py b/Z01_MasterData/Z01_MasterData_WorkItems.py index 9a9d1f9e..5eb029f5 100644 --- a/Z01_MasterData/Z01_MasterData_WorkItems.py +++ b/Z01_MasterData/Z01_MasterData_WorkItems.py @@ -38,7 +38,7 @@ def _read(path: str, _mtime_ns: int) -> dict[str, Any]: def doc(kind: str) -> tuple[dict[str, Any], str] | None: """그 품셈의 공종 축 끝 판(문서 · 파일 이름) — 없으면 None(건설은 아직 없음).""" found = [] - for path in sorted(FOLDER.glob("work_item_master_*.json")): + for path in sorted(FOLDER.glob("*work_item_master_*.json")): # 건설은 `const_` 앞꼬리 d = _read(str(path), path.stat().st_mtime_ns) if (d.get("dataset_version") or {}).get("dataset_id") == SOURCE_OF[kind]: found.append((d, path.name)) diff --git a/resources/data_work_item_master/_manifest.json b/resources/data_work_item_master/_manifest.json index 0c4005ab..71fc2608 100644 --- a/resources/data_work_item_master/_manifest.json +++ b/resources/data_work_item_master/_manifest.json @@ -1,7 +1,7 @@ { "schema_version": "1.0", "dataset_id": "data_work_item_master_manifest", - "generated_at": "2026-09-17T12:34:57+09:00", + "generated_at": "2026-09-17T12:57:59+09:00", "built_by": "B08_Quantity/B08_Quantity_Build_WorkItemMaster.py", "source": { "dataset_id": "pum_forest", @@ -12,7 +12,7 @@ "files": [ { "file": "work_item_master_2026-01-01.json", - "sha256": "9c8da999439a186f17467832fe898d16e2f88172a2b9a2916728cbb350540259", + "sha256": "af00d1436125a45b2f9ad72d5d3937d47f1698ce1262fea2b4bdd957977ec1c7", "size_bytes": 956887 }, { diff --git a/resources/data_work_item_master/_manifest_const.json b/resources/data_work_item_master/_manifest_const.json index 224092a0..999f981b 100644 --- a/resources/data_work_item_master/_manifest_const.json +++ b/resources/data_work_item_master/_manifest_const.json @@ -1,7 +1,7 @@ { "schema_version": "1.0", "dataset_id": "data_work_item_master_manifest", - "generated_at": "2026-09-17T12:34:57+09:00", + "generated_at": "2026-09-17T12:57:59+09:00", "built_by": "B08_Quantity/B08_Quantity_Build_WorkItemMaster.py", "source": { "dataset_id": "pum_const", @@ -11,17 +11,17 @@ }, "files": [ { - "file": "work_item_master_const_2026-01-01.json", - "sha256": "e38814f0ea1e542a44097ff7f706dccec62faa737aa67dea6686ee4395820564", - "size_bytes": 3752147 + "file": "const_work_item_master_2026-01-01.json", + "sha256": "b1574590d7d6206f48e1bcca5fcc4b5bdebbb07ecaaf376c700a75e7794c1faa", + "size_bytes": 3752144 }, { - "file": "form_undetermined_const_2026-01-01.json", + "file": "const_form_undetermined_2026-01-01.json", "sha256": "dbb4f245cb9aee71325ab73c1325ee5f06ff19e0e7527de2053d08a7eb16282e", "size_bytes": 486761 }, { - "file": "basis_missing_const_2026-01-01.json", + "file": "const_basis_missing_2026-01-01.json", "sha256": "0ae14342e37ba5f394c36cc4dd8cea1b505b13d6520e0a12979c21676d6ffcdb", "size_bytes": 74228 } diff --git a/resources/data_work_item_master/basis_missing_const_2026-01-01.json b/resources/data_work_item_master/const_basis_missing_2026-01-01.json similarity index 100% rename from resources/data_work_item_master/basis_missing_const_2026-01-01.json rename to resources/data_work_item_master/const_basis_missing_2026-01-01.json diff --git a/resources/data_work_item_master/form_undetermined_const_2026-01-01.json b/resources/data_work_item_master/const_form_undetermined_2026-01-01.json similarity index 100% rename from resources/data_work_item_master/form_undetermined_const_2026-01-01.json rename to resources/data_work_item_master/const_form_undetermined_2026-01-01.json diff --git a/resources/data_work_item_master/work_item_master_const_2026-01-01.json b/resources/data_work_item_master/const_work_item_master_2026-01-01.json similarity index 99% rename from resources/data_work_item_master/work_item_master_const_2026-01-01.json rename to resources/data_work_item_master/const_work_item_master_2026-01-01.json index 5ff3ae59..d40ddc9e 100644 --- a/resources/data_work_item_master/work_item_master_const_2026-01-01.json +++ b/resources/data_work_item_master/const_work_item_master_2026-01-01.json @@ -4,7 +4,7 @@ "effective_date": "2026-01-01", "pum_edition": "2026-01-01", "toc_edition": "2026-01-01", - "generated_at": "2026-09-17T12:34:57+09:00", + "generated_at": "2026-09-17T12:57:59+09:00", "dataset_version": { "dataset_id": "pum_const", "effective_date": "2026-01-01", @@ -44,7 +44,7 @@ "empty": 100, "work_item": 997 }, - "keys_newly_issued": 1367, + "keys_newly_issued": 0, "toc_duplicate_rows": 0, "toc_corrections": 0 }, diff --git a/resources/data_work_item_master/work_item_master_2026-01-01.json b/resources/data_work_item_master/work_item_master_2026-01-01.json index 44def7eb..6172e7a1 100644 --- a/resources/data_work_item_master/work_item_master_2026-01-01.json +++ b/resources/data_work_item_master/work_item_master_2026-01-01.json @@ -4,7 +4,7 @@ "effective_date": "2026-01-01", "pum_edition": "2026-01-01", "toc_edition": "산림청고시제2025-82호", - "generated_at": "2026-09-17T12:34:57+09:00", + "generated_at": "2026-09-17T12:57:59+09:00", "dataset_version": { "dataset_id": "pum_forest", "effective_date": "2026-01-01", diff --git a/resources/tester/test_work_item_master_const.py b/resources/tester/test_work_item_master_const.py index 54445946..9922d478 100644 --- a/resources/tester/test_work_item_master_const.py +++ b/resources/tester/test_work_item_master_const.py @@ -20,7 +20,7 @@ from B08_Quantity import B08_Quantity_Build_WorkItemMaster as forest from B08_Quantity import B08_Quantity_Build_WorkItemMaster_Const as const OUT = forest.OUT_DIR -CONST_MASTER = OUT / "work_item_master_const_2026-01-01.json" +CONST_MASTER = OUT / "const_work_item_master_2026-01-01.json" @pytest.fixture(scope="module") @@ -140,3 +140,12 @@ def test_산림_산출도_그대로_금액_불변() -> None: "items" ] assert json.loads(json.dumps(fresh, ensure_ascii=False)) == saved_items + + +def test_산림을_고르는_쪽이_건설_파일을_안_집음() -> None: + """⚠ `work_item_master_*` 로 끝 파일을 고르는 자리가 있음(B08 밑수 대조 · B09 근거표) — + 건설 산출을 `work_item_master_const_…` 로 두면 그쪽이 건설을 집어 밑수 대조가 통째로 빠졌음(2026-09-17).""" + from B08_Quantity.B08_Quantity_Engine_BasisUnit import load_master + + assert load_master()["dataset_id"] == "work_item_master_forest" + assert not list(OUT.glob("work_item_master_*const*.json")) diff --git a/resources/tester/test_z01_work_items.py b/resources/tester/test_z01_work_items.py index e1d1a3ce..b7a1698e 100644 --- a/resources/tester/test_z01_work_items.py +++ b/resources/tester/test_z01_work_items.py @@ -94,7 +94,7 @@ def test_불변_열쇠가_오면_id_로_씀_자료_파일은_판_id_로_가림( "variant_keys": ["갑", "을"]}, ], } # fmt: skip - (folder / "work_item_master_const_2026-01-01.json").write_text( + (folder / "const_work_item_master_2026-01-01.json").write_text( json.dumps(fake, ensure_ascii=False), encoding="utf-8" ) monkeypatch.setattr(work_items, "FOLDER", folder)