# CI quality-gate orchestration `config/ci/gates.json` is the executable registry for every gate and the sole workflow model. `.gitea/workflows/quality-gates.yml` is generated from that strict v2 contract; it is not an independent configuration authority. Update the registry, run `corepack pnpm generate:ci-workflow`, and commit the generated bytes together. `corepack pnpm check:ci-workflow` rejects missing, stale, CRLF, or otherwise byte-different output. `corepack pnpm check:ci` runs artifact-schema checking, the typed contract checker, and this workflow drift check. The merge stage runs as three jobs (`merge_static`, `merge_test`, `merge_browser`), one install each; every gate is a step named by its ID, and a failed gate does not skip the next. The checkers' own negative fixtures and the gating check run in the main stage (`main_gate`, FE-GATE-029) after a push to a branch. Release and production gates stay matrix checks. There is no soft-fail wiring. ## 기준선 갱신과 새 프로젝트 시작 시 초기화할 기준선 게이트·명령·산출물 수와 게이트 모양 해시를 따로 기록하던 기준선 파일은 2026-11-08에 지웠다(소유자 결정, design-docs `repo-structure/README.md` 3.3절). 계약의 모양은 `scripts/contracts/ci-gates.ts`의 의미 검사(게이트·job·stage 소유와 순서)가 지킨다. 게이트·명령·산출물을 바꾼 뒤에는 `corepack pnpm generate:ci-workflow`와 `corepack pnpm check:ci`를 돌리고 생성된 workflow를 함께 커밋한다. 제거 검증 (`test:*-removal`)은 줄인 계약을 그대로 불러 canonical `check:ci`를 돌린다 (`scripts/lib/removal-fixture.ts`의 `pruneRemovalFixtureCiContract`). `check:ci:gating`(main 단계 FE-GATE-029)은 `tests/` 아래 테스트 파일(`tests/fixtures` 제외)이 모두 CI 게이트 명령에서 실행되는지 확인한다. 게이트 명령이 닿는 package script의 Vitest 경로와 Playwright 설정의 `testDir`를 모아 비교한다(`scripts/lib/ungated-tests.ts`). `run-scale-profile.ts `를 부르는 명령은 그 tier의 Vitest 경로로 센다. 게이트가 돌리지 않는 테스트는 `config/ci/ungated-tests.json`에 이유와 함께 적어야 한다. 게이트가 이미 돌리는 파일을 이 목록에 남겨 두면 실패한다. package script도 같은 방식으로 확인한다(`scripts/lib/ungated-scripts.ts`). `check:*`·`verify:*`·`test:*`·`drill:*`·`review:*`·`scan:*` 스크립트는 게이트 명령에서 package script 그래프로 닿거나, 게이트가 이미 돌리는 Vitest 경로만 다시 돌려야 한다. 둘 다 아니면 `config/ci/ungated-scripts.json`에 이유와 함께 적는다. 게이트가 닿는 스크립트를 이 목록에 남겨 두면 실패한다. 두 목록에 남은 항목과 이유는 각 파일에 있다. 규모 테스트는 이렇게 나뉜다(리뷰 11-03, `scripts/scale/run-scale-profile.ts`). - `check:scale:pr`은 merge gate `FE-GATE-005`에서 돈다. 개수·상한·증가 모양만 검사하므로 CPU가 달라도 결과가 같다. S0~S2 조합 증가 검사가 여기 있다. S0/S1만 재면 모든 workload가 noise floor 아래라 이차 누적을 놓친다. 조합 timing은 산출물(`artifacts/scale/pr/composition-s0-s2.json`)에 기록만 한다. - `main`·`nightly`·`release` tier는 CI에서 돌지 않는다. 이 tier들은 `baseline-regression`을 포함한다. 이 단계는 `config/scale/benchmark-baseline.json`을 기록한 CPU 모델에서만 timing을 비교하고, 다른 CPU에서는 `incomplete`로 끝난다. 이 tier에만 있는 테스트는 `ungated-tests.json`에, tier를 실행하는 `check:scale:*` 스크립트는 `ungated-scripts.json`에 이유와 함께 남아 있다. 템플릿을 복사해 새 프로젝트를 시작하면 아래 기준선은 템플릿의 값이다. 샘플을 지우거나 구조를 바꾸면 프로젝트 값으로 다시 찍는다. | 기준선 | 파일 | 갱신 방법 | 검사 위치 | |---|---|---|---| | registry 스냅샷과 승인 | `config/contracts/registry-baseline.json`, `registry-baseline.approval.json` | `update:registry-baseline` (`REGISTRY_BASELINE_OWNER`·`_REASON` 필수). 기준선을 새로 찍지 않고 breaking 변경을 유지하려면 `config/contracts/registry-change-evidence.json`에 항목을 추가(`changeId`, 그 변경 뒤 값 `after`(삭제는 생략, 값은 JSON 그대로이고 키·원시값 배열 순서는 상관없다), `versionBump`·`migration`·`compatibilityWindow`·`rollback`·`owner`). 같은 칸을 다시 바꾸면 `after`가 달라 새 항목이 필요하다. 지금 diff의 breaking 변경과 changeId가 맞지 않는 항목이 있으면 게이트가 그 항목을 나열하며 실패한다. `update:registry-baseline`은 새 기준선이 설명하는 항목을 모두 지운다(지운 항목은 git 이력에 남는다) | `scripts/check-registries.ts`의 baseline 비교 | | 커버리지 모듈 수 하한 | `config/testing/risk-coverage.json`의 `repositoryBaseline` | 직접 수정. 지운 production 모듈 수만큼 줄인다(`scripts/test-sample-removal.ts`가 같은 계산을 한다) | `scripts/lib/risk-coverage.ts` "repository module baseline" | | 기능 끄기 설정 | `config/runtime/.json`의 `FEATURE_OVERRIDES` | 직접 수정. 지운 기능의 키를 뺀다(`scripts/test-sample-removal.ts`가 같은 일을 한다) | 실패하는 검사는 없다. 남은 키는 아무것도 끄지 않고, `check:release-admission`(FE-GATE-027)이 `release admission warning: FEATURE_OVERRIDES. … the override does nothing`을, 부팅이 진단 `feature.override.unknown`(warn)을 남긴다(리뷰 09-09) | | 의존성 목록 | `config/security/dependency-baseline.json`, `dependency-baseline.approval.json` | `update:dependency-baseline` (`DEPENDENCY_BASELINE_OWNER`·`_REASON` 필수) | `scripts/generate-supply-chain.ts` | Contract loading validates every registered command entry against the authoritative root package-script graph and lifecycle/install policy before the runner enters its execution callback. Foreign cwd/workspace script dispatch, argument-sensitive dispatchers, and ineffective lifecycle suppression therefore fail preflight even when the later `check:ci` command would never run. For npm, that root-only boundary also parses options following an explicit `run`/`run-script` target or implicit `test`/`start`/`stop`/`restart` target: `--workspace`, `-w`, `--workspaces`, and `--prefix` are foreign manifest scope and are rejected before execution. The first literal `--` ends npm option parsing, so later tokens are ordinary script arguments. pnpm and Yarn differ: their options following the selected script name are forwarded to that script; their cwd/workspace selectors are rejected only where the manager consumes them before script selection. The npm graph includes existing root-manifest `pre