From 99fa98a0ddea88594eb620054e2ba58ebe4a94f9 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Fri, 4 Sep 2026 18:43:49 +0900 Subject: [PATCH] =?UTF-8?q?feat(B05):=20=EC=B4=88=EA=B8=B0=ED=99=94=20?= =?UTF-8?q?=EB=B2=94=EC=9C=84=20=ED=99=95=EB=8C=80=20=E2=80=94=20=EB=B0=B0?= =?UTF-8?q?=EC=88=98=EC=9C=A0=EC=97=AD=20=EC=82=B0=EC=B6=9C=EB=AC=BC?= =?UTF-8?q?=EA=B9=8C=EC=A7=80=20=EC=B4=88=EA=B8=B0=EA=B0=92=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EC=B4=AC=EC=98=81=C2=B7=EB=B3=B5=EC=9B=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 스냅샷 대상이 B04_PreProcess/drainage/edits 에서 drainage 폴더 통째로 넓어짐 (00_watershed_response ~ 04_detailed_basins 포함). 관을 옮겨 다시 나뉜 세부유역이 초기화로 되돌아가지 않던 구멍을 막음 - 용량 실측: 배수유역 8.6MB, 스냅샷 전체 3.9MB → 약 12MB - 옛 스냅샷(edits 만 촬영) 호환 — 그 경우 예전처럼 관 지점 편집분만 복원 - 3D 코리도는 제외 — 스냅샷 시점(체인 직후)에 아직 없는 값이라 별도 판단 필요 Co-Authored-By: Claude Opus 5 (1M context) --- common_util/common_util_initial_snapshot.py | 23 ++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/common_util/common_util_initial_snapshot.py b/common_util/common_util_initial_snapshot.py index 90eadb9c..9b68e25c 100644 --- a/common_util/common_util_initial_snapshot.py +++ b/common_util/common_util_initial_snapshot.py @@ -30,13 +30,21 @@ DESIGNING_LOCK_NAME = "initial_design.lock" DESIGN_FAILED_NAME = "initial_design.failed" # 프로젝트 루트 기준 상대 경로 — 정본 파일이 사는 자리 전부. +# +# 배수유역은 `edits/`(관 지점 편집분)만 뜨다가 **폴더 통째**로 넓혔다(2026-09-04 사용자 +# 확정: 「초기값 = 파일 입력 직후 결과 전부」). 관을 옮기면 세부유역(`04_detailed_basins`)이 +# 다시 나뉘는데 그 산출물이 스냅샷 밖이라 [초기화]가 옛 유역도를 그대로 남겼다. +# 용량은 실측 8.6MB(스냅샷 전체 3.9MB → 약 12MB)로 감당할 만하다. _FILE_TREES = ( "B05_Profile/route", "B06_Section/longitudinal", "B06_Section/cross_sections", - "B04_PreProcess/drainage/edits", + "B04_PreProcess/drainage", ) +# 배수유역을 폴더 통째로 넓히기 전(2026-09-04)에 찍힌 스냅샷이 갖고 있는 자리. +_LEGACY_DRAINAGE_TREE = "B04_PreProcess__drainage__edits" + # `routes.id`를 참조하는 표는 스키마상 이 넷이 전부다(001_create_schema.sql:539~556). _CHILD_TABLES = ("route_points", "route_statistics", "longitudinal_sections", "cross_sections") @@ -238,11 +246,20 @@ def wipe_edited_masters(project_root: Path) -> list[str]: def restore_snapshot_files(project_root: Path) -> None: - """스냅샷 파일을 작업본 자리에 되돌린다. 스냅샷에 없던 트리는 비워 둔다.""" + """스냅샷 파일을 작업본 자리에 되돌린다. 스냅샷에 없던 트리는 비워 둔다. + + 배수유역 범위를 넓히기 전(2026-09-04)에 찍힌 스냅샷은 `edits/`만 갖고 있다 — + 그런 프로젝트는 예전처럼 그 자리만 되돌린다. 넓힌 트리를 못 찾았다고 그냥 넘어가면 + 관 지점 편집분이 초기화 뒤에도 남는다. + """ root = Path(project_root) source = snapshot_dir(root) for tree in _FILE_TREES: - _copy_tree(source / tree.replace("/", "__"), root / tree) + stored = source / tree.replace("/", "__") + if not stored.is_dir() and tree == "B04_PreProcess/drainage": + _copy_tree(source / _LEGACY_DRAINAGE_TREE, root / "B04_PreProcess/drainage/edits") + continue + _copy_tree(stored, root / tree) async def restore_initial_snapshot(