문제
`npx vitest run tests/unit/ci-workflow-generation.test.ts`는 79건이
"CI runner npm scope environment invalid"로 실패한다(415건 중). npx와
npm을 거친 IDE 실행기는 npm_config_prefix·_userconfig·_globalconfig를
넣는다. CI 게이트 preflight(withCiGatePreflight)는 실제 runner에서 이
변수들을 거절하는데(옳은 동작), 테스트가 그 preflight를 프로세스 안에서
부르거나 자식으로 띄우면서 실행기의 process.env를 그대로 물려받는다.
scripts/run-vitest.ts만 그중 일부를 지워서 pnpm 경로만 통과한다. 원인은
timeout이 아니라 이 환경변수다.
고른 방법
- vitest.config.ts가 NODE_ENV를 고정하는 자리에서 npm scope 변수를 지운다.
config는 worker를 띄우기 전에 메인 프로세스에서 평가되므로 worker와 그
자식 프로세스 모두 깨끗한 환경으로 시작한다. 어느 실행기로 돌리든,
어느 테스트 파일이든 한 곳에서 막는다.
- 지울 이름은 preflight가 쓰는 것과 같은 판정
(package-script-graph.ts의 isNpmScopeEnvironmentName, 기존 private 함수를
export)으로 고른다. 목록이 둘로 갈라지지 않는다.
- ci-workflow-generation.test.ts에 "테스트 프로세스에 npm scope 변수가
없다"는 테스트를 더했다.
버린 대안
- 해당 테스트 파일의 beforeEach/afterEach에서 지우고 되돌리기(리뷰의 최소
방향 1): 같은 preflight를 띄우는 다른 파일이 생기면 다시 깨진다.
- 실행 함수가 환경을 인자로 받게 하기: 자식 프로세스는 여전히 process.env를
물려받아 실패한다.
- run-vitest.ts의 하드코딩 목록 정리: 이번 수정으로 필요 없어지지만, product
index 생성 자식에도 쓰이고 동작이 같아 건드리지 않았다.
위험·한계
- 실제 게이트 실행기의 npm scope 거절은 그대로다. 테스트 안에서 일부러 변수를
넣는 기존 테스트 3건도 그대로 통과한다.
- tests/unit 밖(component, integration 등)은 npx로 돌려 보지 않았다.
검증
- RED: npx vitest run tests/unit/ci-workflow-generation.test.ts -t
"npm-launched runner" 실패 "expected [ 'npm_config_userconfig', …(2) ] to
deeply equal []". 수정 전 같은 파일 79 failed / 336 passed
- GREEN: npx vitest run tests/unit/ci-workflow-generation.test.ts
416 passed
- npx vitest run tests/unit: 171파일 2,401 passed
- tsc(node, test), eslint 바뀐 파일 통과
Refs: docs/reviews/2026-11-01-maturity-review/15-performance.md 15-05
Icon vendor, design-system deep import and realtime composition were regular
expressions beside graph rules, and the regex missed relative deep imports
inside presentation. They are graph rules with fixtures now, with the
components/ui facades and page-templates named. package-script-graph.ts stays;
the reason is recorded.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tests/architecture, tests/release, tests/scripts, the top-level
tests/features files and the browser-soak contract now run in
test:coverage (FE-GATE-005); check:adapter-inventory joins FE-GATE-010
and the image resolve-signal type fixture joins FE-GATE-003 (baseline
updated). check:ci fails on a test file no gate command reaches unless
config/ci/ungated-tests.json gives a reason; only the tests/scale suite
is listed, pending 11-03. defineFeatureModule's id mismatch is tested.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>