From 7411d4a4048519d424bacef2ce99a79ca39c91a9 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Wed, 4 Nov 2026 23:35:16 +0900 Subject: [PATCH] =?UTF-8?q?test(scaffold):=20=EC=83=9D=EC=84=B1=20?= =?UTF-8?q?=EB=93=9C=EB=A6=B4=EC=9D=B4=20--with-create=20=EC=93=B0?= =?UTF-8?q?=EA=B8=B0=20slice=EB=8F=84=20=EB=A7=8C=EB=93=A4=EA=B3=A0=20?= =?UTF-8?q?=EA=B2=8C=EC=9D=B4=ED=8A=B8=EB=A5=BC=20=EB=8F=88=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제 --with-create(NEVER)와 --with-create --keyed(KEYED)가 만드는 코드는 단위 테스트가 텍스트로만 본다. FE-GATE-020의 두 드릴(test:feature-scaffold, test:sample-removal)은 기본 기능 하나만 만들어 게이트를 돈다. 그래서 쓰기 slice의 타입·lint·테스트·빌드가 머지 게이트에서 깨져도 모른다(16 5.3절의 "생성 결과를 매번 게이트로 돌린다"는 전제). 고른 방법 - scripts/test-feature-scaffold.ts: 기본 기능(scaffold-feature) 옆에 scaffold-write-feature를 --with-create --keyed로 하나 더 만들고, 둘 다 만들어졌을 때 같은 게이트를 한 번 돈다. 바꾼 것은 WRITE_FEATURE_ID 상수, create-feature-write 검사 한 개, 게이트 조건(created && createdWrite), 머리 주석이다. - scripts/test-sample-removal.ts: 참조 기능을 지운 복사본의 create:feature 인자에 --with-create 한 개를 더했다. 쓰기 slice도 샘플에 기대지 않는다는 증거다. - 세 변형(기본, NEVER, KEYED)이 모두 드릴의 게이트를 지난다. - reference/create-feature.md의 드릴 설명을 맞췄다. 버린 대안 - 드릴 기능 하나를 --with-create로 바꾸기: 기본 변형이 게이트에서 빠진다. 위험·한계 - test:feature-scaffold는 기능 하나만큼(create:feature 한 번과 그 기능의 테스트) 길어진다. 게이트는 한 번만 돈다. - 다른 작업(게이트 담당)이 같은 두 파일의 명령 목록을 고칠 수 있다. 내 수정은 위 줄로 좁혔다. 검증 - flock 아래 CHOKIDAR_USEPOLLING=1 corepack pnpm test:feature-scaffold: rc=0, "feature scaffold: PASS (17 checks)" (생성 2 + 게이트 15), 162초. - 같은 조건 corepack pnpm test:sample-removal: rc=0, "reference-feature removal: PASS (23 checks, no fixture IDs)". 참조 기능을 지운 복사본에서 --with-create 기능을 만든 뒤 scaffold-* 게이트 9개가 모두 통과했다. 첫 실행은 tests/unit/create-feature.test.ts에 샘플 ID 문자열이 있어 fixture-id-residue로 실패했고, 그 테스트를 앞 커밋에서 고친 뒤 통과했다. Refs: docs/reviews/2026-11-03-maturity-review/09-app-core.md 09-06 Refs: docs/reviews/2026-11-03-maturity-review/16-structure-patterns.md 16-01 --- docs/manual/reference/create-feature.md | 4 ++-- scripts/test-feature-scaffold.ts | 14 +++++++++++--- scripts/test-sample-removal.ts | 3 +++ 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/docs/manual/reference/create-feature.md b/docs/manual/reference/create-feature.md index ec1cc915..da64e4d8 100644 --- a/docs/manual/reference/create-feature.md +++ b/docs/manual/reference/create-feature.md @@ -149,10 +149,10 @@ corepack pnpm generate:feature-index - 백엔드 경로 규칙, `--with-create`·`--keyed`의 descriptor 값, 모든 operation의 Envelope 선언. - 생성한 context 선언을 임시 폴더에 써서 생성기의 선언 읽기(`createFileSystemDeclarationSource`)로 읽고, 그 모듈을 import해 라우트 루트가 기능 라우트를 모두 받는지 앱 모듈 조립으로 확인한다. - `test:feature-scaffold` (FE-GATE-020) - - 저장소 복사본에 기능 하나를 만들고 커밋한 뒤 게이트를 돈다. + - 저장소 복사본에 기능 둘(기본 하나, `--with-create --keyed` 하나)을 만들고 커밋한 뒤 게이트를 돈다. - 타입, lint, 아키텍처, 레지스트리, i18n, 디자인 시스템, 진단, 문서, unit, component, integration, 기능 테스트, 커버리지, CI 계약, 빌드. - `test:sample-removal` (FE-GATE-020) - - 참조 기능을 지운 복사본에서 이 명령으로 기능을 만들고 같은 게이트를 다시 돈다. 명령이 참조 기능에 기대지 않는다는 증거다. + - 참조 기능을 지운 복사본에서 이 명령(`--with-create`)으로 기능을 만들고 같은 게이트를 다시 돈다. 명령과 쓰기 slice가 참조 기능에 기대지 않는다는 증거다. ## 알려진 한계 diff --git a/scripts/test-feature-scaffold.ts b/scripts/test-feature-scaffold.ts index 61654558..495c5f1a 100644 --- a/scripts/test-feature-scaffold.ts +++ b/scripts/test-feature-scaffold.ts @@ -14,11 +14,14 @@ import { /** * U7. A feature from `create:feature` passes the merge gates without an edit * and breaks no other test. A copy of the repository, sample feature - * included, gets one generated feature and then runs the gates. + * included, gets a default feature and a `--with-create --keyed` one, then + * runs the gates. * test:sample-removal repeats the generation after deleting the sample * (decision 4), which proves the command needs nothing from it. */ const FEATURE_ID = "scaffold-feature"; +/** 1103/09-06. The `--with-create --keyed` slice, in its own context. */ +const WRITE_FEATURE_ID = "scaffold-write-feature"; const REPORT = "artifacts/tests/feature-scaffold.xml"; const pnpmCli = requireRemovalFixtureEnvironment("npm_execpath"); @@ -37,8 +40,13 @@ try { "docs", ]); const created = check("create-feature", "create:feature", [FEATURE_ID]); - const checks: RemovalCheck[] = [created]; - if (created.passed) { + const createdWrite = check("create-feature-write", "create:feature", [ + WRITE_FEATURE_ID, + "--with-create", + "--keyed", + ]); + const checks: RemovalCheck[] = [created, createdWrite]; + if (created.passed && createdWrite.passed) { // Commits the copy with the feature, as a project would: git-based // checks (git grep, git ls-files) then see the feature's files. sealRemovalFixtureRepository(fixtureRoot); diff --git a/scripts/test-sample-removal.ts b/scripts/test-sample-removal.ts index 81bec4c0..c28604fb 100644 --- a/scripts/test-sample-removal.ts +++ b/scripts/test-sample-removal.ts @@ -450,8 +450,11 @@ try { // from create:feature and runs the same gates again: the command and the // feature it writes need nothing from the sample. if (isSample) { + // 1103/09-06. With the write slice (NEVER), which needs nothing from + // the sample either. const created = check("scaffold-create-feature", "create:feature", [ "scaffold-feature", + "--with-create", ]); checks.push(created); if (created.passed) {