merge(511-B · 511-C 합치기): origin/sub_laptop_4(511-C 유토 배분 E2 · 판 haul 줄) 받음 — 공유 파일 충돌 풂

- Node 입구 design_calc_node.ts 등록부 밖 id = 시험 길 · 단계 · 화면 길(PAGE_IDS) · haul.view
- calc_runner = PAGE_IDS(cross.refresh) · VIEW_IDS(haul.view) 둘 다 받음
- calc_sites.py 머리 글 = B-4 cross · 511-C haul(기본 server) 함께 · 묶음 13 줄
- 시험 309_2 · 309_2_browser · 511_b1 = 열린 줄에 haul 더함 · 화면 시험 「지금 서버」 = haul 기본 server 로 1 줄(바꾼 뒤 2 줄)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-22 15:55:17 +09:00
co-authored by Claude Opus 5.5
19 changed files with 403 additions and 65 deletions
+7 -2
View File
@@ -6,7 +6,8 @@
입력 꼴 = 입구 머리(`detail` · `route_points` · `context` · `excavation`).
`run_calc_served` = 계산 자리 「서버」 창구(511-A · `B06_Section_Router_Calc`) —
늘 떠 있는 Node 하나(`--serve` · 한 줄 요청 · 한 줄 답) · 죽음 · 묶음 다시 지음 = 다시 띄움 ·
시험 길 `TRIAL_IDS` · 묶음 단계 `STAGE_IDS`(511-B) · 화면 길 `PAGE_IDS`(B-4) 도 받음.
시험 길 `TRIAL_IDS` · 묶음 단계 `STAGE_IDS`(511-B) · 화면 길 `PAGE_IDS`(B-4) ·
유토 배분 화면 꼴 `VIEW_IDS`(511-C) 도 받음.
"""
from __future__ import annotations
@@ -76,6 +77,8 @@ STAGE_IDS = frozenset(
)
# 화면 길(`design_calc_node_cross.ts` `PAGE_IDS` · 511-B B-4) — cross = server 저장 노선 다시 셈
PAGE_IDS = frozenset({"cross.refresh"})
# 유토 배분 화면 꼴(`design_calc_node.ts` `haul.view` · /haul-plan 창구 · 511-C)
VIEW_IDS = frozenset({"haul.view"})
SERVE_TIMEOUT_S = 60
@@ -149,7 +152,9 @@ atexit.register(_SERVED.stop)
def run_calc_served(ids: Sequence[str], inputs: dict[str, Any]) -> dict[str, Any] | None:
"""창구 길 — `{results, ms(Node 셈), wall_ms(파이썬 ↔ Node)}` · `{error}` · 못 돌림 None."""
unknown = [item for item in ids if item not in NODE_IDS | TRIAL_IDS | STAGE_IDS | PAGE_IDS]
unknown = [
item for item in ids if item not in NODE_IDS | TRIAL_IDS | STAGE_IDS | PAGE_IDS | VIEW_IDS
]
if unknown:
raise ValueError(f"서버 계산 id 아님: {', '.join(unknown)}")
t0 = time.perf_counter()
+19 -5
View File
@@ -4,8 +4,10 @@
both = 조작 중 브라우저 셈 + [저장] 서버 정본(지금 등록부 자리) · server = 조작 중에도 서버 길
(G1 · D3 = 504-2 · ③ 토량 · ④ 이월 · ⑧ 고정 브라우저(시험용 · fixed 는 정본 칸 표시) = 511-A 창구 ·
cross = 511-B B-4 묶음 cross 단계 · 저장 노선 다시 셈).
판이 없거나 깨지면 기본값(전부 both = 등록부 그대로). [저장] · [확정] 서버 정본 길은 판을 안 읽음.
묶음 12 줄 = 등록부(`design_calc_registry*.ts`) # 전부 · 같은지 시험 `test_309_2_calc_sites.py`.
판이 없거나 깨지면 기본값(줄 `default` · 없으면 both = 등록부 그대로 · haul = server).
haul(E2 · 511-C · 요구 321) both = 브라우저가 배분 모듈을 그때만 불러 셈 · server = /haul-plan.
[저장] · [확정] 서버 정본 길은 판을 안 읽음.
묶음 13 줄 = 등록부(`design_calc_registry*.ts`) # 전부 · 같은지 시험 `test_309_2_calc_sites.py`.
"""
from __future__ import annotations
@@ -67,12 +69,23 @@ GROUPS: tuple[dict[str, Any], ...] = (
},
# 폼 기본값 도구(B04 · B08 파이썬 · 고를 것 없음)
{"key": "form_default", "nos": ["F9"], "switchable": False, "fixed": "both", "why": None},
# 유토 배분 — 기본 server(지금 /haul-plan 그대로) · both = 브라우저 셈(511-C)
{
"key": "haul",
"nos": ["E2"],
"switchable": True,
"fixed": None,
"why": "haul",
"default": "server",
},
# 서버만 — 줄마다 까닭(`whys` · 511-C)
{
"key": "fixed_server",
"nos": ["E2", "G3", "D1", "D2", "N1"],
"nos": ["G3", "D1", "D2", "N1"],
"switchable": False,
"fixed": "server",
"why": "server",
"whys": {n: f"server_{n}" for n in ("G3", "D1", "D2", "N1")},
},
{
"key": "fixed_browser",
@@ -86,17 +99,18 @@ GROUPS: tuple[dict[str, Any], ...] = (
ORDER = tuple(g["key"] for g in GROUPS if g["switchable"])
SWITCHABLE = frozenset(ORDER)
LOCKED = frozenset(g["key"] for g in GROUPS if not g["switchable"])
DEFAULTS = {g["key"]: g.get("default", "both") for g in GROUPS if g["switchable"]}
def read_sites() -> dict[str, Any]:
"""판 — 없음 · 깨짐 · 모르는 값 = 그 줄 기본값(both)."""
"""판 — 없음 · 깨짐 · 모르는 값 = 그 줄 기본값(`DEFAULTS`)."""
try:
raw = json.loads(PATH.read_text(encoding="utf-8"))
except (OSError, ValueError):
raw = {}
stored = raw.get("sites") if isinstance(raw, dict) else None
stored = stored if isinstance(stored, dict) else {}
sites = {k: stored.get(k) if stored.get(k) in VALUES else "both" for k in ORDER}
sites = {k: stored.get(k) if stored.get(k) in VALUES else DEFAULTS[k] for k in ORDER}
version = raw.get("version") if isinstance(raw, dict) else None
return {"version": version if isinstance(version, int) else 0, "sites": sites}