Files
Aislo/resources/tester/helper_455_old_policy.cjs
T
eomsangdonandClaude Sonnet 5.5 8a3a145072 test(508-1b 옛 헬퍼 공용 불러오기 5/7): 헬퍼 28 곳 loadTs 베낌 걷고 makeLoader 로
- 헬퍼 동작 그대로(풀이 함수 본문은 옮겨 담음) · 제품 코드 안 고침
- 확인: 이 묶음 헬퍼를 쓰는 시험 233 개 전 233 통과 → 후 233 통과 (시험별 junit 대조 · 어긋남 0)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-21 17:12:59 +09:00

26 lines
1.0 KiB
JavaScript

/* 455 (433-13 ③) 옛 정책 경고 — 진짜 `B05_Profile_UI_Profile_Data.ts` readAlignment +
* `B05_Profile_UI_Profile_Alignment.ts` buildAlignment 를 Node 로 돌림.
* 입력 argv[2] = 종단 정본 JSON · 표준출력 = { warnings: [법정 미달 글], policy }.
*/
const fs = require("fs");
const path = require("path");
const { makeLoader } = require("./helper_ts_stub_loader.cjs");
const ROOT = path.join(__dirname, "..", "..");
const { loadTs } = makeLoader({
root: ROOT,
});
const LOGIC = path.join(ROOT, "B05_Profile", "logic");
const data = loadTs(path.join(LOGIC, "B05_Profile_UI_Profile_Data.ts"));
const align = loadTs(path.join(LOGIC, "B05_Profile_UI_Profile_Alignment.ts"));
const longitudinal = JSON.parse(fs.readFileSync(process.argv[2], "utf8"));
const stored = data.readAlignment(longitudinal);
const built = align.buildAlignment(align.toAlignmentBase(stored), align.emptyEdits());
process.stdout.write(
JSON.stringify({
warnings: built.warnings.filter((text) => text.includes("법정 최소")),
policy: stored.policy,
}),
);