From 919cd68ba545c8ce59b3ecf19471283ff5e7df7b Mon Sep 17 00:00:00 2001 From: umsangdon Date: Mon, 19 Oct 2026 09:50:34 +0900 Subject: [PATCH] =?UTF-8?q?refactor(472-4=20=E2=91=A0=20X6=20=EB=84=98?= =?UTF-8?q?=EA=B8=B0=EB=8A=94=20=EC=B9=B8=20=ED=95=9C=20=EB=B2=8C):=20?= =?UTF-8?q?=EC=98=AE=EA=B8=B4=20=EC=B8=A1=EC=A0=90=20=C2=B7=20=EB=85=B8?= =?UTF-8?q?=EC=84=A0=20=EB=B0=94=EB=80=9C=20=ED=9A=A1=EB=8B=A8=20=EC=9E=85?= =?UTF-8?q?=EB=A0=A5=20=EB=AA=A9=EB=A1=9D=20=EC=A0=95=EB=B3=B8=20=3D=20TS?= =?UTF-8?q?=20ROW=5FCARRY=5FKEYS=20=ED=95=98=EB=82=98=20=C2=B7=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=B4=EC=8D=AC=EC=9D=80=20=EA=B7=B8=20=EA=B8=80=EC=9D=84=20?= =?UTF-8?q?=EC=9D=BD=EC=9D=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - B06_Section_Router_Design.CARRY_INPUT_KEYS = Station_Swap.ts 의 ROW_CARRY_KEYS 선언을 읽음(손 목록 걷음) - 공유 JSON 은 안 씀 — 이 TS 를 끄는 헬퍼 로더(측점 가게 · 묶음 단계)가 JSON 가져오기를 못 풀어 넓게 깨짐 - 시험 test_472_station_user_fields X6(파이썬 목록 글 없음 · 같은 일곱) · Router_Design · Station_Swap 관련 298 통과 Co-Authored-By: Claude Opus 5.5 --- B06_Section/B06_Section_Router_Design.py | 20 +++++++++++-------- B06_Section/logic/B06_Section_Station_Swap.ts | 3 ++- .../tester/test_472_station_user_fields.py | 6 +++++- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/B06_Section/B06_Section_Router_Design.py b/B06_Section/B06_Section_Router_Design.py index e6b84416b..08b3d819b 100644 --- a/B06_Section/B06_Section_Router_Design.py +++ b/B06_Section/B06_Section_Router_Design.py @@ -4,6 +4,7 @@ """ import json +import re from pathlib import Path from typing import Any @@ -112,14 +113,17 @@ STRUCTURE_ADJUST_KEYS = ( # 노선 [확인] 체인이 옛 노선에서 누가거리로 넘기는 **사용자 입력**(PLAN 74-3) — 계획고 · 면적 · # design_line · road_edges 같은 결과 칸과 단면 유형 · 측구 방향(새 노선 지형이 정함) · 구조물 # 조작값은 넘기지 않는다. 받는 쪽은 `compute_default_designs(carried=…)`. -CARRY_INPUT_KEYS = ( - "ground_type", - "ditch_type", - "ditch_choice", - "two_stage_slope", - "rock_boundary_offset_m", - "cut_slope_ratio_user", - "berm", +# 칸 목록 정본 = TS `ROW_CARRY_KEYS`(logic/B06_Section_Station_Swap.ts) — 그 글을 읽음(472-4 ① X6). +_SWAP_TS = Path(__file__).resolve().parent / "logic" / "B06_Section_Station_Swap.ts" +CARRY_INPUT_KEYS: tuple[str, ...] = tuple( + re.findall( + r'"([a-z_0-9]+)"', + re.search( + r"export const ROW_CARRY_KEYS = \[(.*?)\] as const;", + _SWAP_TS.read_text(encoding="utf-8"), + re.S, + ).group(1), + ) ) diff --git a/B06_Section/logic/B06_Section_Station_Swap.ts b/B06_Section/logic/B06_Section_Station_Swap.ts index 0c87930ba..897bbc320 100644 --- a/B06_Section/logic/B06_Section_Station_Swap.ts +++ b/B06_Section/logic/B06_Section_Station_Swap.ts @@ -78,7 +78,8 @@ const FACILITY_RESEED_M = 0.5; /** 다시 셈 입력 중 새 지형이 정하는 칸 — 옮긴 시설 측점은 버림(단면 유형은 기본 설계 · 서버 `CARRY_INPUT_KEYS` 밖). */ const AUTO_INPUT_KEYS = ["ditch_side", "ditch_enabled"]; /** - * 옮긴 측점이 들고 가는 사용자 입력(445 H2) — 서버 `CARRY_INPUT_KEYS` 짝(노선 [확인] 이월과 같은 칸). + * 옮긴 측점이 들고 가는 사용자 입력(445 H2) — 목록 정본 = 여기 하나 · 서버 `CARRY_INPUT_KEYS` 가 이 글을 읽음 + * (노선 [확인] 이월과 같은 칸 · 472-4 ① X6 · 선언 꼴 그대로 둠 — 따옴표 글 목록 + `as const`). * 서버에 그 자리 행이 없으면(옮김 · 새 측점) [저장] patch 가 캐시 설계의 이 칸을 실음. */ export const ROW_CARRY_KEYS = [ diff --git a/resources/tester/test_472_station_user_fields.py b/resources/tester/test_472_station_user_fields.py index 49f9843b1..3138287b6 100644 --- a/resources/tester/test_472_station_user_fields.py +++ b/resources/tester/test_472_station_user_fields.py @@ -6,7 +6,7 @@ `pavement_*`(포장 제안 표기)가 사라짐(검증_sub8 측점 351). 고침 — 같은 자리(누가거리) 옛 줄에서 `STATION_CARRY_KEYS` 를 들고 감 · 사용자 상단측은 새 자동값을 이김 · 옛 줄 없는 새 자리는 포장 표기를 지금 계획선으로 셈. -X6 — 옮긴 측점이 들고 가는 횡단 입력 TS `ROW_CARRY_KEYS` = 파이썬 `CARRY_INPUT_KEYS`(거울). +X6 — 옮긴 측점 횡단 입력 = TS `ROW_CARRY_KEYS` 하나 · 파이썬 `CARRY_INPUT_KEYS` 는 그 글을 읽음. ./venv/Scripts/python.exe -m pytest resources/tester/test_472_station_user_fields.py -q """ @@ -124,7 +124,11 @@ def test_새_자리는_포장_표기를_지금_계획선으로(tmp_path) -> None def test_X6_옮긴_측점_횡단_입력_TS_파이썬_한_벌() -> None: + """목록 정본 = TS `ROW_CARRY_KEYS` 하나 · 파이썬은 그 글을 읽음(손으로 맞춘 목록 둘 없음).""" source = (ROOT / "B06_Section/logic/B06_Section_Station_Swap.ts").read_text(encoding="utf-8") body = re.search(r"export const ROW_CARRY_KEYS = \[(.*?)\] as const;", source, re.S) assert body is not None assert tuple(re.findall(r'"([a-z_0-9]+)"', body.group(1))) == CARRY_INPUT_KEYS + assert len(CARRY_INPUT_KEYS) == 7 and "berm" in CARRY_INPUT_KEYS + design = (ROOT / "B06_Section/B06_Section_Router_Design.py").read_text(encoding="utf-8") + assert "CARRY_INPUT_KEYS = (" not in design # 파이썬에 목록 글 없음