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:
DongHyeonka
2026-08-29 20:54:00 +09:00
co-authored by Claude Opus 5
parent 31afb4d800
commit 77125d1c7c
9 changed files with 156 additions and 12 deletions
+5 -5
View File
@@ -38,28 +38,28 @@
},
"contractSet": {
"setAlgorithm": "CA_CONTRACT_SET_V1",
"setDigest": "sha256:6f1e4725f3e7fa76d910954bc5a9bdd2fdafd6fa39413b0846f13fea47e9e4bb",
"setDigest": "sha256:d087b99f1eed932908890f11636fb2fc2befe34747acf846603ce7ad240d0dbe",
"packages": [
{
"packageId": "@tech-log/management-contract",
"version": "1.0.0",
"digest": "sha256:762aa81e6906469939fddd833c204ed3ca53f0fa96371f18a5ea1edaf76a64e8",
"runtimeProtocolVersion": 1,
"sourceRevision": "987c1b8"
"sourceRevision": "76a7ccb"
},
{
"packageId": "@tech-log/public-contract",
"version": "2.1.0",
"digest": "sha256:c80f62cd37862ea48cef750e9966164570dfa0ceaf9ddc1872d497b0462a2a00",
"digest": "sha256:afe415880eb5d6289ae10abf493333c97270c323c16a7245a466d4db4466e630",
"runtimeProtocolVersion": 1,
"sourceRevision": "987c1b8"
"sourceRevision": "76a7ccb"
},
{
"packageId": "@tech-log/studio-contract",
"version": "3.1.0",
"digest": "sha256:96f655d75fc19c535eb87e24f5320fdc382d6d982aaa75b67fe6acbde1ee8ff2",
"runtimeProtocolVersion": 1,
"sourceRevision": "987c1b8"
"sourceRevision": "76a7ccb"
}
]
}
@@ -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() ?? "";
@@ -2,7 +2,7 @@
"packageId": "@tech-log/management-contract",
"version": "1.0.0",
"digest": "sha256:762aa81e6906469939fddd833c204ed3ca53f0fa96371f18a5ea1edaf76a64e8",
"sourceRevision": "987c1b8",
"sourceRevision": "76a7ccb",
"operationIds": [
"createCaseDraft",
"getCaseForEdit",
@@ -1,8 +1,8 @@
{
"packageId": "@tech-log/public-contract",
"version": "2.1.0",
"digest": "sha256:c80f62cd37862ea48cef750e9966164570dfa0ceaf9ddc1872d497b0462a2a00",
"sourceRevision": "987c1b8",
"digest": "sha256:afe415880eb5d6289ae10abf493333c97270c323c16a7245a466d4db4466e630",
"sourceRevision": "76a7ccb",
"operationIds": [
"getPublicSite",
"getPublicHome",
@@ -771,8 +771,21 @@ export interface components {
items: components["schemas"]["ProjectDecisionItem"][];
page: components["schemas"]["PageMetadata"];
};
/** @description 프로젝트 기록 목록의 한 줄. 탐색 목록과 같은 화면 컴포넌트가 그리므로 그 컴포넌트가 읽는
* 칸을 갖는다 — `RelatedEntry` 로는 요약·주제·게시일이 없어 목록이 제목만 남은 줄로 그려졌다.
* */
ProjectRecordItem: {
/** @enum {string} */
type: "CASE" | "REFERENCE" | "QUESTION" | "CONCEPT";
title: string;
path: string;
summary: string;
primaryTopic?: components["schemas"]["TopicSummary"];
/** Format: date-time */
publishedAt: string;
};
ProjectRecordPage: {
items: components["schemas"]["RelatedEntry"][];
items: components["schemas"]["ProjectRecordItem"][];
page: components["schemas"]["PageMetadata"];
};
ProjectActivityItem: {
@@ -1805,6 +1805,36 @@ components:
$ref: '#/components/schemas/ProjectDecisionItem'
page:
$ref: '#/components/schemas/PageMetadata'
ProjectRecordItem:
description: |
프로젝트 기록 목록의 한 줄. 탐색 목록과 같은 화면 컴포넌트가 그리므로 그 컴포넌트가 읽는
칸을 갖는다 — `RelatedEntry` 로는 요약·주제·게시일이 없어 목록이 제목만 남은 줄로 그려졌다.
type: object
required:
- type
- title
- path
- summary
- publishedAt
properties:
type:
type: string
enum:
- CASE
- REFERENCE
- QUESTION
- CONCEPT
title:
type: string
path:
type: string
summary:
type: string
primaryTopic:
$ref: '#/components/schemas/TopicSummary'
publishedAt:
type: string
format: date-time
ProjectRecordPage:
type: object
required:
@@ -1814,7 +1844,7 @@ components:
items:
type: array
items:
$ref: '#/components/schemas/RelatedEntry'
$ref: '#/components/schemas/ProjectRecordItem'
page:
$ref: '#/components/schemas/PageMetadata'
ProjectActivityItem:
@@ -2,7 +2,7 @@
"packageId": "@tech-log/studio-contract",
"version": "3.1.0",
"digest": "sha256:96f655d75fc19c535eb87e24f5320fdc382d6d982aaa75b67fe6acbde1ee8ff2",
"sourceRevision": "987c1b8",
"sourceRevision": "76a7ccb",
"operationIds": [
"getStudioSession",
"getStudioDashboard",
@@ -0,0 +1,49 @@
import { strict as assert } from "node:assert";
import { test } from "vitest";
import type { components } from "../../../src/features/tech-log/contracts/public/generated.ts";
import { projectRecordItemToRecord } from "../../../src/features/tech-log/adapters/http/public-content-mapping.ts";
type ProjectRecordItem = components["schemas"]["ProjectRecordItem"];
/*
프로젝트 기록 목록에서 Open Question 이 사라졌다.
이 목록은 탐색의 지식 목록과 응답 모양이 다른데(유형이 네 가지고 요약이 `summary` 한 칸에
온다) 지식 목록의 매퍼를 그대로 쓰고 있었다. 그 매퍼는 CASE/REFERENCE 가 아니면 `null` 을
돌려주고 호출부가 `filter` 로 걸러 내므로, 질문과 개념은 오류도 빈 자리도 남기지 않고
조용히 없어졌다 — 목록이 그냥 한 줄 짧아질 뿐이라 눈으로는 알아채기 어렵다.
살아남은 줄도 온전하지 않았다. `primarySummary`·`primaryTopic`·`publishedAt` 을 찾다 못
찾아 요약·주제·날짜가 빈 채로 그려졌다. 그래서 여기서는 네 유형이 모두 살아남는지와, 그
칸들이 실제로 채워지는지를 함께 묻는다.
*/
const ITEM = {
type: "QUESTION",
title: "Refresh Token Rotation과 다중 Replica 경쟁을 어떻게 처리할 것인가",
path: "/questions/refresh-rotation-replica-contention",
summary: "두 replica 가 같은 refresh token 으로 동시에 갱신할 수 있다.",
primaryTopic: { name: "OAuth/OIDC 인증 경계", slug: "oauth-oidc-auth-boundary" },
publishedAt: "2026-08-26T13:41:53.974512Z",
} satisfies ProjectRecordItem;
test("a project's records keep every kind, including Open Question and 개념", () => {
for (const type of ["CASE", "REFERENCE", "QUESTION", "CONCEPT"] as const) {
const record = projectRecordItemToRecord({ ...ITEM, type });
assert.ok(record, `${type} 이 목록에서 사라지면 안 된다`);
assert.equal(record.kind, type);
}
});
test("a project record row carries the summary, topic, and date the list renders", () => {
const record = projectRecordItemToRecord(ITEM);
assert.ok(record);
assert.equal(record.title, ITEM.title);
assert.equal(record.summary, ITEM.summary);
assert.equal(record.topic, "OAuth/OIDC 인증 경계");
assert.equal(record.topicSlug, "oauth-oidc-auth-boundary");
assert.equal(record.publishedLabel, "2026.08.26");
assert.equal(record.path, ITEM.path);
});