fix(features)!: 기능이 아닌 폴더 표시를 NOT_A_FEATURE로 바꾸고 선언과 함께 두면 실패한다 (1103/09-09)

문제
src/features/<dir>/NOT_INSTALLED 표시는 "기능이 아닌 샘플 폴더"라는 뜻인데,
같은 단어가 런타임 상태 "선언됐지만 빌드·FEATURE_OVERRIDES가 뺀 기능"으로도
쓰였다(product-features.ts). 생성기는 feature-module.ts를 못 읽을 때만 표시를
찾았으므로, 샘플을 졸업시키며 표시를 지우지 않으면 표시가 "설치 안 됨"이라고
말하는 채로 조용히 설치됐다.

고른 방법
- 표시 이름을 NOT_A_FEATURE로 바꾼다(local-draft-feature 파일 이름 변경).
  런타임 상태 NOT_INSTALLED는 그대로 둔다.
- 생성기가 표시와 feature-module.ts가 함께 있으면 둘 중 무엇을 지울지 적고
  실패한다.
- 옛 이름 표시는 받지 않는다. 받으면 같은 다의가 남는다. 옛 표시만 있는
  폴더는 "has no feature-module.ts; … mark the directory with NOT_A_FEATURE"로
  실패해 새 이름을 알려 준다.
README 상태 표, starter-experience, 매뉴얼 errors·patterns 표를 맞췄다.

위험·한계
다운스트림이 자기 폴더에 NOT_INSTALLED 표시를 두었다면 생성 단계가 실패한다.
파일 이름만 바꾸면 된다.

검증
- RED: 생성기 테스트 3건(새 이름 허용, 옛 이름 거절, 동시 존재 거절)이
  수정 전 실패.
- generate-product-feature-index.test.ts 17건 통과. generate:feature-index
  통과. verify:documentation PASS_SCOPED. eslint, tsc(node·test) 통과.

BREAKING CHANGE: src/features/<dir>/NOT_INSTALLED 표시 파일은 더 이상
인식되지 않는다. 같은 자리에 NOT_A_FEATURE라는 이름으로 옮긴다.

Refs: docs/reviews/2026-11-03-maturity-review/09-app-core.md 09-09
This commit is contained in:
DongHyeonka
2026-11-04 20:19:17 +09:00
parent 851fdedbcd
commit 9edc8307b0
7 changed files with 60 additions and 16 deletions
@@ -145,7 +145,7 @@ describe("app-scoped selection from ownership declarations", () => {
await expect(generateAppIndexes(overContexts, "a")).rejects.toThrow(/App a context cardinality 2 exceeds budget 1/);
});
it("refuses a feature directory without a declaration or NOT_INSTALLED marker (09-07)", async () => {
it("refuses a feature directory without a declaration or NOT_A_FEATURE marker (09-07)", async () => {
const files = {
"src/apps/a/app-module.ts": app("a"),
"src/contexts/c/context-module.ts": context("c", "a"),
@@ -158,12 +158,39 @@ describe("app-scoped selection from ownership declarations", () => {
);
const marked = await repo({
...files,
"src/features/typo/NOT_INSTALLED": "Composed only by tests.\n",
"src/features/typo/NOT_A_FEATURE": "Composed only by tests.\n",
});
const selected = await generateAppIndexes(marked, "a");
expect(selected.entries.map((entry) => entry.id)).toEqual(["f"]);
});
it("no longer accepts the old NOT_INSTALLED marker name (1103/09-09)", async () => {
// The word is the runtime state "declared but not selected"; a marker
// under that name is read as a missing declaration, naming the new one.
const root = await repo({
"src/apps/a/app-module.ts": app("a"),
"src/contexts/c/context-module.ts": context("c", "a"),
"src/features/sample/NOT_INSTALLED": "Composed only by tests.\n",
});
await expect(generateAppIndexes(root, "a")).rejects.toThrow(
/src\/features\/sample has no feature-module\.ts; add one or mark the directory with NOT_A_FEATURE/u,
);
});
it("refuses a marked directory that also declares a feature (1103/09-09)", async () => {
// Graduating a sample means deleting the marker; keeping both used to
// install the feature silently while the marker said it was none.
const root = await repo({
"src/apps/a/app-module.ts": app("a"),
"src/contexts/c/context-module.ts": context("c", "a"),
"src/features/f/feature-module.ts": feature("f", "c"),
"src/features/f/NOT_A_FEATURE": "Composed only by tests.\n",
});
await expect(generateAppIndexes(root, "a")).rejects.toThrow(
/src\/features\/f has both feature-module\.ts and NOT_A_FEATURE; delete NOT_A_FEATURE to install it, or feature-module\.ts to keep it out/u,
);
});
it("skips contexts without features and never imports another app's features", async () => {
const root = await repo({
"src/apps/a/app-module.ts": app("a"),