diff --git a/public/release-manifest.json b/public/release-manifest.json index b89293b..1e365ff 100644 --- a/public/release-manifest.json +++ b/public/release-manifest.json @@ -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" } ] } diff --git a/src/features/tech-log/adapters/http/http-public-content-gateway.ts b/src/features/tech-log/adapters/http/http-public-content-gateway.ts index 88a6e9b..67bf30b 100644 --- a/src/features/tech-log/adapters/http/http-public-content-gateway.ts +++ b/src/features/tech-log/adapters/http/http-public-content-gateway.ts @@ -20,6 +20,7 @@ import { decisionItemToDecision, flattenRelations, knowledgeListItemToRecord, + projectRecordItemToRecord, markdownSections, questionListItemToRecord, releaseDetailToRelease, @@ -342,7 +343,7 @@ export function createHttpPublicContentGateway( const page = await read("listPublicProjectRecords", { slug: projectSlug }); if (page === NOT_FOUND) return []; return (page.items ?? []) - .map(knowledgeListItemToRecord) + .map(projectRecordItemToRecord) .filter((record): record is PublicRecord => record !== null); } diff --git a/src/features/tech-log/adapters/http/public-content-mapping.ts b/src/features/tech-log/adapters/http/public-content-mapping.ts index a7b1a6c..e88a078 100644 --- a/src/features/tech-log/adapters/http/public-content-mapping.ts +++ b/src/features/tech-log/adapters/http/public-content-mapping.ts @@ -1,5 +1,6 @@ import type { CaseRecord, + ConceptRecord, ProjectActivity, ProjectDecision, PublicRecord, @@ -215,6 +216,56 @@ export function knowledgeListItemToRecord(item: Readonly return null; } +/** + * 프로젝트 기록 목록의 한 줄. + * + *

탐색의 지식 목록과 응답 모양이 다르다 — 이쪽은 유형이 네 가지고 요약이 `summary` 한 칸에 + * 온다. 예전에는 지식 목록의 매퍼를 그대로 썼고, 그 매퍼는 CASE/REFERENCE 가 아니면 `null` 을 + * 돌려주므로 질문과 개념이 목록에서 조용히 사라졌다. 살아남은 줄도 `primarySummary`· + * `primaryTopic`·`publishedAt` 을 찾다 못 찾아 요약·주제·날짜가 빈 채로 그려졌다. + */ +export function projectRecordItemToRecord( + item: Readonly>, +): 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>): QuestionRecord { const path = String(item.path ?? ""); const slug = path.split("/").filter(Boolean).pop() ?? ""; diff --git a/src/features/tech-log/contracts/management/canonical-source.json b/src/features/tech-log/contracts/management/canonical-source.json index 807ff08..48b7f1a 100644 --- a/src/features/tech-log/contracts/management/canonical-source.json +++ b/src/features/tech-log/contracts/management/canonical-source.json @@ -2,7 +2,7 @@ "packageId": "@tech-log/management-contract", "version": "1.0.0", "digest": "sha256:762aa81e6906469939fddd833c204ed3ca53f0fa96371f18a5ea1edaf76a64e8", - "sourceRevision": "987c1b8", + "sourceRevision": "76a7ccb", "operationIds": [ "createCaseDraft", "getCaseForEdit", diff --git a/src/features/tech-log/contracts/public/canonical-source.json b/src/features/tech-log/contracts/public/canonical-source.json index 466a547..6d2c6f3 100644 --- a/src/features/tech-log/contracts/public/canonical-source.json +++ b/src/features/tech-log/contracts/public/canonical-source.json @@ -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", diff --git a/src/features/tech-log/contracts/public/generated.ts b/src/features/tech-log/contracts/public/generated.ts index 040e251..c35352a 100644 --- a/src/features/tech-log/contracts/public/generated.ts +++ b/src/features/tech-log/contracts/public/generated.ts @@ -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: { diff --git a/src/features/tech-log/contracts/public/public-api.openapi.yaml b/src/features/tech-log/contracts/public/public-api.openapi.yaml index ffbe404..c5678ab 100644 --- a/src/features/tech-log/contracts/public/public-api.openapi.yaml +++ b/src/features/tech-log/contracts/public/public-api.openapi.yaml @@ -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: diff --git a/src/features/tech-log/contracts/studio/canonical-source.json b/src/features/tech-log/contracts/studio/canonical-source.json index 605ccfb..3660266 100644 --- a/src/features/tech-log/contracts/studio/canonical-source.json +++ b/src/features/tech-log/contracts/studio/canonical-source.json @@ -2,7 +2,7 @@ "packageId": "@tech-log/studio-contract", "version": "3.1.0", "digest": "sha256:96f655d75fc19c535eb87e24f5320fdc382d6d982aaa75b67fe6acbde1ee8ff2", - "sourceRevision": "987c1b8", + "sourceRevision": "76a7ccb", "operationIds": [ "getStudioSession", "getStudioDashboard", diff --git a/tests/features/tech-log/public-project-records-mapping.test.ts b/tests/features/tech-log/public-project-records-mapping.test.ts new file mode 100644 index 0000000..b5804a9 --- /dev/null +++ b/tests/features/tech-log/public-project-records-mapping.test.ts @@ -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); +});