From e2380ea53830949e0c08927fc67219bbcabdf88b Mon Sep 17 00:00:00 2001 From: umsangdon Date: Wed, 9 Sep 2026 22:19:47 +0900 Subject: [PATCH] =?UTF-8?q?fix(B06):=20=ED=8F=BC=20=E3=80=8C=EA=B8=B0?= =?UTF-8?q?=EC=8A=AD=EB=A7=89=EC=9D=B4=20=EA=B8=B0=EC=B4=88=E3=80=8D?= =?UTF-8?q?=EA=B0=80=20=ED=99=94=EB=A9=B4=20=EC=BA=90=EC=8B=9C=EC=97=90=20?= =?UTF-8?q?=EC=95=88=20=EB=8B=BF=EB=8D=98=20=EC=9E=90=EB=A6=AC=20+=20?= =?UTF-8?q?=ED=8F=BC=20=EC=B9=B8=20=EB=8C=80=EC=A1=B0=20=EC=8B=9C=ED=97=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 계획서 0-5(세트 통짜 배선)는 아직 못 함 — 까닭 ①(관 지점을 B06 이 못 받음)은 풀렸으나 ②(폼 → 조정창 되받기 · 형태별 높이 한계 되돌리기)가 그대로임. 억지로 갈지 않음. 대신 폼 칸 20개를 캐시 경로와 대조해 빠진 칸 셋을 찾음. - `revet_foundation` — 그리기가 읽는 값(터파기 파선)인데 안 옮겨 적고 있었음. 이어 붙임. ⚠ 화면 실측은 못 함 — 상세 단계 칸이라 B06 배치 폼에 아직 안 뜸(정본도 전부 비어 있음). - `inlet_basin_form`·`inlet_basin_material` — 수량 전용이라 캐시에 안 실어도 됨(사유를 시험에 적음). 시험 둘 추가 — 새 폼 칸이 캐시 경로에서 빠지면 잡음. 전체 1207 통과·실패 0. Co-Authored-By: Claude Opus 5 (1M context) --- .../B06_Section_UI_Page_Pipe_Options.ts | 4 ++ resources/tester/test_b06_pipe_form_keys.py | 63 +++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 resources/tester/test_b06_pipe_form_keys.py diff --git a/B06_Section/B06_Section_UI_Page_Pipe_Options.ts b/B06_Section/B06_Section_UI_Page_Pipe_Options.ts index a40eff9c..32312a4e 100644 --- a/B06_Section/B06_Section_UI_Page_Pipe_Options.ts +++ b/B06_Section/B06_Section_UI_Page_Pipe_Options.ts @@ -63,6 +63,10 @@ export function applyPipeOptionsToCache( if (value !== undefined) (target as Record)[field as string] = value; }; put(culvert, "pipe_kind", patch.pipe_kind); + // 기슭막이 기초(기초유/기초버림) — **터파기 파선을 그리는 값**이다(`foundationChoice`). + // 옮겨 적지 않아 폼에서 고쳐도 도면이 다음 조회까지 안 따라왔다(2026-09-09 실측). + // ⚠ 폼 키는 `revet_foundation`, 스펙 자리는 `foundation` 이라 이름이 다르다. + put(culvert, "foundation", patch.revet_foundation); const diameterMm = num("pipe_diameter_mm"); if (diameterMm !== undefined) culvert.diameter_m = pipeDiameterM(diameterMm); // 유입·유출 기슭막이 제원과 집수정 구간값 — 폼 옵션 키를 스펙 자리로 옮긴다. diff --git a/resources/tester/test_b06_pipe_form_keys.py b/resources/tester/test_b06_pipe_form_keys.py new file mode 100644 index 00000000..2314a312 --- /dev/null +++ b/resources/tester/test_b06_pipe_form_keys.py @@ -0,0 +1,63 @@ +"""배수관 폼 칸이 **화면 캐시까지 닿는지** 대조 (2026-09-09). + +⚠ 잡은 자리 — 「기슭막이 기초」(`revet_foundation`)를 폼에서 고쳐도 횡단도 **터파기 파선**이 + 안 따라왔다. 폼 → 캐시 경로(`B06_Section_UI_Page_Pipe_Options.ts`)가 스펙 칸을 **하나씩 + 옮겨 적는 부분 사본**이라, 새 칸을 더할 때 빠지면 값이 조용히 안 닿는다. + +⇒ 세트를 통째로 다시 만드는 배선(계획서 0-5)은 아직 못 한다. 대신 **그리기에 쓰이는 칸**이 + 빠지면 여기서 잡는다. 수량 전용 칸(집수정 형태·재료)은 정본으로 바로 가므로 대상이 아니다. +""" + +from __future__ import annotations + +import json +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[2] + +#: 그리기가 읽는 칸 → 캐시 경로에서 확인할 문자열. +DRAWN_KEYS = { + "revet_foundation": '"foundation", patch.revet_foundation', + "pipe_kind": '"pipe_kind", patch.pipe_kind', + "pipe_diameter_mm": "pipe_diameter_mm", +} + +#: 수량 전용이라 캐시에 안 실어도 되는 칸 — **왜 빠졌는지**를 함께 적는다. +QUANTITY_ONLY = { + "inlet_basin_form": "B08 이 정본(pipe_points)에서 읽는다 — 도면에 안 그린다", + "inlet_basin_material": "위와 같음", + "pipe_count": "련 수는 B05 정본에서 세트를 만들 때 쓴다", +} + + +def _pipe_option_keys() -> list[str]: + payload = json.loads( + (ROOT / "B05_Profile" / "B05_Profile_Structure_Types.json").read_text(encoding="utf-8") + ) + types = payload if isinstance(payload, list) else payload["types"] + pipe = next(item for item in types if item["type_id"] == "pipe") + return [option["key"] for option in pipe["options"]] + + +def test_그리기에_쓰는_칸은_캐시까지_닿는다() -> None: + source = (ROOT / "B06_Section" / "B06_Section_UI_Page_Pipe_Options.ts").read_text( + encoding="utf-8" + ) + for key, needle in DRAWN_KEYS.items(): + assert needle in source, f"{key} 가 폼 → 캐시 경로에서 빠졌다 — 도면이 안 따라간다" + + +def test_폼에_새_칸이_생기면_알린다() -> None: + """칸을 더하고 이 시험을 안 고치면 여기서 걸린다 — 「조용히 안 닿는」 것을 막는 자리.""" + source = (ROOT / "B06_Section" / "B06_Section_UI_Page_Pipe_Options.ts").read_text( + encoding="utf-8" + ) + unknown = [ + key + for key in _pipe_option_keys() + if key not in DRAWN_KEYS + and key not in QUANTITY_ONLY + and key not in source + and not any(key.endswith(tail) for tail in ("_m", "_type", "_form")) + ] + assert not unknown, f"새 폼 칸이 캐시 경로에 안 실렸다: {unknown} — 실을지 여부를 적을 것"