자식 프로세스를 띄우는 Vitest 시험 91개(24파일)가 기본 timeout 10초에
기대고 있었다. 셋은 FE-GATE-013에서만 도는 tests/system 시험이다.
기본값은 프로세스 안에서 도는 시험에 맞춘 값이다. 부하가 높은
desktop에서는 자식 프로세스 시험이 평소보다 크게 느려진다.
FE-GATE-020 drill 사본에서 평소 0.4~1.2초인 문서 시험이 10.6초 걸려
실패했다(2026-11-12). 가장 위험한 것은 tests/architecture/app-build-input
.test.ts로, desktop에서 이미 5.7초까지 걸렸다.
무엇을 고칠지는 desktop 계측으로 정했다.
- test:coverage 묶음(maxWorkers=4)과 test:unit을 세 번씩 돌렸다. 시험마다
띄운 자식 프로세스는 child_process 함수를 감싸 기록했고, 소요 시간은
JSON reporter로 받았다.
- 시험마다 실제 timeout은 task.timeout으로 기록했다.
- 자식 프로세스를 띄우는 시험 140개 중 88개가 기본값이었다. tests/system은
그 묶음에 없어서, 아래 검사가 잡은 셋을 따로 세 번 쟀다.
고친 것:
- tests/helpers/child-process-timeout.ts의 childProcessTimeout(<잰 최대
ms>)는 그 15배를 30초 단위로 올린 값이다. 15배는 위 0.7초 → 10.6초에서
왔다. 시험마다 자기가 잰 최대값을 인자로 적어 근거가 호출 자리에 남는다.
- describe 안의 기본값 시험이 모두 자식 프로세스를 띄우면 describe에,
일부만 띄우면 그 시험에 준다. 프로세스 안에서 도는 시험의 hang을 늦게
잡지 않으려는 것이다.
- tests/setup.ts가 child_process 함수를 감싼다. 기본 timeout인 시험이
자식 프로세스를 띄우면 그 호출에서 실패시키고, helper 이름을 알린다.
helper나 시험이 import한 스크립트가 띄워도 잡는다. util.promisify가
읽는 속성은 원래 함수에서 옮긴다.
- docs/work/reference/testing.md 2절에 값 정하는 법과 이 검사를 적었다.
버린 것:
- 전역 testTimeout 올리기: 프로세스 안 시험의 hang을 늦게 잡는다.
- 시험마다 손으로 정한 숫자: 근거가 남지 않고, 이미 있는 값도
60_000·120_000처럼 근거가 없었다.
- 자식 프로세스를 띄우지 않게 바꾸기: 검사 스크립트를 CLI 그대로 시험하는
것이 이 시험들의 목적이라 범위가 커진다.
- 파일에 timeout 선언이 있는지만 보는 정적 검사: helper가 띄우는 경우와
같은 파일의 다른 시험을 놓친다.
위험:
- hook(beforeAll 등)에서 띄우는 프로세스는 검사하지 않는다. 계측에서
hook이 띄운 곳은 둘이고, 둘 다 180초를 선언했다.
- 같은 파일 안에서 it.concurrent로 도는 시험이 섞이면 어느 시험의
timeout인지 틀릴 수 있다. 지금은 그런 시험이 없다.
- 다운스트림 시험이 기본값으로 자식 프로세스를 띄우면 test:unit 등이
실패한다. 메시지가 helper를 알린다.
검증(desktop):
- 다섯 검사(test:unit·check:types·check:ci·lint·verify:documentation)
rc=0.
- 자식 프로세스를 띄우는 시험 파일 40개와 tests/scale: rc=0, 검사 위반 0.
- tests/system: 115개 중 18개 실패. 모두 bwrap 호스트 제약이고 검사
위반은 0이다.
- 변이: 검사를 끄면 tests/unit/child-process-timeout.test.ts가 실패한다.
tracked-artifacts describe의 timeout을 지우면 그 시험이 검사 메시지로
실패한다.
- 재현: CPU 10% 제한에서 app-build-input·registry-governance·hosting-probe
·design-system-rules를 돌렸다. main 650d22fa는 11개가 10초 timeout으로
실패했다. 이 커밋은 71개 모두 통과했고, 가장 긴 시험은 17.7초였다.
문제
- 기능 생성 명령(U7)은 계약 패키지 인자가 없으면 자리표시자 신원으로
기능을 만든다. 이 신원은 형식 검사(external-contract-runtime.ts의
패키지 신원 검사)를 모두 통과한다. 계약 집합 검사도 같은 목록을 자기
자신과 비교한다. 그래서 자리표시자를 그대로 둔 빌드가 staging·
production 승인까지 통과한다.
고른 방법 (오케스트레이터 결정 2)
- 자리표시자를 src/contracts/deployment-admission.ts에 상수로 둔다.
digest는 sha256: 뒤에 0 64개, version 0.0.0, revision 0000000이다.
생성 명령이 이 상수를 import해 쓰므로 코드에서 자리표시자임이 보인다.
- findAdmissionViolations에 세 번째 인자로 빌드가 컴파일한 계약 패키지
목록을 받는다. 대상이 PUBLIC(staging, production)이면 digest가
자리표시자인 패키지마다 contractPackages.<packageId> 위반을 낸다.
BUILD_ID·RELEASE_ID의 PLACEHOLDER_IDENTIFIERS 검사와 같은 꼴이다.
- check-release-admission.ts는 EXPECTED_CONTRACT_SET_PACKAGES를 넘긴다.
이미 COMPILED_PRODUCT_FEATURE_IDS를 같은 방식으로 읽는다.
- 배포된 config.json의 수정본 검사(--config, 1101/13-05)는 패키지를
보지 않는다. 수정본은 비상 스위치만 바꿀 수 있고, 패키지는 빌드 필드라
빌드 승인 때 이미 검사했다.
- APP_PROFILE 테스트의 production 행은 컴파일된 계약 집합에 자리표시자가
있으면 거절(그 이유로만)을, 없으면 승인을 기대한다. 생성 명령으로
기능을 하나 만들면 저장소 자체 빌드가 production 승인을 받지 못하는
것이 의도한 동작이기 때문이다.
- 버린 대안: 계약 형식 검사에서 거절하기. 그러면 생성한 기능이 로컬에서
부팅·테스트되지 않는다. dist/release-manifest.json을 읽어 비교하기.
릴리스 일관성 검사가 이미 manifest와 컴파일된 목록이 같은지 보므로
같은 값을 한 번 더 읽고, 이 스크립트를 실행하는 테스트마다 manifest를
써야 한다.
위험·한계
- digest만 본다. version이나 revision만 자리표시자이고 digest는 진짜인
신원은 거절하지 않는다. 결정이 digest 하나를 자리표시자로 정했다.
- local·development 대상은 거절하지 않는다. 의도한 동작이다.
- 새 코드는 앱 번들에 들어가지 않는다(빌드 후 dist에서 거절 문구와
상수 이름 grep 0건). 앱은 이 모듈에서 isLoopbackHostname만 쓴다.
검증
- RED: 상수만 넣고 거절 전 코드로 새 테스트를 돌리면 실패한다.
"staging: expected [] to deeply equal [ Array(1) ]"
- RED(수정본·APP_PROFILE): 생성 명령으로 기능 하나를 만든 상태에서
두 테스트가 "contractPackages.@org-contracts/order: pins the
placeholder identity ..."로 실패했다.
- GREEN: tests/unit/deployment-admission.test.ts 25/25,
feature-override-diagnostics.test.ts(스크립트 실행) 통과. 생성한 기능이
있을 때와 없을 때 모두 통과. 생성한 기능이 있을 때 production 대상
스크립트 실행은 rc=1과 위 위반 한 줄을 낸다.
- npx tsc app·node·test rc=0, 바꾼 3파일 eslint rc=0.
문제
staging·production 프로필은 `https://api.example.com/`,
`https://telemetry.example.com/v1/events`를 싣고 텔레메트리를 켠다.
공개 대상 승인(FE-GATE-027)은 https와 비공개 호스트만 보므로 프로필을
고치지 않은 production 빌드가 `production ADMITTED`로 통과한다. 모든 API
호출이 실패하고 이벤트는 프로젝트가 소유하지 않은 도메인으로 간다.
CI 계약은 immutable_build의 env를 APP_PROFILE·RELEASE_TARGET로 고정해
RUNTIME_*를 넘길 수 없는데, README 변수 표는 이를 적지 않고 운영 예시는
`api.example.com`을 그대로 쓴다.
고른 방법
- publicEndpointViolations에 예약 이름 거절을 더한다. RFC 2606·6761의
`example.com`·`example.net`·`example.org`와 그 하위, `.example`,
`.invalid`, `.test`. 비공개 호스트와 겹치면 비공개 사유 하나만 낸다.
- README 운영 예시의 URL을 `<your-api-origin>/` 같은 빈칸으로 바꾼다.
- README 변수 표와 본문에 CI에서 endpoint를 바꾸는 방법은 프로필 파일을
커밋하는 것 하나라고 적는다.
- 테스트 fixture의 공개 endpoint를 예약되지 않은 이름으로 바꾸고, 프로필을
고치지 않은 빌드는 두 위반, endpoint를 준 빌드는 승인되는 것을 고정한다.
버린 대안
- 프로필 기본값을 비워 스키마가 빌드를 막게 하기: 더 확실하지만 프로필이
예시로 읽히지 않고 네 프로필을 같이 바꿔야 한다. 리뷰 대안 비교에서 승인
규칙 한 곳이 더 작다고 봤다.
- 리뷰 13-02 (3)의 괄호("13-01 배포 슬롯에 RUNTIME_* 허용 목록")는 하지
않았다. RUNTIME_*는 빌드 때 쓰이는 값이고, 슬롯은 승격 뒤 배포 job이라
거기서 넘겨도 이미 만든 후보에 닿지 않는다.
위험·한계
- 템플릿을 그대로 쓰는 프로젝트(이 repo 포함)가 APP_PROFILE=production으로
immutable_build를 돌리면 FE-GATE-027이 새로 실패한다(의도).
- `*.test` 같은 이름을 실제 운영 endpoint로 쓰는 프로젝트는 없다고 본다.
검증
- RED: node scripts/run-vitest.ts run tests/unit/deployment-admission.test.ts
2 failed / 22 passed. "refuses names reserved for examples and tests"
(`expected [] to deeply equal [...]`), "refuses a public build from the
unedited profile on both endpoints"(`staging: expected [] to deeply equal
[ 'API_BASE_URL', 'TELEMETRY_ENDPOINT' ]`)
- GREEN: 같은 파일 24 passed. feature-override-diagnostics,
documentation-readiness 포함 29 passed
- 실험 E-A 재실행: APP_PROFILE=production VITE_BUILD_ID=rel-prod-a
RELEASE_ID=rel-a 빌드 뒤 RELEASE_TARGET=production 승인 rc=1,
API_BASE_URL·TELEMETRY_ENDPOINT 두 위반으로 거절
- tsc(app, test) 0, eslint 바뀐 파일 0, verify-documentation-readiness
PASS_SCOPED
Refs: docs/reviews/2026-11-01-maturity-review/13-build-release-supply-chain.md 13-02
문제
.env.example과 운영 문서는 runtime config를 재빌드 없이 바꿀 수 있다고
적는다(SERVICE_WORKER DISABLED, FEATURE_OVERRIDES). 그런데 고친 문서를
검사할 명령이 없다. check:release-admission은 dist/config.json만 읽고,
build:profile은 BUILD_ID를 덮어 다시 만든다. 브라우저는 부팅 때 문서를
스키마로 검사하고 BUILD_ID를 HTML과 맞춰 보므로, 오타 하나나 BUILD_ID
변경 하나가 모든 사용자의 BOOT_CONFIG_FAILURE가 된다. FE-RB-001은 세
줄이고 고치는 방법이 없다.
고른 방법
- check-release-admission.ts가 `--config <고친 사본> --original <배포된
원본>`을 받는다. 사본에 기존 검사(스키마, 대상 규칙)를 그대로 돌리고,
원본과 비교해 CAPABILITY_OVERRIDES·FEATURE_OVERRIDES 밖의 필드가 하나라도
바뀌면 거절한다. BUILD_ID·RELEASE_ID 유지는 이 규칙에 들어 있다.
`--original` 없이 `--config`만 주면 거절한다(비교 대상 없이 통과시키지
않는다).
- 사본 검사는 artifacts/release/deployment-admission.json을 쓰지 않는다.
그 파일은 빌드의 승인 증거(CI artifact)이고 운영자의 사본은 빌드가 아니다.
- FE-RB-001에 네 단계(사본 두 개 받기·고치기 → 검사 → 같은 파일시스템에서
rename으로 교체, 되돌리기도 같은 방법 → 깨끗한 세션 부팅 확인)를 적고,
release-cache-rollback.md와 browser-file-storage-recovery.md의 스위치
설명이 그 절차를 가리킨다. .env.example 문장을 "비상 스위치만 재빌드
없이 바꾼다"로 좁혔다.
- pnpm이 `--`를 넘겨도 되도록 맨 앞 `--`를 버린다.
버린 대안
- `--build-id <id>`로 BUILD_ID만 대조: API_BASE_URL·RELEASE_MANIFEST_URL처럼
빌드가 정한 다른 필드를 바꿔도 통과한다. 원본 전체 비교가 같은 비용으로
더 좁다.
- release-manifest.json에서 build id를 읽기: 운영자가 받을 파일이 하나 더
늘고, 여전히 BUILD_ID만 본다.
- 비상 스위치도 빌드로만 바꾸기: 장애 대응 시간이 빌드·승격 시간만큼 늘어
스위치의 목적이 사라진다(리뷰 대안 비교).
위험·한계
- 원본과 사본의 중첩 객체 비교는 JSON.stringify라 키 순서만 달라도
"바뀜"으로 거절한다(닫힌 쪽으로 실패).
- 실제 서버에서 사본을 바꿔 부팅해 보지 않았다. 바뀐 문서가 release
기록(checksums.txt, 승격 archive)과 달라지는 점은 런북에 적기만 했다.
검증
- RED: node scripts/run-vitest.ts run tests/unit/deployment-admission.test.ts
새 6건 실패. 모두 "release admission refused: dist/config.json is
unreadable"(--config를 무시하고 dist를 읽음)
- GREEN: 같은 파일 22 passed. 스위치만 바꾼 사본 ADMITTED·기록 없음,
SERVICE_WORKER "DISABLE" 오타·BUILD_ID/RELEASE_ID/API_BASE_URL 변경·
--original 누락은 exit 1
- runbook-contract, runbook-drill, feature-override-diagnostics 포함 35 passed
- 실제 local 빌드에서 인자 없는 기존 경로 ADMITTED(기록 작성),
`-- --config dist/config.json --original public/config.json` ADMITTED
- tsc(node, test), eslint 바뀐 파일, verify-documentation-readiness
PASS_SCOPED
Refs: docs/reviews/2026-11-01-maturity-review/13-build-release-supply-chain.md 13-05
ENV_REGISTRY called VITE_BUILD_ID required with no default while every reader
fell back to local-build. Staging and production builds now fail without it;
local builds keep the placeholder, and the registry records that default.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
public/config.json is the copy dev serves and nothing compared it with
config/runtime/local.json. A unit test now requires it to equal what a local
build writes, and sample removal drops the feature override from it too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The generator rendered only gateIds[0] for non-matrix jobs, so
immutable_build never ran FE-GATE-027 and the snapshot test pinned that.
Each owned gate now gets its own run step, check:ci rejects a workflow in
which any contract gate has no run step, and release admission refuses
APP_PROFILE != RELEASE_TARGET. Both variables are documented.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Production admission only knew IPv4 private ranges and `localhost`, so
`[::ffff:127.0.0.1]`, `[fd00::1]`, `[fe80::1]`, `100.64.0.1`,
`0.1.2.3`, `api.internal`, `printer.local` and a trailing-dot
`localhost.` were all admitted as public API endpoints.
isNonPublicHost now also refuses 0.0.0.0/8, 100.64.0.0/10 (CGNAT),
IPv6 unique-local (fc00::/7), link-local (fe80::/10), every IPv4-mapped
address (::ffff:0:0/96), and `.local` / `.internal` names, after
stripping one trailing dot. URL.hostname already canonicalises the
literals, so no separate IP parser is needed.
The loopback list that allows plain http (`localhost`, `127.0.0.1`,
`[::1]`) now lives once in deployment-admission.ts
(LOOPBACK_HOSTNAMES / isLoopbackHostname); rest-profiles.ts and
browser-rpc.ts use it instead of their own copies (same list, no
behavior change there).
Verified: new cases in tests/unit/deployment-admission.test.ts; a probe
showed 13 of the 14 forms admitted before and all refused after, while
2001:db8::1, fec0::1, 100.63/100.128 and *.example.com names stay
admitted. Gates green except the known removal-fixture test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The provider sandbox never ran. bubblewrap 0.9.0 stops parsing an `--args`
file at the first non-option and never hands the remainder back, so the
command written into that file was silently dropped: bwrap printed its usage
text, exited 1, and the provider produced no evidence at all. The options
still travel in the args file — that is what keeps host paths and credentials
out of `/proc/<pid>/cmdline` — but the command now rides on real argv, and
`encodeProviderBwrapInput` refuses a `--` so the drop cannot come back.
The scope wrapper then could not exit. It read the supervisor's liveness pipe
through `fs`, which runs a blocking `read(2)` on a threadpool thread; the
supervisor holds that pipe open for the scope's whole life, so the read never
returned and closing the descriptor did not interrupt it. Once bubblewrap
finished the wrapper deadlocked in `process.exit`, the scope outlived the
provider, and a completed run was reported as a timeout kill. The channel is
now read through the event loop, so teardown is observable and terminal.
Creation modes were left to the ambient umask. `mkdir(mode)` and `open(mode)`
are requests the kernel subtracts the umask from, so a runner exporting a
restrictive umask produced directories it could not enter and handed `tar` a
file it could not re-open. Private modes are pinned instead of inherited.
Promotion cleanup deleted before it checked. Removals run through a pinned
descriptor, so a leaf substituted after validation had this promotion's exact
five destroyed first and the substitution reported afterwards, leaving a
half-emptied directory a retry could not tell from a completed one. The name
is re-bound to the inode before anything is removed, so the failure is total.
Separately, release coherence proved the artifacts agreed with each other but
never that they belonged where they were going: a build whose runtime document
said `APP_ENV: local`, `AUTH_MODE: demo` and a loopback API is coherent with
itself and passed every gate. `public/` is copied verbatim into `dist/`, so
that local document shipped with every build regardless of what the build was
for. Runtime configuration now comes from a declared profile, and FE-GATE-027
refuses to admit an artifact to an environment it does not match — including
refusing an undeclared destination, so nothing is admitted by omission.
`REQUEST_TIMEOUT_MS` and `VITE_ROUTER_BASE_PATH` were validated and then
dropped: the V3 executor ran every operation on its contract's own deadline,
and Vite emitted root-absolute assets for a sub-path deployment. The timeout is
now a ceiling that may tighten a contract but never loosen one, and one base
path feeds the router, the Service Worker scope and the asset base together.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>