refactor: 템플릿에서 기본적으로 제공하고 있는 워크 플로우에 디자인과 라우팅 흡수
This commit is contained in:
@@ -0,0 +1,148 @@
|
||||
# TechLog Application Boundary + Behavioral i18n Implementation Plan
|
||||
|
||||
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox syntax for tracking.
|
||||
|
||||
**Goal:** Close the two remaining TechLog re-review items so the application API hides outbound gateways and TechLog behavioral copy is catalog-driven and enforced by `check:i18n`.
|
||||
|
||||
**Architecture:** `createTechLogStudioApplication()` owns `StudioGateway`, `StudioAssetGateway`, and `ManagementGateway` privately and exposes application-owned query/command capability objects. TechLog presentation keeps using server-state hooks, but server-state calls application capabilities rather than extracting gateway ports. Behavioral copy moves to the TechLog message catalog with interpolation, and `scripts/check-i18n.ts` gains a targeted TechLog behavioral scanner rather than a blanket Korean-literal ban.
|
||||
|
||||
**Tech Stack:** TypeScript 7, React, Vitest, pnpm, custom architecture/i18n check scripts.
|
||||
|
||||
**Spec:** `docs/superpowers/specs/2026-09-23-tech-log-application-boundary-i18n-design.md`
|
||||
|
||||
## Global Constraints
|
||||
|
||||
- Preserve all existing user changes; no reset/checkout/clean/commit/merge.
|
||||
- Use Node 24.11.0 for verification without changing repository configuration.
|
||||
- Do not intentionally change visible Korean copy or accessibility names.
|
||||
- `TechLogStudioApplication` must not expose, alias, extend, or return `StudioGateway`, `StudioAssetGateway`, or `ManagementGateway` objects.
|
||||
- Components/controllers must not gain direct gateway/application orchestration that belongs in server-state.
|
||||
- TechLog i18n gate targets behavioral copy only; headings, field labels, help text, domain status labels, and dynamic noun labels remain allowed.
|
||||
|
||||
## Review Focus
|
||||
|
||||
- Application capability methods preserve signal/idempotency options exactly; focused delegation test covers both query and mutation paths.
|
||||
- Management capability split does not drop any operation currently consumed by `studio-management-server-state.ts`; typecheck and TechLog tests pin the full surface.
|
||||
- Dynamic delete announcements preserve interpolation values and Korean rendering.
|
||||
- i18n gate rejects direct behavioral announcements/actions but permits headings/field labels/domain status literals.
|
||||
- Existing accessible copy such as `저장 중` remains byte-for-byte unchanged.
|
||||
|
||||
---
|
||||
|
||||
### Task 1: Application-owned Studio capability boundary
|
||||
|
||||
**Files:**
|
||||
- Modify: `src/features/tech-log/application/studio-application.ts`
|
||||
- Modify: `src/features/tech-log/adapters/create-tech-log-feature-input.ts`
|
||||
- Modify: `src/features/tech-log/presentation/studio/studio-workspace-server-state.ts`
|
||||
- Modify: `src/features/tech-log/presentation/studio/studio-document-server-state.ts`
|
||||
- Modify: `src/features/tech-log/presentation/studio/studio-asset-server-state.ts`
|
||||
- Modify: `src/features/tech-log/presentation/studio/studio-management-server-state.ts`
|
||||
- Test: `tests/features/tech-log/studio-application-boundary.test.ts`
|
||||
|
||||
**Interfaces:**
|
||||
- Produces: `createTechLogStudioApplication({ studio, assets, management }): TechLogStudioApplication`
|
||||
- Produces capability properties: `workspaceQueries`, `workspaceCommands`, `documentQueries`, `documentCommands`, `assetQueries`, `assetCommands`, `managementQueries`, `managementCommands`.
|
||||
- Consumes existing DTOs/return types and request/idempotency option types; outbound port types are private factory dependencies only.
|
||||
|
||||
- [ ] **Step 1: Write failing boundary/delegation test**
|
||||
|
||||
Create a focused test that constructs spy-like in-memory gateways, calls representative application capability methods, and asserts delegation. Add static assertions that the public application value has no `documents`, `assets`, or `management` properties.
|
||||
|
||||
- [ ] **Step 2: Run the focused test and verify RED**
|
||||
|
||||
Run under Node 24.11.0:
|
||||
`corepack pnpm exec vitest run tests/features/tech-log/studio-application-boundary.test.ts`
|
||||
Expected: FAIL because `createTechLogStudioApplication` / application-owned capability properties do not exist yet.
|
||||
|
||||
- [ ] **Step 3: Implement minimal application capability API**
|
||||
|
||||
Define application-owned query/command capability types with explicit method signatures copied from current port operations, then implement `createTechLogStudioApplication()` with frozen capability objects delegating to the private gateways.
|
||||
|
||||
- [ ] **Step 4: Wire composition root and server-state**
|
||||
|
||||
Change `create-tech-log-feature-input.ts` to call the factory. Replace all `application.documents/assets/management` extraction in Studio server-state with the corresponding query/command capability object. Do not change component/controller public APIs unless type propagation requires it.
|
||||
|
||||
- [ ] **Step 5: Run focused + type/architecture checks**
|
||||
|
||||
Run:
|
||||
`corepack pnpm exec vitest run tests/features/tech-log/studio-application-boundary.test.ts`
|
||||
`corepack pnpm check:types`
|
||||
`corepack pnpm check:architecture`
|
||||
Expected: PASS.
|
||||
|
||||
### Task 2: TechLog behavioral copy catalog migration and i18n gate
|
||||
|
||||
**Files:**
|
||||
- Modify: `src/features/tech-log/contracts/tech-log-message-catalog.ts`
|
||||
- Modify: affected files under `src/features/tech-log/presentation/studio/**`
|
||||
- Modify: affected files under `src/features/tech-log/presentation/public/**`
|
||||
- Modify: `scripts/check-i18n.ts`
|
||||
- Modify/Create: `tests/unit/i18n-contract.test.ts` and/or `tests/fixtures/i18n/**` as appropriate to the existing checker test harness.
|
||||
|
||||
**Interfaces:**
|
||||
- Consumes: existing `useTechLogCopy()` / locale message interpolation API.
|
||||
- Produces: catalog keys for behavioral notices/failures/public error states and interpolation keys for dynamic deletion announcements.
|
||||
- Produces: targeted TechLog behavioral checker integrated into `check:i18n`.
|
||||
|
||||
- [ ] **Step 1: Add failing i18n checker tests/fixtures**
|
||||
|
||||
Add one forbidden fixture representing a direct TechLog behavioral literal such as `setNotice("삭제했습니다.")` and one allowed fixture representing a heading/field label/domain status literal. Ensure the checker distinguishes them.
|
||||
|
||||
- [ ] **Step 2: Run i18n test/check and verify RED**
|
||||
|
||||
Run `corepack pnpm check:i18n` and the focused i18n unit test command used by `tests/unit/i18n-contract.test.ts`.
|
||||
Expected: the new behavioral negative fixture is not detected yet.
|
||||
|
||||
- [ ] **Step 3: Implement targeted TechLog behavioral scanner**
|
||||
|
||||
Keep the existing common-presentation blanket scan unchanged. Add TechLog presentation files as a separate source set and inspect targeted contexts: static Button action text, action-label props, `setRequestAnnouncement`, `setNotice`, `setSuccess`, failure/error/loading/empty/not-found fallback literals, and public error/retry surfaces. Catalog calls and interpolated message calls must pass. Editorial/domain literals must pass.
|
||||
|
||||
- [ ] **Step 4: Migrate actual behavioral literals**
|
||||
|
||||
Move the currently identified Studio/Public notices/failures/error states into `tech-log-message-catalog.ts` for `ko-KR` and `en-US`. Convert dynamic delete announcements to message interpolation. Preserve rendered Korean strings and existing accessibility names.
|
||||
|
||||
- [ ] **Step 5: Run focused i18n + TechLog tests**
|
||||
|
||||
Run:
|
||||
`corepack pnpm check:i18n`
|
||||
`corepack pnpm test:tech-log`
|
||||
Expected: PASS with zero TechLog behavioral literal violations.
|
||||
|
||||
### Task 3: Final regression and re-review evidence
|
||||
|
||||
**Files:**
|
||||
- Modify: `docs/reviews/2026-09-22-tech-log-template-utilization-rereview.md`
|
||||
- Create or update: `docs/reviews/2026-09-23-tech-log-template-utilization-rereview.md`
|
||||
|
||||
**Interfaces:**
|
||||
- Consumes Tasks 1-2 outputs.
|
||||
- Produces final 10-item re-review evidence only after fresh verification passes.
|
||||
|
||||
- [ ] **Step 1: Run all required checks under Node 24.11.0**
|
||||
|
||||
Run exactly:
|
||||
`corepack pnpm check:types`
|
||||
`corepack pnpm lint`
|
||||
`corepack pnpm check:architecture`
|
||||
`corepack pnpm check:design-system`
|
||||
`corepack pnpm check:tech-log-contract`
|
||||
`corepack pnpm check:i18n`
|
||||
`corepack pnpm test:tech-log`
|
||||
`corepack pnpm test:component`
|
||||
`corepack pnpm build:app-only`
|
||||
`git diff --check`
|
||||
Expected: all PASS.
|
||||
|
||||
- [ ] **Step 2: Collect static evidence**
|
||||
|
||||
Record counts for application gateway type exposure, presentation gateway port imports, raw gateway extraction, component/controller gateway direct calls, TechLog behavioral literal violations, raw native controls/form/dialog, and controller files.
|
||||
Expected: gateway/i18n/raw DOM violations 0; controllers 5.
|
||||
|
||||
- [ ] **Step 3: Update re-review docs**
|
||||
|
||||
Only after fresh verification, update the review from `완료: 8 / 아직 더 봐야댐: 2` to `완료: 10 / 아직 더 봐야댐: 0`, with actual current test counts and commands.
|
||||
|
||||
- [ ] **Step 4: No commit**
|
||||
|
||||
Do not commit. Preserve the user's existing dirty worktree and report only changed files and fresh verification evidence.
|
||||
Reference in New Issue
Block a user