From ad8f322b43d53ff43fd756c01aeecabafd75d2e8 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Wed, 26 Aug 2026 22:56:21 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=A7=88=EB=AC=B8=20=EB=A8=B8=EB=A6=AC?= =?UTF-8?q?=EB=A7=90=EC=9D=B4=20=EA=B4=80=EA=B3=84=EC=97=90=20=EB=8B=B4?= =?UTF-8?q?=EA=B8=B4=20=ED=94=84=EB=A1=9C=EC=A0=9D=ED=8A=B8=EB=A5=BC=20?= =?UTF-8?q?=EC=9D=BD=EB=8A=94=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 질문 상세는 프로젝트를 `question` 이 아니라 `relations.primaryProject` 에 담는다 — Case/Reference 와 다른 자리다. `question` 에서 찾고 있었으므로 머리말의 프로젝트 칸이 늘 비어 있었다. 그 자리의 값은 `RelatedEntry` 라 `title`/`path` 를 쓴다. 머리말이 기다리는 것은 `name`/`slug` 이므로 옮겨 준다 — slug 는 경로의 마지막 마디다. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_0189NzCryfeqDzS81EWidnBx --- .../adapters/http/http-public-content-gateway.ts | 14 +++++++++++++- .../tech-log/public-question-mapping.test.ts | 4 ++++ 2 files changed, 17 insertions(+), 1 deletion(-) 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 390c3f7..88a6e9b 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 @@ -142,6 +142,10 @@ export function createHttpPublicContentGateway( const canonicalPath = String(detail.canonicalPath ?? ""); const groups = (detail.relations as Readonly>) ?? {}; + const projectOf = (entry: Readonly<{ title?: string; path?: string }> | undefined) => + entry?.path + ? { name: entry.title ?? "", slug: entry.path.split("/").filter(Boolean).pop() ?? "", path: entry.path } + : undefined; if (kind === "CASE") { const body = (detail.case as Readonly>) ?? {}; @@ -254,7 +258,15 @@ export function createHttpPublicContentGateway( summary: body.summary as string, path: canonicalPath, primaryTopic: body.primaryTopic as never, - primaryProject: body.primaryProject as never, + /* + 질문 상세는 프로젝트를 `question` 이 아니라 `relations.primaryProject` 에 담는다 — + Case/Reference 와 다른 자리다. `question` 에서 찾고 있었으므로 머리말의 프로젝트 + 칸이 늘 비어 있었다. + + 그 자리의 값은 `RelatedEntry` 라 `title`/`path` 를 쓴다. 머리말이 기다리는 것은 + `name`/`slug` 이므로 여기서 옮겨 준다 — slug 는 경로의 마지막 마디다. + */ + primaryProject: projectOf(groups.primaryProject) as never, publishedAt: body.updatedAt as string, /* 계약이 주는 이름은 `resultCase` / `producedDecision` / `derivedReferences` 다. diff --git a/tests/features/tech-log/public-question-mapping.test.ts b/tests/features/tech-log/public-question-mapping.test.ts index c356841..621d678 100644 --- a/tests/features/tech-log/public-question-mapping.test.ts +++ b/tests/features/tech-log/public-question-mapping.test.ts @@ -84,6 +84,10 @@ test("a published Open Question maps its four point groups into the screen's fie assert.deepEqual([...record.unknowns], DETAIL.question.points.unknowns); assert.deepEqual([...record.constraints], DETAIL.question.points.constraints); assert.equal(record.nextValidation, DETAIL.question.nextVerification); + // 질문 상세는 프로젝트를 `relations` 에 담는다 — `question` 에서 찾으면 머리말의 프로젝트 + // 칸이 늘 비어 있다. + assert.equal(record.projectTitle, "KeyCloak Patterns"); + assert.equal(record.projectSlug, "keycloak-patterns"); }); /*