fix: 오류 수정

This commit is contained in:
DongHyeonka
2026-08-22 14:40:49 +09:00
parent 1801414592
commit c03b0c77b8
23 changed files with 644 additions and 112 deletions
@@ -162,12 +162,27 @@ export function createHttpPublicContentGateway(
kind: "CASE",
problem: (body.problemSummary as string) ?? "",
conclusion: (body.conclusionSummary as string) ?? "",
environment: ((body.environmentSummary as readonly string[]) ?? []).join(", "),
// The Case document renders a verification line. The contract has no
// field for it — verification lives in the body — so it stays empty
// rather than being guessed from a heading.
verification: "",
// `environmentSummary` 는 검증 환경과 재현 조건을 그 순서로 담는다 — 서버가 비어 있지
// 않은 것만 순서대로 넣는다. 예전에는 둘을 쉼표로 이어 붙여 한 칸에 넣고 재현 조건 칸은
// "계약에 없다"며 비워 두었는데, 계약에는 있었고 채우는 쪽이 없었을 뿐이다.
environment: ((body.environmentSummary as readonly string[]) ?? [])[0] ?? "",
verification: ((body.environmentSummary as readonly string[]) ?? [])[1] ?? "",
lastVerifiedLabel: dateLabel(body.lastVerifiedAt as string),
content: (body.content as string) ?? "",
bodyAssets: Object.freeze(
((body.bodyAssets as readonly Readonly<Record<string, unknown>>[]) ?? []).map((asset) =>
Object.freeze({
assetKey: asset.assetKey as string,
assetId: asset.assetId as string,
url: asset.url as string,
contentType: asset.contentType as string,
altText: (asset.altText as string) ?? "",
width: (asset.width as number) ?? null,
height: (asset.height as number) ?? null,
decorative: Boolean(asset.decorative),
}),
),
),
sections: markdownSections(body.content as string),
}) as unknown as Extract<PublicRecord, { kind: K }>;
}
@@ -194,6 +194,9 @@ export function knowledgeListItemToRecord(item: Readonly<Record<string, unknown>
environment: "",
verification: "",
lastVerifiedLabel: dateLabel(item.lastVerifiedAt as string),
// 목록 항목은 본문을 담지 않는다 — 본문은 상세 조회에서만 온다.
content: "",
bodyAssets: Object.freeze([]),
sections: Object.freeze([]),
}) as CaseRecord;
}
@@ -35,6 +35,18 @@ type PublicRecordBase = {
relations: ReadonlyArray<PublicRelation>;
};
/** 본문이 `:::evidence key="..."` 로 가리키는 Asset. 계약의 `BodyAsset` 과 같은 모양이다. */
export type PublicBodyAsset = {
assetKey: string;
assetId: string;
url: string;
contentType: string;
altText: string;
width: number | null;
height: number | null;
decorative: boolean;
};
export type CaseRecord = PublicRecordBase & {
kind: "CASE";
problem: string;
@@ -42,6 +54,9 @@ export type CaseRecord = PublicRecordBase & {
environment: string;
verification: string;
lastVerifiedLabel: string;
/** 본문 Markdown 원문. 정적 기록은 문서 화면이 자체 본문을 쓰므로 비어 있다. */
content: string;
bodyAssets: ReadonlyArray<PublicBodyAsset>;
sections: ReadonlyArray<RecordSection>;
};
@@ -173,6 +188,8 @@ export const publicRecords: ReadonlyArray<PublicRecord> = [
environment: "PostgreSQL 16 · Hibernate 6 · Spring Data JPA",
verification: "FeedItem 100개, Zipf 편중 Highlight/Mention",
lastVerifiedLabel: "2026.08.11",
content: "",
bodyAssets: [],
sections: [
{
id: "fix-the-problem",
@@ -256,6 +273,8 @@ export const publicRecords: ReadonlyArray<PublicRecord> = [
environment: "Spring Boot · Redis · Testcontainers",
verification: "동일한 Port 계약으로 In-memory와 Redis Adapter 계약 테스트 실행",
lastVerifiedLabel: "2026.08.07",
content: "",
bodyAssets: [],
sections: [
{
id: "ownership",