diff --git a/.gitea/workflows/quality-gates.yml b/.gitea/workflows/quality-gates.yml index 20d19234..a2b9c247 100644 --- a/.gitea/workflows/quality-gates.yml +++ b/.gitea/workflows/quality-gates.yml @@ -15,6 +15,7 @@ on: type: choice options: - merge + - main - release - production - field @@ -31,31 +32,97 @@ env: CI_RUNNER_IMAGE: "${{ vars.RUNNER_IMAGE_DIGEST }}" jobs: - merge_gate: - name: "${{ matrix.gate }} / ${{ matrix.name }}" - if: ${{ gitea.event_name != 'workflow_dispatch' || inputs.stage != 'documentation' }} + merge_static: + name: "merge / static checks" + if: ${{ gitea.event_name != 'workflow_dispatch' || (inputs.stage != 'documentation' && inputs.stage != 'main') }} + runs-on: ubuntu-latest + timeout-minutes: 45 + steps: + - uses: https://github.com/actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 + with: + persist-credentials: false + - uses: https://github.com/actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 + with: + node-version-file: .nvmrc + - name: Frozen install + run: | + corepack enable + corepack pnpm install --frozen-lockfile --ignore-scripts + - name: "FE-GATE-001 / manifest-lockfile" + if: ${{ !cancelled() }} + run: corepack pnpm ci:gate -- FE-GATE-001 + - name: "FE-GATE-002 / lint" + if: ${{ !cancelled() }} + run: corepack pnpm ci:gate -- FE-GATE-002 + - name: "FE-GATE-003 / typecheck" + if: ${{ !cancelled() }} + run: corepack pnpm ci:gate -- FE-GATE-003 + - name: "FE-GATE-010 / architecture" + if: ${{ !cancelled() }} + run: corepack pnpm ci:gate -- FE-GATE-010 + - name: "FE-GATE-011 / build" + if: ${{ !cancelled() }} + run: corepack pnpm ci:gate -- FE-GATE-011 + - name: "FE-GATE-012 / bundle" + if: ${{ !cancelled() }} + run: corepack pnpm ci:gate -- FE-GATE-012 + - name: Upload merge static evidence + if: always() + uses: https://github.com/ChristopherHX/gitea-upload-artifact@81f940d004763f986ba3582c007fd842dd5cb0d7 + with: + name: "merge-static-${{ gitea.run_id }}" + path: artifacts/ + if-no-files-found: error + + merge_test: + name: "merge / tests" + if: ${{ gitea.event_name != 'workflow_dispatch' || (inputs.stage != 'documentation' && inputs.stage != 'main') }} # FE-GATE-013 runner requirement: Linux with executable /usr/bin/bwrap (with --size), /usr/bin/prlimit, /usr/bin/systemd-run, /usr/bin/systemctl and /usr/bin/tar, an active systemd user manager 254 or newer, and unified cgroup v2 with delegated memory, pids and cpu controllers # FE-GATE-013 runner requirement: unprivileged user and network namespaces for bwrap (the provider sandbox runs bwrap --unshare-pid --unshare-ipc --unshare-uts --unshare-net); Ubuntu 23.10 and later refuse them while kernel.apparmor_restrict_unprivileged_userns=1 unless /usr/bin/bwrap has an AppArmor profile that allows userns; scripts/check-system-test-prerequisites.ts probes this before test:system runs runs-on: ubuntu-latest timeout-minutes: 45 - strategy: - fail-fast: false - matrix: - include: - - { gate: FE-GATE-001, name: manifest-lockfile, browser: false } - - { gate: FE-GATE-002, name: lint, browser: false } - - { gate: FE-GATE-003, name: typecheck, browser: false } - - { gate: FE-GATE-004, name: runtime-schema, browser: false } - - { gate: FE-GATE-005, name: unit, browser: false } - - { gate: FE-GATE-006, name: component, browser: false } - - { gate: FE-GATE-007, name: integration, browser: false } - - { gate: FE-GATE-008, name: e2e, browser: true } - - { gate: FE-GATE-009, name: accessibility, browser: true } - - { gate: FE-GATE-010, name: architecture, browser: false } - - { gate: FE-GATE-011, name: build, browser: false } - - { gate: FE-GATE-012, name: bundle, browser: false } - - { gate: FE-GATE-013, name: security, browser: false } - - { gate: FE-GATE-020, name: removability, browser: false } + steps: + - uses: https://github.com/actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 + with: + persist-credentials: false + - uses: https://github.com/actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 + with: + node-version-file: .nvmrc + - name: Frozen install + run: | + corepack enable + corepack pnpm install --frozen-lockfile --ignore-scripts + - name: "FE-GATE-004 / runtime-schema" + if: ${{ !cancelled() }} + run: corepack pnpm ci:gate -- FE-GATE-004 + - name: "FE-GATE-005 / unit" + if: ${{ !cancelled() }} + run: corepack pnpm ci:gate -- FE-GATE-005 + - name: "FE-GATE-006 / component" + if: ${{ !cancelled() }} + run: corepack pnpm ci:gate -- FE-GATE-006 + - name: "FE-GATE-007 / integration" + if: ${{ !cancelled() }} + run: corepack pnpm ci:gate -- FE-GATE-007 + - name: "FE-GATE-013 / security" + if: ${{ !cancelled() }} + run: corepack pnpm ci:gate -- FE-GATE-013 + - name: "FE-GATE-020 / removability" + if: ${{ !cancelled() }} + run: corepack pnpm ci:gate -- FE-GATE-020 + - name: Upload merge test evidence + if: always() + uses: https://github.com/ChristopherHX/gitea-upload-artifact@81f940d004763f986ba3582c007fd842dd5cb0d7 + with: + name: "merge-test-${{ gitea.run_id }}" + path: artifacts/ + if-no-files-found: error + + merge_browser: + name: "merge / browser tests" + if: ${{ gitea.event_name != 'workflow_dispatch' || (inputs.stage != 'documentation' && inputs.stage != 'main') }} + runs-on: ubuntu-latest + timeout-minutes: 45 steps: - uses: https://github.com/actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 with: @@ -68,23 +135,26 @@ jobs: corepack enable corepack pnpm install --frozen-lockfile --ignore-scripts - name: Install Playwright browsers - if: ${{ matrix.browser }} run: | corepack pnpm exec playwright install --with-deps chromium firefox webkit $(command -v sudo || true) apt-get install -y fonts-noto-core fonts-noto-cjk fonts-noto-cjk-extra fonts-liberation - - name: Run blocking gate - run: corepack pnpm ci:gate -- ${{ matrix.gate }} - - name: Upload merge gate evidence + - name: "FE-GATE-008 / e2e" + if: ${{ !cancelled() }} + run: corepack pnpm ci:gate -- FE-GATE-008 + - name: "FE-GATE-009 / accessibility" + if: ${{ !cancelled() }} + run: corepack pnpm ci:gate -- FE-GATE-009 + - name: Upload merge browser evidence if: always() uses: https://github.com/ChristopherHX/gitea-upload-artifact@81f940d004763f986ba3582c007fd842dd5cb0d7 with: - name: "${{ matrix.gate }}-${{ gitea.run_id }}" + name: "merge-browser-${{ gitea.run_id }}" path: artifacts/ if-no-files-found: error release_gate: name: "${{ matrix.gate }} / ${{ matrix.name }}" - needs: merge_gate + needs: [merge_static, merge_test, merge_browser] if: ${{ startsWith(gitea.ref, 'refs/tags/v') || (gitea.event_name == 'workflow_dispatch' && (inputs.stage == 'release' || inputs.stage == 'production' || inputs.stage == 'field')) }} runs-on: ubuntu-latest timeout-minutes: 45 @@ -502,3 +572,30 @@ jobs: name: "FE-GATE-017-${{ gitea.run_id }}" path: artifacts/ if-no-files-found: error + + main_gate: + name: "main / checker self-tests" + if: ${{ (gitea.event_name == 'push' && startsWith(gitea.ref, 'refs/heads/')) || (gitea.event_name == 'workflow_dispatch' && inputs.stage == 'main') }} + runs-on: ubuntu-latest + timeout-minutes: 45 + steps: + - uses: https://github.com/actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 + with: + persist-credentials: false + - uses: https://github.com/actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 + with: + node-version-file: .nvmrc + - name: Frozen install + run: | + corepack enable + corepack pnpm install --frozen-lockfile --ignore-scripts + - name: "FE-GATE-029 / checker-self-tests" + if: ${{ !cancelled() }} + run: corepack pnpm ci:gate -- FE-GATE-029 + - name: Upload main gate evidence + if: always() + uses: https://github.com/ChristopherHX/gitea-upload-artifact@81f940d004763f986ba3582c007fd842dd5cb0d7 + with: + name: "main-gate-${{ gitea.run_id }}" + path: artifacts/ + if-no-files-found: error diff --git a/CHANGELOG.md b/CHANGELOG.md index f0233ed9..223749b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,7 +43,7 @@ ## 미출시 — `48c7695b` → 정리 단계 -2026-11-07 소유자가 지시한 저장소 정리다(design-docs `repo-structure/04-frontend-layout.md` 9.2절, 결정은 `repo-structure/README.md` 3.4절). 범위는 `main` `48c7695b`(PR #9 병합) 다음부터다. 1단계(PR #11, `85f941c4`~`121e1125`, `main` `f33e4778`에 합침), 2단계(브랜치 `chore/layout-2-sample-removal`, `c7e80f2f`~`ad3a071f`), 3단계(합치기)와 4단계(배치 규칙 검사)(브랜치 `chore/layout-3-merge`, `bf485f44`부터 브랜치 끝까지)를 담는다. 기준점 `48c7695b`를 빼면 이 절의 해시는 모두 이 범위에 있다. +2026-11-07 소유자가 지시한 저장소 정리다(design-docs `repo-structure/04-frontend-layout.md` 9.2절, 결정은 `repo-structure/README.md` 3.4절). 범위는 `main` `48c7695b`(PR #9 병합) 다음부터다. 1단계(PR #11, `85f941c4`~`121e1125`, `main` `f33e4778`에 합침), 2단계(브랜치 `chore/layout-2-sample-removal`, `c7e80f2f`~`ad3a071f`), 3단계(합치기)와 4단계(배치 규칙 검사)(브랜치 `chore/layout-3-merge`, `bf485f44`~`c54c3813`), CI 재편(브랜치 `chore/ci-merge-jobs`, `0739f26b`부터 브랜치 끝까지)을 담는다. 기준점 `48c7695b`를 빼면 이 절의 해시는 모두 이 범위에 있다. ### 먼저 할 일 (BREAKING) @@ -68,10 +68,13 @@ 10. **루트 `schemas/`를 `config/schemas/`로 옮긴다.** 산출물 스키마는 `config/schemas/artifacts/`, recipe 카탈로그 스키마는 `config/schemas/recipes/`다. 자기 스키마를 `schemas/`에 두었으면 같은 곳으로 옮기고 `$schema` 상대 경로를 고친다. hosting 응답 fixture는 `config/hosting/response-headers.fixture.json` → `tests/fixtures/hosting/response-headers.json` (`79dc945a`) 11. **자기 루트 항목을 등록부에 더한다.** 루트 항목마다 `config/repository-layout.json`에 종류·역할·읽는 곳을 적는다. 제품이 더한 루트 항목(예: `Dockerfile`, `compose.yaml`, `deploy/`)이 없으면 `tests/unit/repository-layout.test.ts`가 `add an entry with its role to config/repository-layout.json`으로 실패한다. 비밀값 검사 범위에 넣을 항목은 `sets`에 `secret-scan`을 적고 `config/security/secret-scan-policy.json`의 `trackedRoots`에도 같은 이름을 더한다. 둘이 다르면 같은 시험이 실패한다. 루트 경로 목록을 코드에 새로 적지 말고 `selectRepositoryPaths(<집합>)`으로 고른다(매뉴얼 03 E절 R2) (`79dc945a`) 12. **CI 계약 기준선을 자기 값으로 다시 기록한 프로젝트는 다시 기록한다.** FE-GATE-003 명령이 25개에서 2개로, FE-GATE-009·028의 수동 a11y 기록 산출물 경로와 id가 바뀌었다. 4단계와 같은 명령이다 (`bf485f44`, `79dc945a`) +13. **CI 계약 기준선 파일이 없어졌다.** `config/ci/contract-baseline.json`, `scripts/update-ci-contract-baseline.ts`, `update:ci-contract-baseline` script를 지웠다(소유자 결정). 위 12단계와 이 절 4단계, 아래 절들의 "기준선을 다시 기록한다"는 이 절까지 받으면 할 일이 없다. 병합에서 자기 기준선 파일이 수정/삭제 충돌이 되면 삭제 쪽을 고른다. 자기 script나 문서가 `update:ci-contract-baseline`을 부르면 지운다 (`f6b2b96c`) +14. **merge 단계 job 이름이 바뀌었다.** 게이트마다 하나이던 행렬 job(`FE-GATE-NNN / <이름>`)이 `merge / static checks`(`merge_static`), `merge / tests`(`merge_test`), `merge / browser tests`(`merge_browser`) 셋이 됐다. 게이트는 job 안의 단계 이름(`FE-GATE-NNN / <이름>`)으로 남는다. Gitea 브랜치 보호의 필수 검사를 옛 job 이름으로 걸었으면 새 job 셋으로 바꾼다. 증거 업로드 이름도 `FE-GATE-NNN-`에서 `merge-static-`·`merge-test-`·`merge-browser-`으로 바뀌었다 (`0739f26b`) #### 옮긴 뒤 확인 1. 로컬 merge 게이트 14개를 돈다. 이 절 때문에 먼저 볼 것: `check:registries`(3단계), `check:ci`(4·12단계), `test:unit`(5·9·11단계), `generate:feature-index`(6단계), `check:types`·`check:types:fixtures`(7·8단계), `verify:documentation`(지운 샘플 경로를 적은 자기 문서, 9단계, 매뉴얼 03 E절 R6·R7), `test:sample-removal`(인자 없이 돌면 목록이 빈 템플릿에서는 `SKIP`을 출력한다). + - 검사기의 음성 fixture 명령 15개와 ungated 검사(`check:ci:gating`)는 PR이 아니라 브랜치 push의 FE-GATE-029(`main_gate`)에서 돈다. 새 시험 파일이나 검증 script를 게이트에 걸지 않으면 PR은 통과하고 main push가 실패한다. 로컬에서는 `corepack pnpm ci:gate FE-GATE-029`로 미리 본다 (`f6b2b96c`). 2. 시각 골든: 갤러리 두 장(`design-system-gallery-dark`, `state-surfaces-light`)은 이제 Storybook 정적 빌드의 story를 찍는다. 자기 골든을 다시 찍은 프로젝트는 `corepack pnpm test:visual:update`로 그 둘을 다시 찍는다. 3. `/examples/ui`·`/examples/states`·`/examples/auth`를 열던 자기 e2e는 플랫폼 라우트나 자기 화면으로 옮긴다. 템플릿의 그런 spec은 옮겼다(아래 표). @@ -89,9 +92,12 @@ | [계약] **BREAKING** | 음성 타입 fixture 23개를 실행기 하나로 돈다. fixture 첫 줄의 `// expect:`가 기대이고, 판정은 전과 같다(tsc exit 1과 `error TS:`). fixture별 결과와 맞은 진단 줄을 출력한다. `TelemetryPort.emit` 인자를 넓히는 변이(0925/07-05)에서 실패하는 것을 확인했다. recipes tsconfig는 test에 합쳤고 web-worker tsconfig(0파일 검사)는 지웠다(결정 D4). 위 "먼저 할 일" 7·8 | `scripts/check-type-fixtures.ts`, `scripts/check-typecheck-inputs.ts`, `tests/fixtures/typecheck/`, `package.json`, `config/ci/gates.json` | `bf485f44` | | [계약] **BREAKING** | 루트 등록부 `config/repository-layout.json`이 생겼다. 루트 경로 목록을 쓰던 7곳(복사 대상, 비밀값 검사 범위, 공급망 시험, 이력 문서 검사, 규모 입력, vite 입력, TS 전용 규칙)이 등록부의 집합을 고른다. `schemas/`·수동 a11y 기록·hosting 응답 fixture를 옮겼다. 위 "먼저 할 일" 9~11 | `config/repository-layout.json`, `scripts/lib/repository-layout.ts`, `config/schemas/`, `docs/accessibility/route-reviews/`, `tests/fixtures/hosting/` | `79dc945a` | | [계약] | 저장소 배치 규칙 R1~R10을 매뉴얼 03 E절에 적고, 기계로 볼 수 있는 것을 게이트에 넣었다: R1·R2·R7(파일)·R9 `tests/unit/repository-layout.test.ts`, R3 `tests/unit/tracked-artifacts.test.ts`, R4·R5 `tests/unit/example-feature-rules.test.ts`(이상 FE-GATE-005), R6·R7(문서) `verify:documentation`(FE-GATE-017, 산출물에 `layoutRuleViolations`), R8 FE-GATE-003 | `docs/manual/03-outside-feature-folder.md`, `scripts/verify-documentation-readiness.ts`, `scripts/contracts/release-artifacts.ts` | `e902e657` | +| [계약] **BREAKING** | merge 단계 job 14개(게이트마다 행렬 하나)를 셋으로 합쳤다. job마다 설치를 한 번 하고 게이트를 차례로 돈다. 앞 게이트가 실패해도 다음 게이트가 돈다(`if: ${{ !cancelled() }}`). release 단계는 세 job을 모두 기다린다. 위 "먼저 할 일" 14 | `config/ci/gates.json` `jobs`, `scripts/contracts/ci-gates.ts`, `scripts/generate-ci-workflow.ts`, `.gitea/workflows/quality-gates.yml` | `0739f26b` | +| [계약] **BREAKING** | 새 단계 `main`(`MAIN_READY`, 승격을 막지 않음)과 게이트 FE-GATE-029 `checker-self-tests`. FE-GATE-001·005·008·010·013의 `*:fixture` 명령 15개와 그 증거, `check:ci`의 ungated 검사(`check:ci:gating`으로 뗌)를 옮겼다. merge 단계 명령 참조 64 → 49. 음성 타입 fixture(`check:types:fixtures`)는 src 타입 계약 시험이라 merge에 남겼다. CI 계약 기준선 파일은 지웠다. 위 "먼저 할 일" 13 | `config/ci/gates.json`, `scripts/check-ci-gating.ts`, `scripts/lib/promotion-readiness.ts` | `f6b2b96c` | ### 그 밖의 수정 +- `scripts/check-*.ts` 30개를 ESLint 규칙·의존 규칙·시험으로 옮길 수 있는지 판정한 표를 `docs/operations/ci-script-assessment.md`에 남겼다. 코드는 바꾸지 않았다 (`3ce77d9e`). - 정리 3단계에서 문서가 가리키던 옛 명령·경로(`check:types:fixture:*`, `check:types:recipes`, a11y 기록과 스키마 경로)를 새 이름으로 바꿨다 (`bf485f44`, `79dc945a`). - 정리 1단계: 읽는 곳 없는 산출물 13개를 지우고 `artifacts/`를 폴더째 무시한다(`85f941c4`). 아무도 읽지 않는 `config/schemas/` JSON Schema 4개를 지웠다(`0805910c`). 루트 `tasks/`와 `.superpowers/` 기록을 `docs/history/`로 옮겼다(`429b8d88`). nginx 설정 예시를 지우고 호스트가 지킬 조건만 남겼다(`121e1125`). - `/examples/ui`·`/examples/states`를 열던 e2e(반응형, 스크롤 복원, 타이포그래피, 건너뛰기 링크)는 홈과 `/examples/platform`으로 옮겼다 (`e7210c71`). @@ -104,6 +110,7 @@ - 두 다운스트림에 시험 병합을 하지 않아 충돌 수를 모른다(S4 가정 F4). - R2 검사는 등록부를 쓰는 7곳만 본다. 그 밖에 루트 이름 둘 이상을 담은 문자열 배열이 약 20곳 남았다(예: `tests/e2e/support/fixture-builds.ts`의 복사 제외 목록, `scripts/check-test-evidence.ts`의 playwright 설정 목록). 뜻이 다른 목록이라 이번에 옮기지 않았다. - R5는 문자열 검색이라 샘플 ID나 라우트 경로를 조립해 쓰는 시험은 놓친다. +- CI 재편(merge job 셋, main 단계)은 desktop에서 게이트 명령으로 확인했다. Gitea runner에서 새 workflow가 도는지는 Actions를 켠 뒤 확인한다. - 성능 lab(FE-GATE-026)의 기능 라우트 측정(`featureRouteInteractionMs`)은 템플릿에 공개 기능 라우트가 없어 `measured: false`다. 제품 기능이 생기면 잰다. - `TEMPLATE_FIXTURE` 출처와 `REFERENCE_EXTERNAL_BEARER` 별칭이 플랫폼 코드에 남았다. 쓰는 기능이 없다. - visual 골든의 픽셀 비교는 색 허용치(`threshold` 0.2)를 넘지 않는 미세한 토큰 변경(예: 어두운 테마 `--color-danger` red-500 → red-600)을 잡지 못한다. 옛 골든도 같았다. diff --git a/config/ci/contract-baseline.json b/config/ci/contract-baseline.json deleted file mode 100644 index 7426f344..00000000 --- a/config/ci/contract-baseline.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "schemaVersion": 1, - "owner": "DongHyeonka", - "reason": "2026-11-07 소유자 결정: 정리 3단계(design-docs repo-structure/README.md 3.4절). 음성 타입 fixture 명령 23개를 실행기 하나로 합치고, 수동 a11y 기록을 docs/accessibility/route-reviews로, JSON Schema를 config/schemas로 옮긴다", - "gates": 27, - "commands": 76, - "commandReferences": 80, - "artifacts": 105, - "stages": 5, - "gateShapeSha256": "5b2ded190e5c1cbfc31f0d8c90fa358defe87850d99dc4db5439426b9ed72a90" -} diff --git a/config/ci/gates.json b/config/ci/gates.json index 5877462a..1d8fe31c 100644 --- a/config/ci/gates.json +++ b/config/ci/gates.json @@ -427,6 +427,11 @@ "script": "check:ci", "expect": "pass" }, + { + "id": "check-ci-gating", + "script": "check:ci:gating", + "expect": "pass" + }, { "id": "check-release-admission", "script": "check:release-admission", @@ -1563,6 +1568,12 @@ "path": "artifacts/quality/gates/FE-GATE-028.txt", "schemaId": "text", "production": "runner-generated" + }, + { + "id": "artifact-artifacts-quality-gates-FE-GATE-029-txt", + "path": "artifacts/quality/gates/FE-GATE-029.txt", + "schemaId": "text", + "production": "runner-generated" } ], "gates": [ @@ -1570,8 +1581,7 @@ "id": "FE-GATE-001", "name": "manifest-lockfile", "commandIds": [ - "verify-lockfile", - "check-frozen-lockfile-fixture" + "verify-lockfile" ], "logArtifactId": "artifact-artifacts-quality-install-txt", "evidenceArtifactIds": [ @@ -1623,7 +1633,6 @@ "test-unit", "test-contract", "test-coverage", - "check-coverage-fixture", "check-scale-pr" ], "logArtifactId": "artifact-artifacts-quality-gates-FE-GATE-005-txt", @@ -1632,8 +1641,7 @@ "artifact-artifacts-tests-contract-xml", "artifact-artifacts-tests-coverage-xml", "artifact-artifacts-tests-coverage-coverage-summary-json", - "artifact-artifacts-quality-risk-coverage-json", - "artifact-artifacts-quality-risk-coverage-fixture-json" + "artifact-artifacts-quality-risk-coverage-json" ], "retentionClassId": "merge-cycle" }, @@ -1676,8 +1684,7 @@ "verify-browser-capability-evidence", "test-storybook", "test-visual", - "check-test-evidence-browser", - "check-test-evidence-fixture" + "check-test-evidence-browser" ], "logArtifactId": "artifact-artifacts-quality-gates-FE-GATE-008-txt", "evidenceArtifactIds": [ @@ -1689,8 +1696,7 @@ "artifact-artifacts-tests-storybook-results-xml", "artifact-artifacts-tests-visual-report-index-html", "artifact-artifacts-tests-visual-results-xml", - "artifact-artifacts-quality-test-evidence-json", - "artifact-artifacts-quality-test-evidence-fixture-json" + "artifact-artifacts-quality-test-evidence-json" ], "retentionClassId": "merge-cycle" }, @@ -1715,21 +1721,12 @@ "check-request-fanout", "check-app-build-input", "check-design-system", - "check-design-system-fixture", "check-i18n", - "check-i18n-fixture", "check-diagnostics", - "check-diagnostics-fixture", "check-browser-file-storage-boundaries", "check-realtime-boundaries", - "check-realtime-boundaries-fixture", "check-optional-recipes-source", - "check-optional-recipe-fixtures", "check-registries", - "check-registries-compatibility-fixtures", - "check-registries-baseline-fixture", - "check-registries-fixture", - "check-routes-fixture", "check-adapter-inventory", "check-ci" ], @@ -1737,19 +1734,11 @@ "evidenceArtifactIds": [ "artifact-artifacts-quality-dependency-report-json", "artifact-artifacts-quality-design-system-json", - "artifact-artifacts-quality-design-system-fixture-json", "artifact-artifacts-quality-i18n-json", - "artifact-artifacts-quality-i18n-fixture-json", "artifact-artifacts-quality-diagnostics-json", - "artifact-artifacts-quality-diagnostics-fixture-json", "artifact-artifacts-quality-realtime-boundaries-json", "artifact-artifacts-quality-optional-recipes-json", - "artifact-artifacts-quality-optional-recipe-fixtures-json", "artifact-artifacts-quality-registries-json", - "artifact-artifacts-quality-registry-compatibility-fixtures-json", - "artifact-artifacts-quality-registry-baseline-fixture-json", - "artifact-artifacts-quality-registry-fixture-json", - "artifact-artifacts-quality-route-registry-fixture-json", "artifact-artifacts-quality-ci-contract-json" ], "retentionClassId": "merge-cycle" @@ -1793,9 +1782,6 @@ "verify-reproducible-build", "build-release-candidate", "verify-local-evidence", - "check-supply-chain-fixtures", - "check-supply-chain-provider-fixtures", - "check-security-fixtures", "check-browser-security" ], "logArtifactId": "artifact-artifacts-quality-gates-FE-GATE-013-txt", @@ -1810,9 +1796,7 @@ "artifact-artifacts-security-license-report-json", "artifact-artifacts-security-vulnerability-report-json", "artifact-artifacts-security-supply-chain-verification-json", - "artifact-artifacts-security-supply-chain-coherence-json", - "artifact-artifacts-security-supply-chain-fixtures-json", - "artifact-artifacts-security-supply-chain-provider-fixtures-json" + "artifact-artifacts-security-supply-chain-coherence-json" ], "retentionClassId": "release-coherence", "hostRequirements": [ @@ -2009,6 +1993,44 @@ "artifact-artifacts-tests-a11y-manual-report-json" ], "retentionClassId": "release-coherence" + }, + { + "id": "FE-GATE-029", + "name": "checker-self-tests", + "commandIds": [ + "check-frozen-lockfile-fixture", + "check-coverage-fixture", + "check-test-evidence-fixture", + "check-design-system-fixture", + "check-i18n-fixture", + "check-diagnostics-fixture", + "check-realtime-boundaries-fixture", + "check-optional-recipe-fixtures", + "check-registries-compatibility-fixtures", + "check-registries-baseline-fixture", + "check-registries-fixture", + "check-routes-fixture", + "check-supply-chain-fixtures", + "check-supply-chain-provider-fixtures", + "check-security-fixtures", + "check-ci-gating" + ], + "logArtifactId": "artifact-artifacts-quality-gates-FE-GATE-029-txt", + "evidenceArtifactIds": [ + "artifact-artifacts-quality-risk-coverage-fixture-json", + "artifact-artifacts-quality-test-evidence-fixture-json", + "artifact-artifacts-quality-design-system-fixture-json", + "artifact-artifacts-quality-i18n-fixture-json", + "artifact-artifacts-quality-diagnostics-fixture-json", + "artifact-artifacts-quality-optional-recipe-fixtures-json", + "artifact-artifacts-quality-registry-compatibility-fixtures-json", + "artifact-artifacts-quality-registry-baseline-fixture-json", + "artifact-artifacts-quality-registry-fixture-json", + "artifact-artifacts-quality-route-registry-fixture-json", + "artifact-artifacts-security-supply-chain-fixtures-json", + "artifact-artifacts-security-supply-chain-provider-fixtures-json" + ], + "retentionClassId": "merge-cycle" } ], "stages": [ @@ -2079,13 +2101,21 @@ "gateIds": [ "FE-GATE-017" ] + }, + { + "id": "main", + "readiness": "MAIN_READY", + "needs": [], + "gateIds": [ + "FE-GATE-029" + ] } ], "jobs": [ { - "id": "merge_gate", - "displayName": "${{ matrix.gate }} / ${{ matrix.name }}", - "kind": "gate-matrix", + "id": "merge_static", + "displayName": "merge / static checks", + "kind": "gate-sequence", "needs": [], "condition": "merge", "timeoutMinutes": 45, @@ -2093,18 +2123,88 @@ "FE-GATE-001", "FE-GATE-002", "FE-GATE-003", + "FE-GATE-010", + "FE-GATE-011", + "FE-GATE-012" + ], + "browserGateIds": [], + "environment": [], + "steps": [ + { + "kind": "checkout" + }, + { + "kind": "setup-node" + }, + { + "kind": "frozen-install" + }, + { + "kind": "run-gate" + }, + { + "kind": "upload", + "transferId": "merge-static-evidence", + "name": "merge-static-${{ gitea.run_id }}", + "paths": [ + "artifacts/" + ], + "always": true + } + ] + }, + { + "id": "merge_test", + "displayName": "merge / tests", + "kind": "gate-sequence", + "needs": [], + "condition": "merge", + "timeoutMinutes": 45, + "gateIds": [ "FE-GATE-004", "FE-GATE-005", "FE-GATE-006", "FE-GATE-007", - "FE-GATE-008", - "FE-GATE-009", - "FE-GATE-010", - "FE-GATE-011", - "FE-GATE-012", "FE-GATE-013", "FE-GATE-020" ], + "browserGateIds": [], + "environment": [], + "steps": [ + { + "kind": "checkout" + }, + { + "kind": "setup-node" + }, + { + "kind": "frozen-install" + }, + { + "kind": "run-gate" + }, + { + "kind": "upload", + "transferId": "merge-test-evidence", + "name": "merge-test-${{ gitea.run_id }}", + "paths": [ + "artifacts/" + ], + "always": true + } + ] + }, + { + "id": "merge_browser", + "displayName": "merge / browser tests", + "kind": "gate-sequence", + "needs": [], + "condition": "merge", + "timeoutMinutes": 45, + "gateIds": [ + "FE-GATE-008", + "FE-GATE-009" + ], "browserGateIds": [ "FE-GATE-008", "FE-GATE-009" @@ -2128,8 +2228,8 @@ }, { "kind": "upload", - "transferId": "merge-gate-evidence", - "name": "${{ matrix.gate }}-${{ gitea.run_id }}", + "transferId": "merge-browser-evidence", + "name": "merge-browser-${{ gitea.run_id }}", "paths": [ "artifacts/" ], @@ -2142,7 +2242,9 @@ "displayName": "${{ matrix.gate }} / ${{ matrix.name }}", "kind": "gate-matrix", "needs": [ - "merge_gate" + "merge_static", + "merge_test", + "merge_browser" ], "condition": "release", "timeoutMinutes": 45, @@ -2753,6 +2855,42 @@ "always": true } ] + }, + { + "id": "main_gate", + "displayName": "main / checker self-tests", + "kind": "gate-sequence", + "needs": [], + "condition": "main", + "timeoutMinutes": 45, + "gateIds": [ + "FE-GATE-029" + ], + "browserGateIds": [], + "environment": [], + "steps": [ + { + "kind": "checkout" + }, + { + "kind": "setup-node" + }, + { + "kind": "frozen-install" + }, + { + "kind": "run-gate" + }, + { + "kind": "upload", + "transferId": "main-gate-evidence", + "name": "main-gate-${{ gitea.run_id }}", + "paths": [ + "artifacts/" + ], + "always": true + } + ] } ], "retention": { diff --git a/docs/operations/ci-quality-gates.md b/docs/operations/ci-quality-gates.md index 1f6a349a..6f60f1c3 100644 --- a/docs/operations/ci-quality-gates.md +++ b/docs/operations/ci-quality-gates.md @@ -6,34 +6,25 @@ 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 Gitea -adapter runs each gate as an independent matrix check with full fan-out and no -soft-fail wiring. +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. ## 기준선 갱신과 새 프로젝트 시작 시 초기화할 기준선 -게이트 계약의 크기와 모양은 코드 상수가 아니라 `config/ci/contract-baseline.json`에 -있다. 이 파일에는 게이트 수, 명령 정의 수, 명령 참조 수, 산출물 수, stage 수, -게이트 모양 SHA-256과 함께 `owner`·`reason`이 들어 있다. 계약을 불러올 때 현재 -`gates.json`과 이 파일이 다르면 실패한다(`scripts/contracts/ci-gates.ts`의 -`assertCiContractBaseline`). 그래서 게이트·명령·산출물을 추가하거나 지운 뒤에는 -다음 순서로 커밋한다. +게이트·명령·산출물 수와 게이트 모양 해시를 따로 기록하던 기준선 파일은 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`). -``` -# 1. config/ci/gates.json 수정 -CI_CONTRACT_BASELINE_OWNER=<팀> CI_CONTRACT_BASELINE_REASON=<이유> corepack pnpm update:ci-contract-baseline -corepack pnpm generate:ci-workflow -corepack pnpm check:ci -``` - -`update:ci-contract-baseline`은 `scripts/update-ci-contract-baseline.ts`를 실행한다. -리뷰는 `contract-baseline.json`의 diff로 변경을 승인한다. 샘플·recipe·런타임 제거 -검증(`test:*-removal`)도 같은 절차를 쓴다. 줄인 계약을 기준선으로 기록한 뒤 -canonical `check:ci`를 돌린다(`scripts/lib/removal-fixture.ts`의 -`pruneRemovalFixtureCiContract`). 완화 모드는 없다. - -`check:ci`는 `tests/` 아래 테스트 파일(`tests/fixtures` 제외)이 모두 CI 게이트 -명령에서 실행되는지도 확인한다. 게이트 명령이 닿는 package script의 Vitest 경로와 +`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`에 이유와 함께 적어야 @@ -63,7 +54,6 @@ package script 그래프로 닿거나, 게이트가 이미 돌리는 Vitest 경 | 기준선 | 파일 | 갱신 방법 | 검사 위치 | |---|---|---|---| -| CI 계약 크기·게이트 모양 | `config/ci/contract-baseline.json` | `update:ci-contract-baseline` (`CI_CONTRACT_BASELINE_OWNER`·`_REASON` 필수) | `scripts/contracts/ci-gates.ts` `assertCiContractBaseline` | | 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) | @@ -407,9 +397,9 @@ the paired backend: `{ "id": "PRODUCT-GATE-001", "name": "backend-contract", "script": "check:backend-contract" }`. Ids are `PRODUCT-GATE-NNN`; the `FE-GATE-NNN` ids, their commands, artifacts and readiness formula stay the template's. Each runs as `corepack pnpm