From 12c8d14ee1ed8bd0453a0a870981fd3effa8f416 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Tue, 8 Sep 2026 23:03:50 +0900 Subject: [PATCH] =?UTF-8?q?fix(B06):=20=E3=80=8C=EC=9E=94=ED=86=A0?= =?UTF-8?q?=EB=A5=BC=20=EB=8D=94=ED=95=98=EA=B3=A0=20=E2=86=92=20=EA=B3=B5?= =?UTF-8?q?=EC=A0=9C=EB=A5=BC=20=EB=BA=80=EB=8B=A4=E3=80=8D=20=EC=88=9C?= =?UTF-8?q?=EC=84=9C=EB=A1=9C=20=EB=AA=BB=20=EB=B0=95=EC=9D=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 두 창 저장분에서 **공제가 한 톨도 안 빠졌다**(`deducted 0`). 두 노선 다 원래 사토가 0 (전 구간 토취)이라, 공제가 잔토 가산보다 **먼저** 돌아 뺄 대상이 없었다. - 유토곡선의 사토는 「현장에 남는 흙 총량」이고 출처를 안 가린다 — 공제는 그 총량에서 빼는 것이라 **잔토가 담긴 뒤라야** 뺄 대상이 있다. - ⚠ 모자라면 `collected_stone_deducted_m3` 가 작게 나와 「덜 뺐다」가 값으로 드러난다 — 그 장치는 그대로 살려 뒀다. - ⚠ 토취는 계속 안 건드린다. 「채집석을 캐 가면 성토에 쓸 흙이 줄어 토취가 는다」는 갈래가 있으나 근거가 없다 — 그 여지를 주석에 적어 뒀다. 시험 7건(순서 시험 추가: 잔토 100 더한 뒤 공제 40 이 실제로 빠짐). Co-Authored-By: Claude Opus 5 (1M context) --- common_util/common_util_mass_haul_balance.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/common_util/common_util_mass_haul_balance.ts b/common_util/common_util_mass_haul_balance.ts index 81c9b6bb..36cb6f3d 100644 --- a/common_util/common_util_mass_haul_balance.ts +++ b/common_util/common_util_mass_haul_balance.ts @@ -341,6 +341,9 @@ function bandOutline( * ⚠ 순서가 중요하다 — 캔 돌은 **실어 낼 흙 속에 있던 것**이다. 자연방토(운반비를 안 세는 몫) * 에서 먼저 깎으면 **줄어야 할 운반비가 안 줄어든다.** * ⚠ 잔량 하나하나(`residuals`)를 줄인다 — 총량만 줄이면 사토 balloon·운반거리가 안 따라간다. + * ⚠ **토취는 안 건드린다.** 「채집석을 캐 가면 성토에 쓸 흙이 줄어 토취가 는다」는 갈래가 + * 있으나 **근거가 없다** — 근거 없이 금액을 올리지 않는다. 확정되면 이 함수만 고치면 된다. + * ⚠ **순서** — 이 함수는 `applyStructureSpoil` **뒤에** 돈다. 잔토가 담긴 뒤라야 뺄 대상이 있다. * * 돌려주는 값은 **실제로 뺀 양(㎥)**. 사토가 모자라면 받은 값보다 작다. */ @@ -664,8 +667,10 @@ export function computeHaulPlan( residual.index = index + 1; }); - const deductionInput = options?.collected_stone_deduction_m3 ?? null; - const deducted = applyCollectedStoneDeduction(settled, deductionInput); + // ⚠ **순서가 뜻을 가른다 — 「잔토를 더하고 → 공제를 뺀다」**(2026-09-09 확정). + // 유토곡선의 사토는 「현장에 남는 흙 총량」이고 **출처를 안 가린다**. 공제는 그 총량에서 + // 빼는 것이라 **잔토가 담긴 뒤라야 뺄 대상이 있다.** 반대 순서로 두면 사토가 0 인 + // 노선(전 구간 토취)에서 공제가 **영영 안 걸린다** — 두 창 저장분에서 실제로 그랬다. const structureSpoilInput = options?.structure_spoil_m3 ?? null; const structureSpoilPoints = options?.structure_spoil_points ?? null; const structureSpoilAdded = applyStructureSpoil( @@ -673,6 +678,8 @@ export function computeHaulPlan( structureSpoilInput, structureSpoilPoints, ); + const deductionInput = options?.collected_stone_deduction_m3 ?? null; + const deducted = applyCollectedStoneDeduction(settled, deductionInput); const remaining = settled.filter((residual) => residual.volume_m3 > EPSILON); remaining.forEach((residual, index) => { residual.index = index + 1;