fix: 결정 문서가 작성자가 채운 칸을 그대로 보여 준다
공개 결정 화면에 네 가지가 어긋나 있었다 — 제목 자리에 결정문 전문이 나오고, 요약이 아예 없고, 줄바꿈이 전부 접히고, 영향과 근거 기록이 늘 비어 있었다. 원인은 하나로 모인다. 결정에는 상세 endpoint 가 없다 — 공개 주소가 목록 위의 앵커다. 그런데 계약의 목록 항목에 title·summary·consequences·evidence 가 없어서, 프론트는 statement 를 제목 자리에도 쓰고 영향은 빈 배열로 고정해 두고 있었다. DB 에는 작성자가 쓴 값이 그대로 들어 있었다 — 제목, 여러 줄 요약, 영향 4건. 근거는 두 자리에서 온다. `sourceQuestion`/`sourceCase` 는 결정 하나가 원천 하나를 지목하던 예전 모양이고 지금 작성자는 관계로 여러 개를 건다. 둘을 합치되 같은 경로는 한 번만 싣는다. 줄바꿈은 별개 원인이다. 이 칸들은 Markdown 을 거치지 않고 텍스트 노드로 들어가는데 이 화면만 `PlainText` 를 쓰지 않고 값을 그대로 넣고 있었다. 글자만 확인하는 테스트로는 접힘이 보이지 않으므로, 두 줄짜리 픽스처를 두고 `<br>` 이 남는지 요소로 묻는다 — 되돌리면 빨개진다. 즉시 미리보기도 같은 구조로 맞췄다. 미리보기와 공개가 다르게 그리면 무엇을 믿을지 알 수 없다. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0189NzCryfeqDzS81EWidnBx
This commit is contained in:
co-authored by
Claude Opus 5
parent
3b6ba64c08
commit
31afb4d800
@@ -238,20 +238,35 @@ export function questionListItemToRecord(item: Readonly<Record<string, unknown>>
|
||||
}
|
||||
|
||||
export function decisionItemToDecision(item: Readonly<Record<string, unknown>>): ProjectDecision {
|
||||
const sources = [item.sourceQuestion, item.sourceCase]
|
||||
.filter((entry): entry is Related => Boolean(entry))
|
||||
.map((entry) => ({ title: entry.title ?? "", path: entry.path ?? "" }));
|
||||
/*
|
||||
근거는 두 자리에서 온다. `sourceQuestion`/`sourceCase` 는 결정 하나가 원천 하나를 지목하던
|
||||
예전 모양이고, 지금 작성자는 관계로 여러 개를 건다 — 둘을 합치되 같은 경로는 한 번만 싣는다.
|
||||
*/
|
||||
const related = [
|
||||
...[item.sourceQuestion, item.sourceCase].filter((entry): entry is Related => Boolean(entry)),
|
||||
...((item.evidence as readonly Related[] | undefined) ?? []),
|
||||
];
|
||||
const evidence = [
|
||||
...new Map(
|
||||
related
|
||||
.filter((entry) => entry.path && entry.title)
|
||||
.map((entry) => [entry.path!, { title: entry.title!, path: entry.path! }]),
|
||||
).values(),
|
||||
];
|
||||
return Object.freeze({
|
||||
id: String(item.id ?? ""),
|
||||
status: (item.status as ProjectDecision["status"]) ?? "PROPOSED",
|
||||
date: dateLabel(item.decidedAt as string),
|
||||
title: String(item.statement ?? ""),
|
||||
/*
|
||||
제목과 결정문은 다른 칸이다. 예전에는 계약에 제목이 없어 결정문을 제목 자리에도 썼고,
|
||||
결정문이 여러 문단인 글에서는 제목 자리에 문서 전체가 들어갔다.
|
||||
*/
|
||||
title: String(item.title ?? item.statement ?? ""),
|
||||
summary: String(item.summary ?? ""),
|
||||
statement: String(item.statement ?? ""),
|
||||
rationale: String(item.rationaleSummary ?? ""),
|
||||
// The list response carries a rationale summary, not the consequence list the
|
||||
// decision screen renders; the contract has no field for it here.
|
||||
consequences: Object.freeze([]),
|
||||
evidence: Object.freeze(sources),
|
||||
consequences: Object.freeze(((item.consequences as readonly string[] | undefined) ?? []).map(String)),
|
||||
evidence: Object.freeze(evidence),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -119,6 +119,8 @@ export type ProjectDecision = {
|
||||
status: "ADOPTED" | "PROPOSED";
|
||||
date: string;
|
||||
title: string;
|
||||
/** 제목 바로 아래에 오는 요약. 결정문과 다른 칸이다. */
|
||||
summary: string;
|
||||
statement: string;
|
||||
rationale: string;
|
||||
consequences: ReadonlyArray<string>;
|
||||
@@ -609,6 +611,8 @@ export const projects: ReadonlyArray<Project> = [
|
||||
status: "ADOPTED",
|
||||
date: "2026.08.10",
|
||||
title: "파일 저장 계약을 하나로 통합합니다",
|
||||
summary:
|
||||
"저장 기술이 달라도 애플리케이션이 요구하는 의미는 같습니다.\n그래서 호출 계약을 기술별로 나누지 않습니다.",
|
||||
statement:
|
||||
"Filesystem과 Object Storage는 하나의 StoragePort와 서로 다른 Adapter로 구성합니다.",
|
||||
rationale:
|
||||
@@ -633,6 +637,7 @@ export const projects: ReadonlyArray<Project> = [
|
||||
status: "ADOPTED",
|
||||
date: "2026.08.11",
|
||||
title: "목록 페이징과 컬렉션 로딩을 분리합니다",
|
||||
summary: "컬렉션 Fetch Join 이 페이지 경계를 지우므로 부모 페이징과 컬렉션 로딩을 나눕니다.",
|
||||
statement:
|
||||
"피드 목록은 부모를 먼저 페이징하고 현재 페이지의 연관 컬렉션만 별도 조회합니다.",
|
||||
rationale:
|
||||
@@ -702,6 +707,7 @@ export const projects: ReadonlyArray<Project> = [
|
||||
status: "ADOPTED",
|
||||
date: "2026.08.09",
|
||||
title: "브라우저 클라이언트에는 Client Secret을 두지 않습니다",
|
||||
summary: "브라우저에 전달된 값은 사용자가 볼 수 있어 비밀로 클라이언트를 증명할 수 없습니다.",
|
||||
statement: "SPA는 public client와 Authorization Code Flow + PKCE로 구성합니다.",
|
||||
rationale:
|
||||
"브라우저에 전달된 값은 사용자가 확인할 수 있으므로 Client Secret으로 클라이언트를 증명할 수 없습니다.",
|
||||
|
||||
Reference in New Issue
Block a user