fix(build): checkout 빌드를 읽는 스크립트 넷이 다른 RUN_OUTPUT_ROOT를 거절한다

문제: `RUN_OUTPUT_ROOT`가 다른 폴더를 가리키면 빌드는 그 아래에 쓰는데,
`verify-reproducible-build.ts`, `check-optional-recipes.ts`,
`check-app-build-input.ts --require-bundle`, `create-release-candidate.ts`는
checkout의 `dist/`·`artifacts/`를 읽고 스스로 거절하지 않았다. 게이트
안에서는 앞 단계가 거절해 거짓 PASS가 없었지만, 단독 실행은
`verify:reproducible-build`가 이전 빌드를 두 번 재서 `passed: true`를 쓸 수
있었다.

고친 것: 넷이 시작할 때 `checkoutBuildReadFailure`(check-bundle.ts와 같다)를
부르고 변수 이름·값을 적으며 exit 1. `check-optional-recipes.ts`는
`--dist-root`를 받았으면 그 폴더를 읽으므로 묻지 않는다.

검증: desktop `node scripts/run-vitest.ts run tests/unit/run-isolation.test.ts`
통과. 넷을 `RUN_OUTPUT_ROOT=.tmp/run-output-refusal`로 띄워 rc=1과 메시지를
본다(가장 긴 실행 499 ms). 기준 커밋에서는 넷 다 실패한다(RED).

Refs: 1106/12-02
This commit is contained in:
DongHyeonka
2026-11-13 23:29:13 +09:00
parent 86b4a328c0
commit e657d00fbe
5 changed files with 60 additions and 0 deletions
+10
View File
@@ -1,5 +1,6 @@
import { mkdir } from "node:fs/promises";
import { checkoutBuildReadFailure } from "./lib/run-isolation.ts";
import { writeValidatedJsonArtifact } from "./lib/validated-json-artifact.ts";
import { localEvidenceAssessmentArtifactSchema } from "./contracts/release-artifacts.ts";
import { createLocalEvidenceAssessment } from "./lib/local-release-evidence.ts";
@@ -10,6 +11,15 @@ import {
releaseCandidateManifestSchema,
} from "./lib/release-candidate.ts";
// 1106/12-02. This digests dist and the evidence under artifacts/ where the
// checkout keeps them (scripts/lib/release-candidate.ts). Under RUN_OUTPUT_ROOT
// the build wrote elsewhere, so the candidate would package an earlier build.
const outputRootFailure = checkoutBuildReadFailure("scripts/create-release-candidate.ts");
if (outputRootFailure !== undefined) {
process.stderr.write(`${outputRootFailure}\n`);
process.exit(1);
}
const assessment = await createLocalEvidenceAssessment();
await mkdir("artifacts/security", { recursive: true });
await writeValidatedJsonArtifact({