From 4e37b07ff9dadf2e72e171188e257d7a1611e58e Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Wed, 4 Nov 2026 20:24:02 +0900 Subject: [PATCH] =?UTF-8?q?fix(removal):=20CI=20=EC=8A=A4=ED=81=AC?= =?UTF-8?q?=EB=A6=BD=ED=8A=B8=EA=B0=80=20=EC=97=86=EB=8A=94=20=EA=B8=B0?= =?UTF-8?q?=EB=8A=A5=20=EC=A0=9C=EA=B1=B0=EB=8F=84=20CI=20=EA=B8=B0?= =?UTF-8?q?=EC=A4=80=EC=84=A0=20=EC=82=AC=EC=9C=A0=EB=A5=BC=20=EB=A7=8C?= =?UTF-8?q?=EB=93=A0=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제 test:sample-removal -- --feature=는 참조 기능이 아닌 기능에 ciScripts: []를 쓴다. pruneRemovalFixtureCiContract가 그 빈 집합으로 기준선 사유를 "removal fixture pruned "(끝 공백)로 만들고, 바로 뒤 기준선 검사가 "leading/trailing whitespace is forbidden"으로 거부한다. 그래서 create:feature로 만든 모든 기능의 제거 드릴이 3초 만에 무관한 오류로 끝나고 게이트 검사는 하나도 돌지 않는다. 고른 방법 - 지운 스크립트가 없으면 사유를 "removal fixture pruned no CI scripts"로 쓴다. - 이 길을 merge 게이트가 돌게 하는 것(test:feature-scaffold가 생성 기능에 --feature 드릴을 한 번 돌림)은 같은 발견의 둘째 절반이라 드릴 범위를 고치는 다음 커밋에서 한다. 위험·한계 - 이 커밋만으로는 제품 기능 제거 드릴 전체를 실행해 보지 않았다. 검증 - RED: 새 테스트 "re-baselines a removal that prunes no CI script" 실패 (reason 'removal fixture pruned '). - 수정 뒤 tests/unit/removal-fixture.test.ts 9건 통과. Refs: docs/reviews/2026-11-03-maturity-review/16-structure-patterns.md 16-02 --- scripts/lib/removal-fixture.ts | 8 +++++++- tests/unit/removal-fixture.test.ts | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/scripts/lib/removal-fixture.ts b/scripts/lib/removal-fixture.ts index fd39e717..ed3d2741 100644 --- a/scripts/lib/removal-fixture.ts +++ b/scripts/lib/removal-fixture.ts @@ -465,8 +465,14 @@ export async function pruneRemovalFixtureCiContract(options: Readonly<{ ]); // D-13: the reduced contract is a new baseline, recorded the way a project // that removes the capability records it; canonical check:ci then applies. + // 1103/16-02. A product feature owns no CI script; an empty list used to + // leave a trailing blank that the baseline schema refuses. await updateCiContractBaseline(options.root, { owner: "removal-fixture", - reason: `removal fixture pruned ${[...options.removedScripts].join(", ")}`, + reason: `removal fixture pruned ${ + options.removedScripts.size === 0 + ? "no CI scripts" + : [...options.removedScripts].join(", ") + }`, }); } diff --git a/tests/unit/removal-fixture.test.ts b/tests/unit/removal-fixture.test.ts index 001b11e0..b117687b 100644 --- a/tests/unit/removal-fixture.test.ts +++ b/tests/unit/removal-fixture.test.ts @@ -92,6 +92,25 @@ it("prunes removed command and evidence references and re-baselines the contract expect(packageDocument.scripts["check:ci"]).not.toMatch(/reduced/u); }); +// 1103/16-02. A product feature owns no CI script, so its removal prunes +// nothing. The baseline reason then ended in a blank ("removal fixture pruned +// ") and the baseline schema refused it before any gate ran. +it("re-baselines a removal that prunes no CI script", async () => { + const root = await copyCiContract("removal-fixture-no-scripts-"); + + await pruneRemovalFixtureCiContract({ + root, + removedScripts: new Set(), + removedEvidencePathFragments: [], + }); + + const baseline = JSON.parse( + await readFile(path.join(root, "config/ci/contract-baseline.json"), "utf8"), + ) as Record; + expect(baseline["reason"]).toBe("removal fixture pruned no CI scripts"); + await expect(loadCiGateContract(root)).resolves.toBeDefined(); +}); + it("rejects a contract that no longer matches its committed baseline", async () => { const root = await copyCiContract("removal-fixture-baseline-drift-"); const baselinePath = path.join(root, "config/ci/contract-baseline.json");