fix(git): 병합이 떨군 파일 22개와 되돌아간 파일 35개를 되살림

무슨 일이 있었나
랩탑 줄의 병합 `20ba886c`(Merge origin/main_desktop_1·main_laptop_1·sub_desktop_1 into
sub_laptop_1)가 우리 파일 22개를 떨구고 35개 파일의 내용을 옛것으로 되돌림. 손으로 지운
커밋은 없고 **병합 자체가 떨군 것**임. 그것이 `origin/dev`·`main_laptop_1`·`sub_laptop_1`·
`CODEX` 까지 퍼졌고(데스크탑 둘만 무사), 이 창의 병합 `d92c1f2b` 로 들어옴.

잃었던 것
- 공용 — `common_util_provenance.py` · `ui_template_provenance.ts`
- B08 — 근거 사전 · 좌측 패널 상자 모듈 · 토량환산계수 칸
- B09 — 근거 사전 셋
- B05 — 계획노선 편집 모듈 아홉 · 지형 라우터 · B04 지도 모듈
- 시험 셋과, 35개 파일 안의 최근 작업(환산계수 고르기 · 근거 호버 배선 등)

어떻게 되살렸나
`611a2b40`(병합 직전, 전부 온전)에서 `git show <커밋>:<경로>` 로 내용만 꺼내 되돌림.
이력은 안 건드림. ⚠ HEAD 에만 있던 「추가 816줄」은 랩탑의 새 작업이 아니라 **되살아난
옛 코드**였음(B05 편집은 모듈로 쪼개기 전 덩어리 · B08 라우터는 환산계수 고르기 전 옛
상수판). 되돌릴 시점 이후의 **진짜 새 커밋은 둘뿐**이라 그 둘만 패치로 다시 얹음 —
`9f827bf6`(리로드 빌드 고리 끊기, 데스크탑 보조) · `b9bca6b3`(B06 조정창 1px, 랩탑).
위키 여덟은 코덱스 몫이라 손대지 않음.

자체검증 — 양쪽 작업이 다 살아 있음을 짚어 확인: `main.py` 의 「개발 서버는 살려 둔다」 ·
`B05_Profile_Engine_Grade.py` 의 `plan_curve_length_limit_m` · `B08_..._EarthworkGrid.ts` 의
`attachProvenance`. `tsc --noEmit` 통과 · `pytest -q` **1317 passed, 28 skipped**
(되살리기 전에는 시험 둘이 수집 단계에서 깨져 있었음).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RANEBHns1S4tkmsYwewtk
This commit is contained in:
2026-09-12 18:18:57 +09:00
co-authored by Claude Opus 5
parent 216d027e9c
commit f952ac7ffd
55 changed files with 6030 additions and 764 deletions
+94 -13
View File
@@ -13,6 +13,12 @@
* ========================================================================== */
import { ui_locales, currentLanguageIndex } from "@ui/ui_template_locale";
import {
attachProvenance,
markProvenanceCell,
type ProvenancePayload,
type ProvenanceSheet,
} from "@ui/ui_template_provenance";
import { API_BASE_URL } from "@config/config_frontend";
function L(key: keyof typeof ui_locales): string {
@@ -48,6 +54,8 @@ export interface BaseDataDto {
material: BaseDataRow[];
expense: BaseDataRow[];
machine: MachineRow[];
/** 근거 사전 — **개발환경에서만** 온다. 없으면 호버·등급색이 통째로 안 붙는다. */
provenance?: ProvenancePayload;
}
export async function fetchBaseData(projectId: string): Promise<BaseDataDto> {
@@ -80,7 +88,19 @@ function note(text: string): HTMLElement {
return el;
}
function table(headers: string[], rows: string[][], leftCols: number[]): HTMLElement {
/**
* 표 한 장.
*
* `keys`·`sheet` 를 함께 주면 칸마다 근거 호버가 붙는다 — **사전이 없으면 아무 일도
* 안 한다**(빈 카드를 띄우면 「설명이 있다」는 거짓만 남는다). 안 주는 표는 종전 그대로다.
*/
function table(
headers: string[],
rows: string[][],
leftCols: number[],
keys?: string[],
sheet?: ProvenanceSheet,
): HTMLElement {
const el = document.createElement("table");
el.className = "b09-sheet";
const thead = document.createElement("thead");
@@ -99,16 +119,20 @@ function table(headers: string[], rows: string[][], leftCols: number[]): HTMLEle
const td = document.createElement("td");
td.textContent = text;
if (leftCols.includes(index)) td.className = "b09-left";
const key = keys?.[index];
const column = key ? sheet?.columns[key] : undefined;
if (key && column) markProvenanceCell(td, key, column.tier);
tr.append(td);
});
tbody.append(tr);
}
el.append(thead, tbody);
attachProvenance(el, sheet);
return el;
}
/** 목록표 한 장 — 코드·명칭·규격·단위·단가·비고 (실무 시트와 같은 칸). */
function catalogTable(rows: BaseDataRow[]): HTMLElement {
function catalogTable(rows: BaseDataRow[], sheet?: ProvenanceSheet): HTMLElement {
return table(
["코드번호", "명 칭", "규 격", "단위", "단 가", "비 고"],
rows.map((row) => [
@@ -120,6 +144,8 @@ function catalogTable(rows: BaseDataRow[]): HTMLElement {
row.note,
]),
[0, 1, 2, 5],
["code", "name", "spec", "unit", "unit_price_krw", "note"],
sheet,
);
}
@@ -148,7 +174,7 @@ export function drawBaseDataTab(body: HTMLElement, data: BaseDataDto): void {
body.append(note("아직 선 줄이 없습니다 — 값을 0 으로 채우지 않습니다."));
continue;
}
body.append(catalogTable(rows));
body.append(catalogTable(rows, data.provenance?.sheets?.catalog));
}
}
@@ -174,6 +200,18 @@ export function drawMachineTab(body: HTMLElement, data: BaseDataDto): void {
row.note,
]),
[0, 1, 2, 8],
[
"code",
"name",
"spec",
"unit",
"total_krw",
"labor_krw",
"material_krw",
"expense_krw",
"note",
],
data.provenance?.sheets?.machine,
),
);
// ⚠ 계산 과정을 감추지 않는다(PLAN 8-13). 조종원 환산이 실무와 다른 것을 여기서 밝힌다.
@@ -364,6 +402,7 @@ export function drawMachineExpense(body: HTMLElement, data: MachineExpenseDto):
export interface BasisSheetDto {
status: string;
provenance?: ProvenancePayload;
note: string;
summary: string;
dataset_versions: Array<{
@@ -402,6 +441,8 @@ export function drawBasisSheet(body: HTMLElement, data: BasisSheetDto): void {
row.sha256 || "—",
]),
[0, 1, 2, 3],
["dataset_id", "file", "effective_date", "sha256"],
data.provenance?.sheets?.basis_versions,
),
);
@@ -414,6 +455,8 @@ export function drawBasisSheet(body: HTMLElement, data: BasisSheetDto): void {
["항 목", "고른 값"],
data.chosen_conditions.map((row) => [row.item, row.value]),
[0, 1],
["item", "value"],
data.provenance?.sheets?.basis_chosen,
),
);
}
@@ -424,6 +467,8 @@ export function drawBasisSheet(body: HTMLElement, data: BasisSheetDto): void {
["코드", "공 종", "단위", "근 거"],
data.work_items.map((row) => [row.code, row.name, row.unit, row.notes.join(" · ")]),
[0, 1, 2, 3],
["code", "name", "unit", "notes"],
data.provenance?.sheets?.basis_items,
),
);
@@ -436,6 +481,8 @@ export function drawBasisSheet(body: HTMLElement, data: BasisSheetDto): void {
["갈 래", "코드", "사 유"],
data.gaps.map((row) => [row.kind, row.code, row.reason]),
[0, 1, 2],
["kind", "code", "reason"],
data.provenance?.sheets?.basis_gaps,
),
);
body.append(note("⚠ 여기 있는 것은 0 으로 때우지 않고 남겨 둔 자리입니다."));
@@ -484,6 +531,7 @@ export interface FuelScope {
export interface PriceSourcesDto {
status: string;
provenance?: ProvenancePayload;
material_comparison: {
slot_names: string[];
rows: MaterialComparisonRow[];
@@ -530,7 +578,11 @@ export async function fetchPriceSources(projectId: string): Promise<PriceSources
* 자재단가대비표 — 원천마다 **단가·페이지** 두 칸이라 머리글이 두 줄이다.
* 채택한 원천 칸에 표시를 넣어 「어느 것을 썼나」가 한눈에 보이게 한다.
*/
function comparisonTable(slotNames: string[], rows: MaterialComparisonRow[]): HTMLElement {
function comparisonTable(
slotNames: string[],
rows: MaterialComparisonRow[],
sheet?: ProvenanceSheet,
): HTMLElement {
const el = document.createElement("table");
el.className = "b09-sheet";
@@ -571,35 +623,45 @@ function comparisonTable(slotNames: string[], rows: MaterialComparisonRow[]): HT
const tbody = document.createElement("tbody");
for (const row of rows) {
const tr = document.createElement("tr");
const put = (text: string, left = false): void => {
/** 칸 하나 — `key` 를 주면 근거 호버가 붙는다(사전에 없는 열은 아무 일도 안 한다). */
const put2 = (td: HTMLElement, key: string, tier?: string): void => {
const column = sheet?.columns[key];
if (column) markProvenanceCell(td, key, tier ?? column.tier);
};
const put = (text: string, left = false, key?: string): void => {
const td = document.createElement("td");
td.textContent = text;
if (left) td.className = "b09-left";
if (key) put2(td, key);
tr.append(td);
};
put(row.code, true);
put(row.name, true);
put(row.spec, true);
put(row.unit);
put(row.code, true, "code");
put(row.name, true, "name");
put(row.spec, true, "spec");
put(row.unit, false, "unit");
for (const slot of row.slots) {
const td = document.createElement("td");
td.textContent = money(slot.price_krw);
// 채택한 원천을 굵게 — 「어느 값을 썼나」를 표가 스스로 밝힌다.
if (slot.adopted) td.style.fontWeight = "700";
// ⚠ **빈 칸은 「0원」이 아니라 「그 판에 그 품목이 없다」** — 막힌 자리로 표시한다.
put2(td, "slot_price", slot.price_krw === null ? "blocked" : undefined);
tr.append(td);
const page = document.createElement("td");
page.textContent = slot.source_note;
page.className = "b09-left";
put2(page, "slot_page");
tr.append(page);
}
if (!appliedIsLastSlot) {
put(money(row.adopted_price_krw));
put(money(row.adopted_price_krw), false, "adopted_price_krw");
put(row.adopted_slot ? (row.slots[row.adopted_slot - 1]?.name ?? "") : "", true);
}
put(row.note, true);
put(row.note, true, "note");
tbody.append(tr);
}
el.append(thead, tbody);
attachProvenance(el, sheet);
return el;
}
@@ -609,6 +671,8 @@ function baseReferenceSections(
data: PriceSourcesDto["base_reference"],
projectId: string,
reload: () => void,
laborSheet?: ProvenanceSheet,
fuelSheet?: ProvenanceSheet,
): void {
body.append(head("환율및기초자료 — ① 환율"));
body.append(note(data.exchange.note));
@@ -628,6 +692,8 @@ function baseReferenceSections(
row.formula,
]),
[0, 1, 4],
["code", "name", "day_wage_krw", "hourly_krw", "formula"],
laborSheet,
),
);
}
@@ -655,6 +721,8 @@ function baseReferenceSections(
],
],
[0, 2, 3, 4],
["item", "price_krw", "scope", "effective_date", "dataset_id"],
fuelSheet,
),
);
@@ -727,11 +795,24 @@ export function drawPriceSourcesSections(
if (comparison.rows.length === 0) {
body.append(note("아직 선 줄이 없습니다 — 값을 0 으로 채우지 않습니다."));
} else {
body.append(comparisonTable(comparison.slot_names, comparison.rows));
body.append(
comparisonTable(
comparison.slot_names,
comparison.rows,
data.provenance?.sheets?.material_comparison,
),
);
}
for (const text of comparison.notes) body.append(note(text));
baseReferenceSections(body, data.base_reference, projectId, reload);
baseReferenceSections(
body,
data.base_reference,
projectId,
reload,
data.provenance?.sheets?.base_reference_labor,
data.provenance?.sheets?.base_reference_fuel,
);
}
/** 두 표를 아직 못 받아왔을 때 — 화면을 비우지 않는다. */