From b433286eb0ea1ac15864f4aa05a713bdecdd8c85 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Wed, 4 Nov 2026 22:23:13 +0900 Subject: [PATCH] =?UTF-8?q?fix(scaffold):=20=EA=B8=B0=EB=8A=A5=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=20=EB=93=9C=EB=A6=B4=EC=9D=B4=20=EB=A1=9C=EC=BB=AC?= =?UTF-8?q?=EC=97=90=EC=84=9C=EB=8F=84=20release=20candidate=EB=A5=BC=20?= =?UTF-8?q?=EB=A7=8C=EB=93=A0=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제 e1b4e28 뒤 test:feature-scaffold는 merge 단계 명령을 모두 돈다. 실제 실행 (snapshot b6bfc9b, CI env 없음)에서 검사 75개 중 FE-GATE-013의 두 개만 실패했다. build:release-candidate가 build의 commitSha를 source.revision으로 기록하는데, VITE_COMMIT_SHA가 없으면 commitSha가 "local"이라 schema(40·64자리 16진수)가 거부한다. verify:local-evidence는 그 결과를 읽어 따라 실패했다. CI workflow는 VITE_COMMIT_SHA를 전체 env로 주므로 CI에서는 나지 않는다. 고른 방법 - VITE_COMMIT_SHA가 비었을 때만 드릴이 fixture의 봉인 commit(git rev-parse HEAD)을 넣는다. CI 값은 그대로 둔다. test:system의 provider fixture도 같은 방법으로 commit을 준다. - 버린 대안: build:release-candidate·verify:local-evidence를 제외 목록에 넣기. 생성 기능 파일이 후보의 추적 파일 목록과 공급망 증거에 들어가는지를 보지 못한다. 위험·한계 - 로컬 실행에서 빌드 산출물의 commitSha가 "local" 대신 fixture commit이 된다. fixture 안에서만이다. 검증 - 수정 전 드릴 실행: create-feature, merge 명령 73개(음성 fixture 포함), feature-removal 통과. 실패는 위 두 개뿐(866초, load 10~25). - 수정 뒤 eslint·tsc 통과, feature-scaffold-drill 6건 통과. 드릴 재실행 결과는 이 커밋 메시지에 적지 않았다(공유 잠금). Refs: docs/reviews/2026-11-03-maturity-review/12-guardrails-ci.md 12-02 --- scripts/test-feature-scaffold.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/test-feature-scaffold.ts b/scripts/test-feature-scaffold.ts index 59df1162..92f4a267 100644 --- a/scripts/test-feature-scaffold.ts +++ b/scripts/test-feature-scaffold.ts @@ -1,3 +1,4 @@ +import { spawnSync } from "node:child_process"; import { mkdir, rm, writeFile } from "node:fs/promises"; import { loadCiGateContract } from "./contracts/ci-gates.ts"; @@ -39,6 +40,12 @@ const REPORT = "artifacts/tests/feature-scaffold.xml"; const pnpmCli = requireRemovalFixtureEnvironment("npm_execpath"); const fixtureRoot = await createRemovalFixtureRoot("feature-scaffold"); +function fixtureCommit(root: string): string { + const head = spawnSync("git", ["rev-parse", "HEAD"], { cwd: root, encoding: "utf8" }); + if (head.status !== 0) throw new Error(`feature scaffold fixture has no commit: ${head.stderr}`); + return head.stdout.trim(); +} + function check(name: string, script: string, extra: readonly string[] = []): RemovalCheck { return runRemovalFixtureCheck(name, fixtureRoot, pnpmCli, script, extra); } @@ -55,6 +62,12 @@ try { // 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); + // build:release-candidate records the build's commit and refuses one that + // is not a commit ID. CI sets VITE_COMMIT_SHA for the whole workflow; a + // local run gets the copy's own sealed commit instead of "local". + if (!process.env["VITE_COMMIT_SHA"]?.trim()) { + process.env["VITE_COMMIT_SHA"] = fixtureCommit(fixtureRoot); + } for (const command of scaffoldDrillCommands(await loadCiGateContract(fixtureRoot))) { checks.push(runScaffoldDrillCommand(command, fixtureRoot, pnpmCli)); }