fix: 프로젝트 기록 목록이 모든 종류를 싣고 요약·주제·날짜를 보여 준다
프로젝트 기록에서 Open Question 이 보이지 않았다. 이 목록은 탐색의 지식 목록과 응답 모양이 다른데(유형이 네 가지고 요약이 `summary` 한 칸에 온다) 지식 목록의 매퍼를 그대로 쓰고 있었다. 그 매퍼는 CASE/REFERENCE 가 아니면 `null` 을 돌려주고 호출부가 `filter` 로 걸러 내므로, 질문과 개념은 오류도 빈 자리도 남기지 않고 조용히 없어졌다 — 목록이 한 줄 짧아질 뿐이라 눈으로는 알아채기 어렵다. 살아남은 줄도 온전하지 않았다. 매퍼가 `primarySummary`·`primaryTopic` 을 찾는데 이 응답에는 그 이름이 없어서 요약과 주제가 빈 채로 그려졌고, 게시일은 응답 자체에 없었다 — 그래서 목록의 모든 줄이 "제목만 있고 · 만 남은" 모양이었다. 계약이 요약·주제·게시일을 싣게 하고(design-package 76a7ccb), 이 응답 전용 매퍼를 둔다. 네 유형이 모두 살아남는지와 그 칸들이 채워지는지를 함께 묻는 테스트를 세운다. 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
31afb4d800
commit
77125d1c7c
@@ -20,6 +20,7 @@ import {
|
||||
decisionItemToDecision,
|
||||
flattenRelations,
|
||||
knowledgeListItemToRecord,
|
||||
projectRecordItemToRecord,
|
||||
markdownSections,
|
||||
questionListItemToRecord,
|
||||
releaseDetailToRelease,
|
||||
@@ -342,7 +343,7 @@ export function createHttpPublicContentGateway(
|
||||
const page = await read<Page>("listPublicProjectRecords", { slug: projectSlug });
|
||||
if (page === NOT_FOUND) return [];
|
||||
return (page.items ?? [])
|
||||
.map(knowledgeListItemToRecord)
|
||||
.map(projectRecordItemToRecord)
|
||||
.filter((record): record is PublicRecord => record !== null);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import type {
|
||||
CaseRecord,
|
||||
ConceptRecord,
|
||||
ProjectActivity,
|
||||
ProjectDecision,
|
||||
PublicRecord,
|
||||
@@ -215,6 +216,56 @@ export function knowledgeListItemToRecord(item: Readonly<Record<string, unknown>
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 프로젝트 기록 목록의 한 줄.
|
||||
*
|
||||
* <p>탐색의 지식 목록과 응답 모양이 다르다 — 이쪽은 유형이 네 가지고 요약이 `summary` 한 칸에
|
||||
* 온다. 예전에는 지식 목록의 매퍼를 그대로 썼고, 그 매퍼는 CASE/REFERENCE 가 아니면 `null` 을
|
||||
* 돌려주므로 질문과 개념이 목록에서 조용히 사라졌다. 살아남은 줄도 `primarySummary`·
|
||||
* `primaryTopic`·`publishedAt` 을 찾다 못 찾아 요약·주제·날짜가 빈 채로 그려졌다.
|
||||
*/
|
||||
export function projectRecordItemToRecord(
|
||||
item: Readonly<Record<string, unknown>>,
|
||||
): PublicRecord | null {
|
||||
const type = String(item.type ?? "");
|
||||
const path = String(item.path ?? "");
|
||||
const slug = path.split("/").filter(Boolean).pop() ?? "";
|
||||
const base = baseOf(type as PublicRecord["kind"], slug, {
|
||||
title: item.title as string,
|
||||
summary: (item.summary as string) ?? "",
|
||||
path,
|
||||
primaryTopic: item.primaryTopic as Summary,
|
||||
publishedAt: item.publishedAt as string,
|
||||
});
|
||||
switch (type) {
|
||||
case "CASE":
|
||||
return Object.freeze({
|
||||
...base, kind: "CASE", problem: "", conclusion: "", environment: "",
|
||||
verification: "", lastVerifiedLabel: "", content: "",
|
||||
bodyAssets: Object.freeze([]), sections: Object.freeze([]),
|
||||
}) as CaseRecord;
|
||||
case "REFERENCE":
|
||||
return Object.freeze({
|
||||
...base, kind: "REFERENCE", purpose: "", rules: Object.freeze([]),
|
||||
applyWhen: Object.freeze([]), exceptions: Object.freeze([]),
|
||||
examples: Object.freeze([]), verifiedAt: "",
|
||||
}) as ReferenceRecord;
|
||||
case "QUESTION":
|
||||
return Object.freeze({
|
||||
...base, kind: "QUESTION", questionStatus: "OPEN", facts: Object.freeze([]),
|
||||
assumptions: Object.freeze([]), unknowns: Object.freeze([]),
|
||||
constraints: Object.freeze([]), options: Object.freeze([]), nextValidation: "",
|
||||
}) as QuestionRecord;
|
||||
case "CONCEPT":
|
||||
return Object.freeze({
|
||||
...base, kind: "CONCEPT", basisVersion: "", content: "",
|
||||
bodyAssets: Object.freeze([]), sections: Object.freeze([]),
|
||||
}) as ConceptRecord;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export function questionListItemToRecord(item: Readonly<Record<string, unknown>>): QuestionRecord {
|
||||
const path = String(item.path ?? "");
|
||||
const slug = path.split("/").filter(Boolean).pop() ?? "";
|
||||
|
||||
Reference in New Issue
Block a user