From 70bb500ef1df874ca696f766775d54ba689e56d9 Mon Sep 17 00:00:00 2001 From: Seongho Bae Date: Fri, 14 Aug 2026 18:36:22 +0900 Subject: [PATCH 1/8] test: require IEC binary byte labels --- src/lib/fmt.test.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/lib/fmt.test.ts b/src/lib/fmt.test.ts index 7b9f33c55..45af5b9d2 100644 --- a/src/lib/fmt.test.ts +++ b/src/lib/fmt.test.ts @@ -6,14 +6,17 @@ describe("fmtBytes", () => { expect(fmtBytes(0)).toBe("0 B"); expect(fmtBytes(512)).toBe("512 B"); }); - it("uses one decimal below 10 in larger units", () => { - expect(fmtBytes(1024)).toBe("1.0 KB"); - expect(fmtBytes(1536)).toBe("1.5 KB"); + it("uses IEC binary prefixes when scaling by powers of 1024", () => { + expect(fmtBytes(1024)).toBe("1.0 KiB"); + expect(fmtBytes(1536)).toBe("1.5 KiB"); + expect(fmtBytes(1024 ** 2)).toBe("1.0 MiB"); + expect(fmtBytes(1024 ** 3)).toBe("1.0 GiB"); + expect(fmtBytes(1024 ** 4)).toBe("1.0 TiB"); }); it("drops decimals at 10 and above", () => { - expect(fmtBytes(10 * 1024)).toBe("10 KB"); + expect(fmtBytes(10 * 1024)).toBe("10 KiB"); }); - it("caps at TB", () => { - expect(fmtBytes(1024 ** 5)).toBe("1024 TB"); + it("keeps scaling beyond tebibytes instead of reporting thousands of TiB", () => { + expect(fmtBytes(1024 ** 5)).toBe("1.0 PiB"); }); }); From daa6dc53391cb2e1bab329d7e26928edd611f7eb Mon Sep 17 00:00:00 2001 From: Seongho Bae Date: Fri, 14 Aug 2026 18:36:51 +0900 Subject: [PATCH 2/8] test: keep model verdict copy advisory --- src/lib/verdictBadge.test.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/lib/verdictBadge.test.ts b/src/lib/verdictBadge.test.ts index 5a86dc49f..d10e93e65 100644 --- a/src/lib/verdictBadge.test.ts +++ b/src/lib/verdictBadge.test.ts @@ -1,9 +1,14 @@ -import { describe, it, expect } from "vitest"; +import { describe, expect, it } from "vitest"; import { verdictBadge } from "./verdictBadge"; describe("verdictBadge", () => { - it("maps each verdict to a distinct label", () => { - expect(verdictBadge("safe").label).toBe("안전"); + it("keeps model advice distinct without presenting safe as deletion authorization", () => { + const safe = verdictBadge("safe"); + expect(safe.label).toBe("낮은 위험"); + expect(safe.title).toContain("자문"); + expect(safe.title).toContain("검증"); + expect(safe.title).not.toContain("삭제해도 안전"); + expect(verdictBadge("caution").label).toBe("주의"); expect(verdictBadge("keep").label).toBe("보관"); expect(verdictBadge("unrated").label).toBe("미판정"); From 2ab52769d3d8e8262fd72bf695c8911b1c707ece Mon Sep 17 00:00:00 2001 From: Seongho Bae Date: Fri, 14 Aug 2026 20:02:38 +0900 Subject: [PATCH 3/8] fix: label binary byte units accurately --- src/lib/fmt.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/fmt.ts b/src/lib/fmt.ts index 95e22d1fa..d9ee0b12e 100644 --- a/src/lib/fmt.ts +++ b/src/lib/fmt.ts @@ -1,5 +1,5 @@ export function fmtBytes(n: number): string { - const units = ["B", "KB", "MB", "GB", "TB"]; + const units = ["B", "KiB", "MiB", "GiB", "TiB", "PiB"]; let v = n; let i = 0; while (v >= 1024 && i < units.length - 1) { From f2e99c031c3cb09d635e918774a3da8b8ca506ed Mon Sep 17 00:00:00 2001 From: Seongho Bae Date: Fri, 14 Aug 2026 20:03:04 +0900 Subject: [PATCH 4/8] fix: present model low-risk verdict as advisory --- src/lib/verdictBadge.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/verdictBadge.ts b/src/lib/verdictBadge.ts index 2b2e11fd1..351005261 100644 --- a/src/lib/verdictBadge.ts +++ b/src/lib/verdictBadge.ts @@ -6,11 +6,11 @@ export interface VerdictBadge { title: string; } -/** LLM 삭제-안전 판정 → 배지 표시. 미상/미판정은 unrated로 폴백. 자문(advisory)일 뿐. */ +/** LLM 위험도 자문 결과 → 배지 표시. 미상/미판정은 unrated로 폴백하며 삭제 권한을 부여하지 않는다. */ export function verdictBadge(v: Verdict | string): VerdictBadge { switch (v) { case "safe": - return { label: "안전", cls: "badge-safe", title: "삭제해도 안전 (자문)" }; + return { label: "낮은 위험", cls: "badge-safe", title: "모델 자문: 낮은 위험 — 작업 전 검증 필요" }; case "caution": return { label: "주의", cls: "badge-caution", title: "삭제 주의 — 확인 권장 (자문)" }; case "keep": From 30185961b6ae70af64cab56a92693857dc29c4d5 Mon Sep 17 00:00:00 2001 From: Seongho Bae Date: Sat, 15 Aug 2026 20:21:26 +0900 Subject: [PATCH 5/8] test: require complete IEC 2025 binary prefix ladder --- src/lib/fmt.test.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/fmt.test.ts b/src/lib/fmt.test.ts index 45af5b9d2..454617579 100644 --- a/src/lib/fmt.test.ts +++ b/src/lib/fmt.test.ts @@ -16,7 +16,12 @@ describe("fmtBytes", () => { it("drops decimals at 10 and above", () => { expect(fmtBytes(10 * 1024)).toBe("10 KiB"); }); - it("keeps scaling beyond tebibytes instead of reporting thousands of TiB", () => { + it("uses the complete IEC 80000-13:2025 binary-prefix ladder", () => { expect(fmtBytes(1024 ** 5)).toBe("1.0 PiB"); + expect(fmtBytes(1024 ** 6)).toBe("1.0 EiB"); + expect(fmtBytes(1024 ** 7)).toBe("1.0 ZiB"); + expect(fmtBytes(1024 ** 8)).toBe("1.0 YiB"); + expect(fmtBytes(1024 ** 9)).toBe("1.0 RiB"); + expect(fmtBytes(1024 ** 10)).toBe("1.0 QiB"); }); }); From 8b13f7555543cbe9642c21c6d38b2aedfc307513 Mon Sep 17 00:00:00 2001 From: Seongho Bae Date: Sat, 15 Aug 2026 20:22:08 +0900 Subject: [PATCH 6/8] fix: complete IEC 2025 binary prefix ladder --- src/lib/fmt.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/fmt.ts b/src/lib/fmt.ts index d9ee0b12e..499a1149e 100644 --- a/src/lib/fmt.ts +++ b/src/lib/fmt.ts @@ -1,5 +1,5 @@ export function fmtBytes(n: number): string { - const units = ["B", "KiB", "MiB", "GiB", "TiB", "PiB"]; + const units = ["B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB", "RiB", "QiB"]; let v = n; let i = 0; while (v >= 1024 && i < units.length - 1) { From 14316ff15ff559459207cb2281f69b62bc39145c Mon Sep 17 00:00:00 2001 From: Seongho Bae Date: Sat, 15 Aug 2026 20:24:58 +0900 Subject: [PATCH 7/8] docs: explain IEC byte formatting contract --- src/lib/fmt.ts | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/lib/fmt.ts b/src/lib/fmt.ts index 499a1149e..25c8fd8a8 100644 --- a/src/lib/fmt.ts +++ b/src/lib/fmt.ts @@ -1,5 +1,23 @@ +/** + * Format a byte count with IEC 80000-13:2025 binary prefixes. + * + * Values below ten units retain one decimal place, while larger values use the + * existing whole-number presentation so callers keep a compact, consistent UI. + */ export function fmtBytes(n: number): string { - const units = ["B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB", "RiB", "QiB"]; + const units = [ + "B", + "KiB", + "MiB", + "GiB", + "TiB", + "PiB", + "EiB", + "ZiB", + "YiB", + "RiB", + "QiB", + ]; let v = n; let i = 0; while (v >= 1024 && i < units.length - 1) { From bb0e721bc51dda5b6a0e98104c1897187e2b2b55 Mon Sep 17 00:00:00 2001 From: Seongho Bae Date: Sat, 15 Aug 2026 20:25:09 +0900 Subject: [PATCH 8/8] docs: clarify formatter rounding contract --- src/lib/fmt.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/fmt.ts b/src/lib/fmt.ts index 25c8fd8a8..df2c9156b 100644 --- a/src/lib/fmt.ts +++ b/src/lib/fmt.ts @@ -1,8 +1,9 @@ /** * Format a byte count with IEC 80000-13:2025 binary prefixes. * - * Values below ten units retain one decimal place, while larger values use the - * existing whole-number presentation so callers keep a compact, consistent UI. + * Scaled values below ten retain one decimal place. Byte values and scaled + * values of ten or more use the existing whole-number presentation so callers + * keep a compact, consistent UI. */ export function fmtBytes(n: number): string { const units = [