fix: 홈의 「지금 집중하는 것」이 단계를 사람 말로 적는다

새로 찍은 화면에서 드러났다. 홈은 `DESIGN` 이라는 저장값을 그대로 찍고 있었고,
프로젝트 화면은 같은 값을 「설계」로 부르고 있었다 — 한 사이트가 같은 것을 두 이름으로
말했다. 활동 종류에서 겪은 것과 같은 실수다.

이름표를 도메인으로 옮긴다. 어댑터는 표현 계층을 import 할 수 없고(경계 규칙), 이름표를
어댑터마다 다시 적으면 정확히 이 문제가 다시 난다. 단계 집합도 도메인이 갖게 해서 포트가
그것을 쓰도록 했다 — 같은 집합을 두 곳에 적으면 한쪽만 늘어난다.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015c8cBFUaVr7KLVUx6ujz7D
This commit is contained in:
DongHyeonka
2026-09-15 21:12:34 +09:00
co-authored by Claude Opus 5
parent 9b5ca09f30
commit 623a58942f
10 changed files with 29 additions and 14 deletions
@@ -31,6 +31,7 @@ import {
import { cardSummary } from "../../domain/content-format/card-summary.ts";
import type { components } from "../../contracts/public/generated.ts";
import type { StudioOperationExecutor } from "./http-studio-gateway.ts";
import { projectStageLabel } from "../../domain/public/project-phase-labels.ts";
const ROUTE_ID = "TECH_LOG_PUBLIC";
@@ -576,7 +577,12 @@ export function createHttpPublicContentGateway(
title: String(work.projectName ?? ""),
summary: String(work.purpose ?? ""),
details: Object.freeze([
{ label: "단계", value: String(work.phase ?? "") },
/*
단계는 저장하는 값(`DESIGN`)이지 방문자에게 할 말이 아니다. 홈의 「지금 집중하는
것」이 그 상수를 그대로 찍고 있었다 — 프로젝트 화면은 같은 값을 「설계」로 부르고
있어서, 한 사이트가 같은 것을 두 이름으로 말했다.
*/
{ label: "단계", value: projectStageLabel(String(work.phase ?? "")) },
{ label: "현재 목표", value: String(work.currentObjective ?? "") },
{ label: "다음 작업", value: String(work.nextStep ?? "") },
]),
@@ -10,6 +10,7 @@ import {
type Release,
type HomeFocusItem,
} from "./public-content.ts";
import { projectStageLabel } from "../../domain/public/project-phase-labels.ts";
import type {
LatestRecordEntry,
PublicContentQueries,
@@ -257,7 +258,7 @@ export function getHomeFocusItems(): HomeFocusItem[] {
title: project.title,
summary: project.summary,
details: [
{ label: "단계", value: project.stage },
{ label: "단계", value: projectStageLabel(project.stage) },
{ label: "현재 목표", value: project.currentGoal },
{ label: "다음 작업", value: project.nextStep },
],
@@ -1,3 +1,5 @@
import type { PublicProjectStage } from "../../domain/public/project-phase-labels.ts";
/*
화면이 다루는 기록 종류. Studio 계약의 `RecordKind` 와 같은 집합이어야 한다 — 다만 결정은
자기 상세 화면이 없어 여기 없다.
@@ -215,7 +217,8 @@ export type Project = {
title: string;
summary: string;
thesis: string;
stage: "DESIGN" | "VALIDATION";
/* 이름표는 도메인이 갖는다. 같은 집합을 두 곳에 적으면 한쪽만 늘어난다. */
stage: PublicProjectStage;
currentGoal: string;
nextStep: string;
/*
@@ -1,4 +1,8 @@
import type { Project } from "../../application/ports/public-content-queries.ts";
/**
* 공개 조회가 접어서 주는 단계. 포트가 같은 집합을 쓰며(`Project["stage"]`), 어긋나면
* `projectStageLabel` 을 부르는 화면에서 타입 검사가 잡는다.
*/
export type PublicProjectStage = "DESIGN" | "VALIDATION";
/**
* 프로젝트가 지금 어디까지 왔는지를 사람에게 보여 주는 이름.
@@ -23,15 +27,15 @@ export const PROJECT_PHASE_LABELS: Record<string, string> = {
/**
* 공개 조회가 접어서 주는 단계.
*
* <p>`Record<Project["stage"], string>` 이므로 계약이 값을 늘리면 여기가 비어 있는 것을
* 컴파일러가 잡는다.
* <p>`Record<PublicProjectStage, string>` 이므로 값이 늘면 여기가 비어 있는 것을 컴파일러가
* 잡는다.
*/
export const PROJECT_STAGE_LABELS: Record<Project["stage"], string> = {
export const PROJECT_STAGE_LABELS: Record<PublicProjectStage, string> = {
DESIGN: "설계",
VALIDATION: "검증",
};
/** 모르는 값이 오면 원문을 그대로 보여 준다 — 빈 칸보다 낫고, 무엇이 빠졌는지도 드러난다. */
export function projectStageLabel(stage: string): string {
return PROJECT_STAGE_LABELS[stage as Project["stage"]] ?? PROJECT_PHASE_LABELS[stage] ?? stage;
return PROJECT_STAGE_LABELS[stage as PublicProjectStage] ?? PROJECT_PHASE_LABELS[stage] ?? stage;
}
@@ -1,5 +1,5 @@
import { Link } from "react-router-dom";
import { projectStageLabel } from "../../shared/project-phase-labels.ts";
import { projectStageLabel } from "../../../domain/public/project-phase-labels.ts";
import { TECH_LOG_FEATURE_ID } from "../../../application/tech-log-feature-input.ts";
import { publicSiteConfig } from "../../../contracts/public-site-config.ts";
@@ -1,5 +1,5 @@
import { Link } from "react-router-dom";
import { projectStageLabel } from "../../shared/project-phase-labels.ts";
import { projectStageLabel } from "../../../domain/public/project-phase-labels.ts";
import {
RegisteredNotFoundRoute,
@@ -1,5 +1,5 @@
import { Link } from "react-router-dom";
import { projectStageLabel } from "../../shared/project-phase-labels.ts";
import { projectStageLabel } from "../../../domain/public/project-phase-labels.ts";
import { usePublicContent } from "../use-public-content.tsx";
@@ -1,5 +1,5 @@
import { useCallback, useEffect, useState, type FormEvent } from "react";
import { PROJECT_PHASE_LABELS } from "../../shared/project-phase-labels.ts";
import { PROJECT_PHASE_LABELS } from "../../../domain/public/project-phase-labels.ts";
import type { components } from "../../../contracts/studio/generated.ts";
import type {
@@ -1,5 +1,5 @@
import { useCallback, useEffect, useState, type FormEvent } from "react";
import { PROJECT_PHASE_LABELS } from "../../shared/project-phase-labels.ts";
import { PROJECT_PHASE_LABELS } from "../../../domain/public/project-phase-labels.ts";
import { DestructiveConfirmDialog } from "./destructive-confirm-dialog.tsx";
import type { ProjectIndexItem, TopicEdit } from "../../../contracts/management/contract.ts";