fix: 관계 요약이 화면까지 닿게 한다

라벨은 고쳤는데 요약이 여전히 비어 있었다. 값이 경계 세 곳을 지나며 사라진다:
평탄화가 담고(고침), 렌더 모델로 바꿀 때 버리고, 화면 목록으로 넘길 때 또
버렸다. 렌더 모델 계약(ResolvedRelation)에 담을 자리 자체가 없었고
additionalProperties: false 라 실을 수도 없었다.

계약에 summary 를 더하고(required 아님 — 이미 나가 있는 응답을 깨지 않는다)
세 경계를 모두 잇는다. Studio 미리보기도 같은 렌더 모델을 쓰므로 그쪽에서도
같은 요약이 보인다.

가드는 요약이 화면에 그려지는 것과, 그것이 링크 이름에는 들어가지 않는 것을
함께 본다 — 이름에 들어가면 관계 목록을 훑을 때 링크 하나가 문단이 된다.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011nAjrqNHGPNngN4aUbcyvJ
This commit is contained in:
DongHyeonka
2026-08-31 11:10:15 +09:00
co-authored by Claude Opus 5
parent 642afa878c
commit a3ed23e073
9 changed files with 54 additions and 9 deletions
+5 -5
View File
@@ -38,28 +38,28 @@
},
"contractSet": {
"setAlgorithm": "CA_CONTRACT_SET_V1",
"setDigest": "sha256:c841cbe2de536a2e3879e8dd42a9471f674d8164b1c0698bc6acd90a59721f43",
"setDigest": "sha256:c7c1680c3ff437bb8e41ee534e14e8a42b41689bc341f613d425814a6cc6a7c2",
"packages": [
{
"packageId": "@tech-log/management-contract",
"version": "1.0.0",
"digest": "sha256:a422ff091cdba5f17a27edfa12fec06e077bcc52c9615136ddecfa8df58a5f6e",
"runtimeProtocolVersion": 1,
"sourceRevision": "f56a03b"
"sourceRevision": "fa67a64"
},
{
"packageId": "@tech-log/public-contract",
"version": "2.1.0",
"digest": "sha256:afe415880eb5d6289ae10abf493333c97270c323c16a7245a466d4db4466e630",
"runtimeProtocolVersion": 1,
"sourceRevision": "f56a03b"
"sourceRevision": "fa67a64"
},
{
"packageId": "@tech-log/studio-contract",
"version": "3.1.0",
"digest": "sha256:7e1ee18f7e6a6cb1750dd0baec28d975fb3b535116d8dfb57c17ae16ee8d2be8",
"digest": "sha256:7de83618e7bf5e0816f12136be91abc0e779c3ee06f86276a2b2498a5d51a4e0",
"runtimeProtocolVersion": 1,
"sourceRevision": "f56a03b"
"sourceRevision": "fa67a64"
}
]
}
@@ -2,7 +2,7 @@
"packageId": "@tech-log/management-contract",
"version": "1.0.0",
"digest": "sha256:a422ff091cdba5f17a27edfa12fec06e077bcc52c9615136ddecfa8df58a5f6e",
"sourceRevision": "f56a03b",
"sourceRevision": "fa67a64",
"operationIds": [
"createCaseDraft",
"getCaseForEdit",
@@ -2,7 +2,7 @@
"packageId": "@tech-log/public-contract",
"version": "2.1.0",
"digest": "sha256:afe415880eb5d6289ae10abf493333c97270c323c16a7245a466d4db4466e630",
"sourceRevision": "f56a03b",
"sourceRevision": "fa67a64",
"operationIds": [
"getPublicSite",
"getPublicHome",
@@ -1,8 +1,8 @@
{
"packageId": "@tech-log/studio-contract",
"version": "3.1.0",
"digest": "sha256:7e1ee18f7e6a6cb1750dd0baec28d975fb3b535116d8dfb57c17ae16ee8d2be8",
"sourceRevision": "f56a03b",
"digest": "sha256:7de83618e7bf5e0816f12136be91abc0e779c3ee06f86276a2b2498a5d51a4e0",
"sourceRevision": "fa67a64",
"operationIds": [
"getStudioSession",
"getStudioDashboard",
@@ -883,6 +883,7 @@ export interface components {
title: string;
publicPath: string | null;
reason: string;
summary?: string;
order: number;
};
RenderContext: {
@@ -1265,6 +1265,9 @@ components:
title: { type: string, minLength: 1, maxLength: 200 }
publicPath: { type: [string, "null"], maxLength: 500 }
reason: { type: string, maxLength: 100000 }
# 대상 문서의 요약. 관계 목록에서 제목만 보이면 왜 이것이 걸려 있는지 눌러 봐야 알 수
# 있다. required 에 넣지 않는 이유는 이미 나가 있는 응답을 깨지 않기 위해서다.
summary: { type: string, maxLength: 2000 }
order: { type: integer, minimum: 0 }
RenderContext:
type: object
@@ -41,6 +41,8 @@ export function publicRenderModelBase(
title: relation.title,
publicPath: relation.path,
reason: relation.reason,
/* 계약이 관계마다 주는 요약. 여기서 버리면 목록에 제목만 남는다. */
summary: relation.summary,
order: index + 1,
})),
renderContext: {
@@ -121,6 +121,7 @@ function publicRelations(
reason: relation.reason,
title: relation.title,
path: relation.publicPath,
summary: relation.summary,
}));
}
+38
View File
@@ -76,3 +76,41 @@ describe("릴리스 노트 목록 읽기", () => {
expect(markdownLines("1. 첫째\n2. 둘째")).toEqual(["첫째", "둘째"]);
});
});
/**
* 관계 목록의 요약. 계약은 관계마다 요약을 주는데 경계 세 곳(평탄화 → 렌더 모델 → 화면 목록)을
* 지나며 조용히 사라졌다. 독자가 목록에서 보는 것이 제목뿐이라, 왜 이 기록이 걸려 있는지는
* 눌러 봐야 알 수 있었다.
*/
describe("관계 목록", () => {
it("대상 요약을 제목 아래 보여 주되 링크 이름에는 넣지 않는다", async () => {
const { PublicDocumentRelations } = await import(
"../../src/features/tech-log/presentation/shared/public-render/public-document-relations.tsx"
);
const { MemoryRouter: Router } = await import("react-router-dom");
const { container, getByRole } = render(
<Router>
<PublicDocumentRelations
relations={[
{
reason: "이 기준의 근거가 된 기록",
title: "SPA에서 토큰을 직접 관리하면서 드러난 경계",
path: "/cases/spa-browser-credential-boundary",
summary: "SPA가 public OAuth client로 code를 직접 교환한다.",
},
]}
/>
</Router>,
);
expect(container.querySelector(".document-relations li p")).toHaveTextContent(
"SPA가 public OAuth client로 code를 직접 교환한다.",
);
/*
링크 이름에 요약이 들어가면 관계 목록을 훑을 때 링크 하나하나가 문단이 되어 목록으로서
쓸모가 없어진다 — 이름은 「관계 이름 + 제목」까지다.
*/
const link = getByRole("link", { name: /이 기준의 근거가 된 기록/ });
expect(link.getAttribute("aria-label")).toBeNull();
expect(link).not.toHaveAccessibleName(/code를 직접 교환/);
});
});