feat: 주제 화면을 계약에 잇고, 등록을 잊는 사고를 가드로 막는다
주제 화면은 주제 셋(`jpa`, `authentication`, `redis`)을 코드에 적어 두고 그 셋만
열었다. 제목과 설명까지 코드에 있었고, 목록에 없는 주제는 기록이 멀쩡히 있어도 404 로
갔다 — 픽스처의 `kubernetes` 가 그랬다. 계약에는 처음부터 `/topics/{slug}` 가 있었지만
아무도 부르지 않았다. 이제 그 연산을 부르고, 주제가 답하는 질문(논지)과 그 질문에 대해
실제로 만들어 본 답들(축)을 화면의 뼈대로 둔다.
프로젝트의 논지도 마찬가지다. 담을 칸이 없어 목적(`purpose`)을 대신 보여 주고
있었는데, 목적은 시작할 때 쓰는 글이라 화면에는 늘 시작할 때의 말만 남았다.
축 CRUD 네 연산은 계약에 있으면서 기여 목록에 없었다 — 등록되지 않은 연산은 타입에는
멀쩡히 보이는데 부를 수가 없다. `getPublicConcept` 과 `deleteConceptDraft` 가 정확히
그래서 못 불렸고, 개념 삭제가 질문 삭제를 불러 "질문을 찾을 수 없습니다" 가 떴다.
그래서 가드를 둘 넣는다. 공개 계약은 전수 대조하고(봉투 없이 바이트를 주는 `/media` 만
면제), 관리 계약은 **한 종류만 빠진 자리**를 본다 — 깨진 것이 늘 그 모양이었다.
개념 삭제 등록을 지워 보고 실제로 멈추는 것을 확인했다.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011nAjrqNHGPNngN4aUbcyvJ
This commit is contained in:
co-authored by
Claude Opus 5
parent
618a228eff
commit
15e6ea8f15
@@ -2,7 +2,7 @@
|
||||
"packageId": "@tech-log/management-contract",
|
||||
"version": "1.0.0",
|
||||
"digest": "sha256:5452be2aa2ac4164c82db393ae94eb0b7dcfa27c34a26dcd73f26f9f1a8e8998",
|
||||
"sourceRevision": "ca1bbfe",
|
||||
"sourceRevision": "0f4d2cd",
|
||||
"operationIds": [
|
||||
"createCaseDraft",
|
||||
"getCaseForEdit",
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"packageId": "@tech-log/public-contract",
|
||||
"version": "2.1.0",
|
||||
"digest": "sha256:92c15205d373bd7048d9596e75b211c30198bb4fb3339e1d7f92a2acabe75440",
|
||||
"sourceRevision": "ca1bbfe",
|
||||
"digest": "sha256:08b68601bd81c569926e7374a0c95711a5982da332e6edc6c811fe08d2fd19db",
|
||||
"sourceRevision": "0f4d2cd",
|
||||
"operationIds": [
|
||||
"getPublicSite",
|
||||
"getPublicHome",
|
||||
|
||||
@@ -745,6 +745,11 @@ export interface components {
|
||||
name: string;
|
||||
slug: string;
|
||||
oneLinePurpose: string;
|
||||
/** @description 이 프로젝트가 무엇을 밝혔는가. 사람이 쓰는 한 문단이고, 기록을 합쳐 자동으로
|
||||
* 나오지 않는다. 프로젝트 화면의 첫 문단이 이것이다 — 담을 칸이 없어 오래
|
||||
* `purpose` 를 대신 보여 주고 있었고, 그쪽은 목적이지 결론이 아니다.
|
||||
* */
|
||||
thesis?: string;
|
||||
purpose: string;
|
||||
boundary: string;
|
||||
phase: string;
|
||||
|
||||
@@ -1758,6 +1758,13 @@ components:
|
||||
type: string
|
||||
oneLinePurpose:
|
||||
type: string
|
||||
thesis:
|
||||
type: string
|
||||
maxLength: 2000
|
||||
description: |
|
||||
이 프로젝트가 무엇을 밝혔는가. 사람이 쓰는 한 문단이고, 기록을 합쳐 자동으로
|
||||
나오지 않는다. 프로젝트 화면의 첫 문단이 이것이다 — 담을 칸이 없어 오래
|
||||
`purpose` 를 대신 보여 주고 있었고, 그쪽은 목적이지 결론이 아니다.
|
||||
purpose:
|
||||
type: string
|
||||
boundary:
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"packageId": "@tech-log/studio-contract",
|
||||
"version": "3.1.0",
|
||||
"digest": "sha256:d2bfbe0a12136f131ccb8c42f8868108ba8d0f0182b347f9b815316c343a970c",
|
||||
"sourceRevision": "ca1bbfe",
|
||||
"sourceRevision": "0f4d2cd",
|
||||
"operationIds": [
|
||||
"getStudioSession",
|
||||
"getStudioDashboard",
|
||||
|
||||
@@ -211,6 +211,66 @@ const HTTP_CONTRACTS = Object.freeze([
|
||||
});
|
||||
},
|
||||
),
|
||||
/*
|
||||
주제 안의 축(variant). 계약에 네 연산이 있는데 여기 등록되지 않으면 화면에서 부를 수가
|
||||
없다 — `getPublicConcept` 과 `deleteConceptDraft` 가 정확히 그래서 못 불렸다.
|
||||
*/
|
||||
readOperation("listTopicVariants", `${T}/{id}/variants`, 65_536, byId),
|
||||
writeOperation(
|
||||
"createTopicVariant",
|
||||
"POST",
|
||||
`${T}/{id}/variants`,
|
||||
{ acceptedStatuses: [201], requestByteLimit: 16_384, responseByteLimit: 16_384 },
|
||||
(input: never) => {
|
||||
const value = input as unknown as Readonly<{ id: string; body: unknown }>;
|
||||
return Object.freeze({
|
||||
pathValues: Object.freeze({ id: value.id }),
|
||||
queryEntries: NO_QUERY,
|
||||
body: value.body,
|
||||
});
|
||||
},
|
||||
),
|
||||
writeOperation(
|
||||
"updateTopicVariant",
|
||||
"PUT",
|
||||
`${T}/{id}/variants/{variantId}`,
|
||||
{ acceptedStatuses: [200], requestByteLimit: 16_384, responseByteLimit: 16_384 },
|
||||
(input: never) => {
|
||||
const value = input as unknown as Readonly<{
|
||||
id: string;
|
||||
variantId: string;
|
||||
body: unknown;
|
||||
}>;
|
||||
return Object.freeze({
|
||||
pathValues: Object.freeze({ id: value.id, variantId: value.variantId }),
|
||||
queryEntries: NO_QUERY,
|
||||
body: value.body,
|
||||
});
|
||||
},
|
||||
),
|
||||
writeOperation(
|
||||
"deleteTopicVariant",
|
||||
"DELETE",
|
||||
`${T}/{id}/variants/{variantId}`,
|
||||
{
|
||||
acceptedStatuses: [204],
|
||||
emptyBodyStatuses: [204],
|
||||
requestByteLimit: 1_024,
|
||||
responseByteLimit: 1_024,
|
||||
},
|
||||
(input: never) => {
|
||||
const value = input as unknown as Readonly<{
|
||||
id: string;
|
||||
variantId: string;
|
||||
expectedVersion: number;
|
||||
}>;
|
||||
return Object.freeze({
|
||||
pathValues: Object.freeze({ id: value.id, variantId: value.variantId }),
|
||||
queryEntries: NO_QUERY,
|
||||
body: { expectedVersion: value.expectedVersion },
|
||||
});
|
||||
},
|
||||
),
|
||||
readOperation("listStudioProjects", P, 262_144, (input: never) => {
|
||||
const value = input as unknown as Readonly<{ page?: number; size?: number }> | undefined;
|
||||
const entries: (readonly [string, string])[] = [];
|
||||
|
||||
Reference in New Issue
Block a user