ci(gates): FE-GATE-020을 merge 단계에서 main 단계로 옮긴다 #113

Merged
donghyeon.kang merged 3 commits from ci/move-fe-gate-020-to-main into main 2026-12-03 23:38:57 +00:00
17 changed files with 113 additions and 59 deletions
+3 -3
View File
@@ -178,9 +178,6 @@ jobs:
- name: "FE-GATE-013 / security"
if: ${{ steps.main-push-reuse.outputs.reuse != 'true' && !cancelled() }}
run: corepack pnpm ci:gate -- FE-GATE-013 --enter-host-environment
- name: "FE-GATE-020 / removability"
if: ${{ steps.main-push-reuse.outputs.reuse != 'true' && !cancelled() }}
run: corepack pnpm ci:gate -- FE-GATE-020
- name: Upload merge test evidence
if: ${{ always() && steps.main-push-reuse.outputs.reuse != 'true' }}
uses: https://github.com/ChristopherHX/gitea-upload-artifact@81f940d004763f986ba3582c007fd842dd5cb0d7
@@ -729,6 +726,9 @@ jobs:
- name: "FE-GATE-029 / checker-self-tests"
if: ${{ !cancelled() }}
run: corepack pnpm ci:gate -- FE-GATE-029
- name: "FE-GATE-020 / removability"
if: ${{ !cancelled() }}
run: corepack pnpm ci:gate -- FE-GATE-020
- name: "FE-GATE-030 / optional-removability"
if: ${{ !cancelled() }}
run: corepack pnpm ci:gate -- FE-GATE-030
+3 -2
View File
@@ -35,7 +35,7 @@ Gitea runner에서 merge 단계를 초록으로 만들고, worker를 늘리지
- `.gitea/workflows/`에 생성기가 만들지 않은 파일·폴더가 있다.
- 옮기는 법: tsc 호출마다 파일이 있는 잎 tsconfig를 루트 기준 경로로 `--project`에 적는다. `cd`를 빼고 변수와 `@` 파일은 값으로 바꾼다. 공백이 든 경로는 따옴표로 묶는다. `-b`에는 `--clean`이어도 잎 tsconfig를 적는다. tsc를 실행하지 않는데 걸린 script는 이름을 `<이름>:tsc` 꼴로 바꾸거나 명령을 `scripts/`의 파일로 옮긴다. `tsc --version`처럼 검사가 아닌 호출은 package script에서 뺀다. 손으로 더한 workflow는 지우거나 생성기(`scripts/generate-ci-workflow.ts`)가 만들게 옮긴다.
- 옮긴 뒤 확인: `scripts/verify.sh gate FE-GATE-003 FE-GATE-010`.
- 선택 runtime 제거 드릴 셋이 merge의 FE-GATE-020에서 main 단계의 새 게이트 FE-GATE-030으로 옮는다. main job 이름이 `main / self-tests and removal drills`로 바뀐다. 그 이름을 필수 검사로 걸었으면 바꾼다. 선택 runtime을 바꾸는 PR은 `scripts/verify.sh gate FE-GATE-030`을 직접 돌린다.
- 선택 runtime 제거 드릴 셋이 merge의 FE-GATE-020에서 main 단계의 새 게이트 FE-GATE-030으로 옮는다. 기능·scaffold 제거 드릴 FE-GATE-020도 merge 단계(`merge_test`)에서 main 단계(`main_gate`)로 옮는다(CI-FE-0005). main job 이름이 `main / self-tests and removal drills`로 바뀐다. 그 이름을 필수 검사로 걸었으면 바꾼다. 생성기·드릴·기능·context 규칙을 바꾸는 PR은 `scripts/verify.sh gate FE-GATE-020`을, 선택 runtime을 바꾸는 PR은 `scripts/verify.sh gate FE-GATE-030`을 직접 돌린다.
- merge job 셋과 main job(`main / self-tests and removal drills`)이 runner의 actions/cache 저장소에서 Node·corepack·pnpm store와 메타데이터 캐시를 복원하고, main run만 저장한다. runner에 캐시 서버가 없으면 복원 단계가 경고만 내고 설치가 그대로 돈다. 자기 runner의 캐시 크기 상한을 확인한다(항목 하나가 압축 전 약 0.7GB, lockfile이 바뀔 때마다 새 항목).
- FE-GATE-005가 `test:unit`·`test:contract`를 따로 돌지 않는다. `tests/unit`·`tests/contract`는 `test:coverage`에서 한 번 돌고, 같은 실행이 `artifacts/tests/unit.xml`·`contract.xml`을 쓴다(`scripts/lib/coverage-bundle-junit-reporter.ts`). 계약에서 command `test-unit`·`test-contract`가 빠진다. 자기 `config/ci/gates.json`의 게이트가 그 id를 부르면 지운다. `test:coverage`의 경로에서 두 폴더 중 하나를 빼거나 그 reporter를 빼면 FE-GATE-005가 실패한다. 두 package script는 작업 중에 쓰는 명령으로 남는다.
- FE-GATE-009의 `test:a11y`가 `playwright test --config playwright.a11y.config.ts --grep @a11y`로 돌고 결과를 `artifacts/tests/a11y/`에 쓴다. 자기 `test:a11y`를 고쳐 썼으면 `--config playwright.a11y.config.ts`를 넣는다. 빠지면 008과 009가 같은 결과 경로에 써서 `tests/unit/playwright-result-paths.test.ts`(FE-GATE-005)가 실패한다(`scripts/verify.sh gate FE-GATE-005`).
@@ -185,7 +185,8 @@ Gitea runner에서 merge 단계를 초록으로 만들고, worker를 늘리지
| [계약] | telemetry와 diagnostics의 `build_id`·`release_id`·`active_release_id`가 Service Worker manifest의 `releaseId`와 같은 규칙(제어문자 없는 1~512자, code point)을 읽는다. 다른 속성의 규칙은 그대로다. 전에는 `+`·한글이 있거나 64자를 넘는 build id는 부팅·렌더 실패, Service Worker 시작, release 불일치 기록을, 그런 release id는 release 불일치 기록을 통째로 버렸다. diagnostics는 이 세 속성에 숫자·boolean을 더는 받지 않으니 자기 호출이 그렇게 넘기면 문자열로 바꾼다 (REV-FE-0042) | `src/contracts/deployment-id.ts`, `src/contracts/telemetry.ts`, `src/contracts/diagnostics.ts`, `src/contracts/service-worker-static-manifest.ts` | `b02ebb85` |
| [계약] | `check:bundle`(FE-GATE-012)이 Service Worker와 manifest 밖 JavaScript를 예산으로 보고, `public/`에서 복사된 JavaScript는 이름과 자리에 상관없이 실패한다. `config/performance/budgets.json`에 `bundle.serviceWorkerGzipBytes`가 있어야 한다. `artifacts/performance/bundle.json`에 칸이 는다(`measurements.serviceWorkerGzipBytes`, `classification.publicFiles`, `unbudgetedOutputs`, `results.serviceWorkerPassed`, 자기 검사 fixture 하나). 위 "먼저 할 일" (REV-FE-0010) | `scripts/check-bundle.ts`, `scripts/lib/classify-vite-bundle.ts`, `scripts/lib/performance-budgets.ts`, `scripts/contracts/release-artifacts.ts`, `config/performance/budgets.json`, `docs/operations/performance-evidence.md` | `81447354` |
| [계약] | merge static job이 게이트 뒤에 `scripts/tests` 시험(`.claude/` 지침, 편집 훅, `scripts/verify.sh`)을 `python3 -I -m unittest discover -s scripts/tests`로 돈다. 계약에 step 종류 `run-script-tests`를 더하고 `merge_static`에만 둔다. 자기 runner job 이미지에 python3가 있어야 한다 | `config/ci/gates.json`, `scripts/contracts/ci-gates.ts`, `scripts/generate-ci-workflow.ts`, `tests/unit/ci-workflow-generation.test.ts` | `91c03b49` |
| [계약] | `refs/heads/main` push의 merge job 셋(`merge_static`·`merge_test`·`merge_browser`)이 `Frozen install` 다음 `main-push-reuse` step에서 직전 PR 실행을 재사용할 수 있는지 본다. checkout이 `fetch-depth: 2`로 부모 둘을 받고, 여섯 조건(main push, 부모 둘 병합 커밋·`tree(HEAD)==tree(HEAD^2)`, `.nvmrc`·`pnpm-lock.yaml` 무변경, `HEAD^2` 최신 PR run의 같은 job `success`, 그 job 로그에 `건너뜀:` 없음, Gitea API 읽기 성공)이 모두 참이면 뒤 step(글꼴·게이트·`scripts/tests`·증거 업로드)을 건너뛰고 `건너뜀:` 한 줄로 성공 종료한다. 하나라도 모르거나 읽지 못하면 전부 돈다. `main_gate`(FE-GATE-029·030)와 release·tag run은 늘 돈다 (CI-FE-0004) | `config/ci/gates.json`, `scripts/contracts/ci-gates.ts`, `scripts/generate-ci-workflow.ts`, `.gitea/workflows/quality-gates.yml`, `scripts/lib/main-push-reuse.ts`, `scripts/ci/main-push-reuse.ts`, `tests/unit/main-push-reuse.test.ts`, `tests/unit/ci-workflow-generation.test.ts`, `docs/operations/ci-quality-gates.md`, `docs/work/reference/decisions.md` | `b2b92dc6` |
| [계약] | `refs/heads/main` push의 merge job 셋(`merge_static`·`merge_test`·`merge_browser`)이 `Frozen install` 다음 `main-push-reuse` step에서 직전 PR 실행을 재사용할 수 있는지 본다. checkout이 `fetch-depth: 2`로 부모 둘을 받고, 여섯 조건(main push, 부모 둘 병합 커밋·`tree(HEAD)==tree(HEAD^2)`, `.nvmrc`·`pnpm-lock.yaml` 무변경, `HEAD^2` 최신 PR run의 같은 job `success`, 그 job 로그에 `건너뜀:` 없음, Gitea API 읽기 성공)이 모두 참이면 뒤 step(글꼴·게이트·`scripts/tests`·증거 업로드)을 건너뛰고 `건너뜀:` 한 줄로 성공 종료한다. 하나라도 모르거나 읽지 못하면 전부 돈다. `main_gate`(FE-GATE-029·020·030)와 release·tag run은 늘 돈다 (CI-FE-0004) | `config/ci/gates.json`, `scripts/contracts/ci-gates.ts`, `scripts/generate-ci-workflow.ts`, `.gitea/workflows/quality-gates.yml`, `scripts/lib/main-push-reuse.ts`, `scripts/ci/main-push-reuse.ts`, `tests/unit/main-push-reuse.test.ts`, `tests/unit/ci-workflow-generation.test.ts`, `docs/operations/ci-quality-gates.md`, `docs/work/reference/decisions.md` | `b2b92dc6` |
| [계약] | 기능·scaffold 제거 드릴 FE-GATE-020을 `merge` 단계(`merge_test`, `MERGE_READY`)에서 `main` 단계(`main_gate`, `MAIN_READY`)로 옮긴다. PR 경로표 `config/ci/pr-gate-selection.json`의 `accessibility-records`·`scaffold` 줄에서 FE-GATE-020을 빼고(`scaffold` 줄은 되돌림과 계약 시험을 위해 유지), `scripts/lib/feature-scaffold-drill.ts`는 되돌림 시 재귀를 막으려 자기 스크립트(`test:sample-removal`·`test:feature-scaffold`)를 제외 목록에 남기되 merge 밖 stale 거절에서 면제한다. release·tag run과 `RELEASE_READY`는 FE-GATE-020을 요구하지 않는다. 위 "먼저 할 일" (CI-FE-0005) | `config/ci/gates.json`, `config/ci/pr-gate-selection.json`, `scripts/contracts/ci-gates.ts`, `scripts/lib/promotion-readiness.ts`, `scripts/lib/feature-scaffold-drill.ts`, `.gitea/workflows/quality-gates.yml`, `tests/unit/ci-workflow-generation.test.ts`, `tests/unit/promotion-readiness.test.ts`, `tests/unit/feature-scaffold-drill.test.ts`, `tests/unit/pr-gate-selection.test.ts`, `docs/operations/ci-quality-gates.md`, `docs/work/reference/decisions.md`, `docs/work/reference/gates.md`, `docs/work/reference/structure.md`, `docs/work/new-feature.md` | `94f8434f` |
### 그 밖의 변경
+4 -4
View File
@@ -2086,8 +2086,7 @@
"FE-GATE-010",
"FE-GATE-011",
"FE-GATE-012",
"FE-GATE-013",
"FE-GATE-020"
"FE-GATE-013"
]
},
{
@@ -2143,6 +2142,7 @@
"needs": [],
"gateIds": [
"FE-GATE-029",
"FE-GATE-020",
"FE-GATE-030"
]
}
@@ -2215,8 +2215,7 @@
"FE-GATE-005",
"FE-GATE-006",
"FE-GATE-007",
"FE-GATE-013",
"FE-GATE-020"
"FE-GATE-013"
],
"browserGateIds": [],
"environment": [
@@ -2951,6 +2950,7 @@
"timeoutMinutes": 45,
"gateIds": [
"FE-GATE-029",
"FE-GATE-020",
"FE-GATE-030"
],
"browserGateIds": [],
+2 -4
View File
@@ -37,8 +37,7 @@
],
"gates": [
"FE-GATE-005",
"FE-GATE-009",
"FE-GATE-020"
"FE-GATE-009"
]
},
{
@@ -116,8 +115,7 @@
"FE-GATE-009",
"FE-GATE-011",
"FE-GATE-012",
"FE-GATE-013",
"FE-GATE-020"
"FE-GATE-013"
]
},
{
+9 -7
View File
@@ -17,9 +17,10 @@ repo 훅·검사기·`.claude/` 지침 시험(`python3 -I -m unittest discover -
Firefox의 첫 localStorage 접근이 수 초씩 기다렸다.
PR run(`pull_request`)은 merge 게이트를 바뀐 파일로 고른다(소유자 결정 2026-11-13). 경로표는
`config/ci/pr-gate-selection.json`이다. 파일마다 `rules`를 위에서부터 보고 처음 맞는 줄의 게이트를
`always`(FE-GATE-001·002·003·010)에 더한다. 문서만 바뀌면 FE-GATE-005까지 돌고, `src/features/`처럼
scaffold 드릴의 입력이 바뀌면 FE-GATE-020까지 돈다. `global` 파일(`config/`, `scripts/`, `.gitea/`,
도구 설정, lockfile)이나 표에 없는 파일이 하나라도 바뀌면 전부 돈다. 안 도는 게이트는 그 step에서
`always`(FE-GATE-001·002·003·010)에 더한다. 문서만 바뀌면 FE-GATE-005까지, 접근성 기록은
FE-GATE-009까지, 앱 코드·시험이 바뀌면 FE-GATE-004~013까지 돈다. 기능·scaffold 드릴 FE-GATE-020은
main 단계(`main_gate`)에서 돈다. `global` 파일(`config/`, `scripts/`, `.gitea/`,
도구 설정, lockfile)이나 표에 없는 파일이 하나라도 바뀌면 merge 게이트를 전부 돈다. 안 도는 게이트는 그 step에서
`건너뜀: <게이트 ID> — <이유>`를 찍고 성공으로 끝나며, 게이트 로그도 그 한 줄이다. diff는 base
브랜치와의 merge base에서 잰다. checkout이 얕아 첫 게이트가 history를 받는다. diff를 못 읽으면 전부
돈다. main·release run은 늘 전부 돈다. 판정은 `scripts/lib/pr-gate-selection.ts`, 계약 시험은
@@ -36,7 +37,7 @@ scaffold 드릴의 입력이 바뀌면 FE-GATE-020까지 돈다. `global` 파일
(4) `HEAD^2`의 최신 `pull_request` run에서 같은 이름 job이 `success`, (5) 그 job 로그가 비어 있지
않고 `SKIPPED_GATE_LINE` 형식의 `건너뜀:` 줄이 없음(PR에서 그 job 게이트를 전부 돌았음),
(6) Gitea API(`actions/runs`·`actions/runs/{id}/jobs`·`actions/jobs/{id}/logs`)를 오류·시간 초과
없이 읽음. 하나라도 거짓이거나 읽지 못하면 게이트를 전부 돈다. `main_gate`(FE-GATE-029·030)와
없이 읽음. 하나라도 거짓이거나 읽지 못하면 게이트를 전부 돈다. `main_gate`(FE-GATE-029·020·030)와
release·tag run은 이 step을 두지 않아 늘 돈다.
merge job 셋과 main job(`main_gate`)이 의존성 캐시를 쓴다(merge job 셋은 권하는 안으로 정함
@@ -53,9 +54,10 @@ Node toolcache, corepack이 받은 pnpm, pnpm store와 메타데이터 캐시를
만들므로 매번 새로 설치한다. 이 규칙은 `scripts/contracts/ci-gates.ts`의 `DEPENDENCY_CACHE`와
계약 검사가 지킨다. runner의 캐시 저장소는 짝 백엔드와 함께 쓰고 크기 상한이 있다(platform-core
`infrastructure/ci/gitea-runner/config.yaml`). 검사기 자신의 음성 fixture와
gating 검사는 branch에 push한 뒤 main 단계(`main_gate`, FE-GATE-029)에서 돈다. 선택 runtime
제거 드릴 셋(FE-GATE-030)도 main 단계에서 돈다. PR runner 시간 약 30분 가운데 7분쯤이라
merge에서 뺐고, 실패하면 main이 빨강이 되어 다음 PR이 고친다(권하는 안으로 정함 2026-11-12, 총괄). release와
gating 검사는 branch에 push한 뒤 main 단계(`main_gate`, FE-GATE-029)에서 돈다. 기능·scaffold 제거 드릴
(FE-GATE-020, 권하는 안으로 정함 2026-11-22, ci)과 선택 runtime 제거 드릴 셋(FE-GATE-030, 권하는 안으로 정함
2026-11-12, 총괄)도 main 단계에서 돈다. PR 응답 시간을 줄이려고 merge에서 뺐고, 실패하면 main이 빨강이
되어 다음 PR이 고친다. release와
production 게이트는 matrix check로 남는다. 실패를 무시하는(soft-fail) 연결은 없다.
같은 PR이나 같은 브랜치에 새 push가 오면 workflow `concurrency`가 앞 run을 취소한다. Gitea는
앞 run의 대기 중인 job은 언제나, 돌고 있는 job은 `cancel-in-progress`가 참일 때 취소한다.
+1 -1
View File
@@ -31,7 +31,7 @@
5. import는 기능 폴더 안 계층 규칙과 꼭 지킬 것 1~3을 지킨다. 편집 훅의 경계 알림(N3)이 나오면 그 자리에서 고친다. 다른 기능을 import하지 않는다. adapter는 기능의 `adapters/`나 배럴로만 닿는다.
6. 테스트는 `tests/features/<id>/`에 둔다(기능과 함께 지워진다). 결과 불명 쓰기와 재전송 입구는 `docs/manual/02-decision-tables.md` 3·4절 기준으로 테스트한다.
7. 기준선과 증거: 초기 JS 기록(`config/scale/feature-shape-ceilings.json`의 `initialJavascript`)은 생성 출력 `Next:`의 명령으로 다시 쓰고 같은 커밋에 넣는다. 손으로 고치지 않는다. desktop에서 돌려 돌려받는다: `scripts/verify.sh exec --apply-back -- node scripts/scale/measure-feature-shape-growth.ts --initial-baseline --write`. 예산(`config/performance/budgets.json`)을 넘으면 올리기 전에 멈추고 묻는다(꼭 지킬 것 4).
8. 제거 확인: 매뉴얼 01장 11단계. 기능을 지운 사본이 게이트를 통과해야 한다: `scripts/verify.sh script test:sample-removal -- --feature=<id>`. merge 단계의 FE-GATE-020은 목록에 적은 기능과 새로 생성한 기능만 지우므로 이 기능의 제거를 대신 보여 주지 않는다.
8. 제거 확인: 매뉴얼 01장 11단계. 기능을 지운 사본이 게이트를 통과해야 한다: `scripts/verify.sh script test:sample-removal -- --feature=<id>`. main 단계의 FE-GATE-020은 목록에 적은 기능과 새로 생성한 기능만 지우므로 이 기능의 제거를 대신 보여 주지 않는다.
9. desktop에서 merge 단계와 lab 게이트를 돌린다: `scripts/verify.sh merge`, `scripts/verify.sh gate FE-GATE-026`(새 기능은 lazy 라우트를 더하므로 늘 돌린다). 결과를 보고 싶으면 서브에이전트 `arch-reviewer`(경계 리뷰. 셸이 없으니 diff를 파일로 저장해 그 경로를 준다)와 `verify-app`(desktop에서 앱을 띄워 그 라우트를 연다)에 맡긴다.
## 5. 완료 기준
+2 -1
View File
@@ -81,7 +81,8 @@
| DES-DEC-0010 시각 기준선 | 2026-11-22 | 모양은 중립(토큰으로만 브랜드). 조작부는 44px이 기본이고 예외는 다섯(작은 버튼·Menu 항목·접기·셸 헤더 select 36px, Alert·Dialog(Drawer 포함) 닫기 32px)이다. 글자 링크는 WCAG 24px·간격 기준만 본다. 그 밖의 조작부가 44px 미만이면 결함이다. 라이트와 다크는 동급이라 같은 의미 색 역할·같은 AA 기준·같은 상태 구분으로 판정하고, 한쪽에서만 깨져도 결함이다(같은 색·같은 대비 수치·같은 골든 수를 뜻하지 않는다). 서비스는 토큰과 페이지 템플릿으로 밀도를 조절한다. 재검토: `PRODUCT.md`의 세 축 문장이나 서비스 우선순위가 바뀌거나, 기본 조작부 토큰이 44px 미만이 되거나, 44px 미만 조작부 자리(CSS 최소 높이 규칙 수)가 44px 자리의 2배(추정)를 넘는다 | design 허브 DES-DEC-0010(repo 밖, 항목 DES-FE-0008), project-docs `README.md` 7절 1(권하는 안으로 정함) |
| CI 계획 D-3 판정용 재시도 | 2026-11-13 | CI(`CI=true`)에서만 Playwright가 실패한 시험을 한 번 더 돌고, 재시도에서 통과해도 게이트는 실패한다. 0925의 D-3(Web Lock 직렬화)과 다른 결정이다. 재시도는 설정 helper `flakyJudgement()`로만 주고(`scripts/lib/playwright-flaky-judgement.ts`), `scripts/check-test-evidence.ts`는 `config/repository-layout.json`의 `playwright-configs`에 든 설정(dev 설정은 없다)에서 객체 key로 직접 쓴 두 옵션을 거절한다. 펼침·변수·helper 인자로 바뀐 값과 dev 설정은 `tests/unit/playwright-flaky-judgement.test.ts`가 루트 설정마다 계산된 값으로 잡는다. spec 안의 `describe.configure({ retries })`는 둘 다 보지 않는다. `failOnFlakyTests`만으로는 본문의 `test.fail()`이 재시도에서만 불린 시험의 첫 실패가 통과로 바뀐다. 그래서 같은 파일의 reporter가 실패한 시도가 있으면 run을 실패로 끝내고, 다른 보고에 없는 그 오류를 찍는다(2026-11-22 구현에서 확인). 재시도는 e2e 공유 fixture 빌드의 앞 시도 실패 기록을 다시 쓰지 않는다(CI-FE-0001 C9). 이유: 흔들림과 회귀를 같은 run에서 가린다. 전에는 세션이 desktop에서 손으로 세 번 돌렸다. 대가: 실패한 시험만큼 시간이 든다. 많이 깨진 PR은 FE-GATE-008이 최대 약 두 배 걸린다(추정). 버린 안: 재시도 없음 그대로(판정 근거가 run에 없다), `retries`만 켜기(흔들림을 덮는다), package script·`config/ci/gates.json` args로 주기(FE-GATE-029가 부분 실행으로 세거나 Playwright에 닿지 않는다). 재검토: Playwright를 올려 `tests/unit/playwright-flaky-judgement.test.ts`가 실패하거나, 재시도 때문에 browser job이 시간 상한에 닿는다 | 권하는 안으로 정함(총괄, 2026-11-13): design-docs `ci/03-time-reduction-plan.md` 5절. 위임: 소유자 원문(2026-11-11 23:09 KST, 백엔드 세션 직접 입력) 「앞으로 카드 띄우지 말고 너가 판단하고 바로바로 진행할 수 있도록」·「최종 보고만 받을 수 있게」. 이 결정을 따로 묻고 받은 소유자 답은 없다 |
| REV-FE-0004 abort ratchet을 호출 위치·파일별 개수로 | 2026-11-22 | `check:adapter-inventory`(FE-GATE-010)의 손수 짠 abort 배선 ratchet은 AST로 센 호출 위치를 `scripts/check-adapter-inventory.ts`의 `HAND_ROLLED_ABORT_SITES`(파일 → 개수)와 같게 고정한다. 표에 없는 파일, 늘어난 수, 줄어든 수가 모두 실패한다(`!==`). 면제는 import 여부나 폴더가 아니라 이름을 댄 kernel 네 파일뿐이다(`src/adapters/platform/`의 `abortable-operation.ts`·`indexeddb-connection.ts`·`indexeddb-transaction.ts`·`system-clock.ts`). 첫 인자의 맨 왼쪽 피연산자가 문자열 "abort"이고 불리는 이름이 `addEventListener`로 끝나는 호출(`new` 포함)을 센다. 13파일 → 29곳은 세는 단위를 바꾼 것이고 이번 한 번뿐이다. 뒤에 수를 올리는 근거로 쓰지 못한다. 이유(확인한 사실): 옛 검사는 primitive를 import한 파일과 줄을 나눈 호출에 리스너를 더해도 통과했다. 버린 안: 줄바꿈 정규식만 더하기(면제 빈틈이 남는다), 합계 하나만 고정(파일 사이로 옮기면 통과한다). 한계: 리스너 수가 그대로인 import 제거, 주석·문자열·문서 글자는 옛 검사가 실패시킬 수 있었지만 새 검사는 통과시킨다. 변수 첫 인자도 세지 않는다. 재검토: 한계에 적지 않은 꼴로 실행되고 타입·lint를 지나는 abort 배선이 이 검사를 지나가는 꼴이 나오면 세는 경계를 다시 본다 | review 허브, 위임: project-docs README 7절 1번(소유자 지시 2026-11-22) 「결정이 필요하면 권하는 안대로 바로 한다.」. 출처 REV-FE-0004(repo 밖 카드) |
| CI 계획 D-1 main push merge job 재사용 | 2026-11-13 | `refs/heads/main` push의 merge job 셋(`merge_static`·`merge_test`·`merge_browser`)은 `Frozen install` 다음 `main-push-reuse` step에서 여섯 조건(main push, 부모 둘 병합 커밋·`tree(HEAD)==tree(HEAD^2)`, `pnpm-lock.yaml`·`.nvmrc` 무변경, `HEAD^2` PR run의 같은 job `success`, 그 job 로그에 `건너뜀:` 없음, API 읽기 성공)이 모두 참이면 뒤 step(글꼴·게이트·`scripts/tests`·업로드)을 건너뛰고 `건너뜀:` 한 줄로 성공 종료한다. 하나라도 모르거나 실패하면 전부 돈다(`scripts/lib/main-push-reuse.ts`, `scripts/ci/main-push-reuse.ts`, `tests/unit/main-push-reuse.test.ts`). `main_gate`(FE-GATE-029·030)와 release·tag run은 늘 돈다. 이유: 최근 병합 대부분이 PR과 같은 트리인데 merge job 셋을 두 번 돌고 있었다. 대가: 같은 트리 두 번째 실행 표본이 줄어든다(CI 계획 D-3 판정용 재시도가 PR run 안에서 흔들림 판정을 대신한다). 버린 안: main에서 경로표 재계산(PR 기준 main과 HEAD^1 사이 되돌림을 놓친다), 보호 규칙만 믿고 조건 4 생략(우회 병합을 못 막는다), 게이트 단위 건너뛰기(D-1 범위 밖). 재검토: 건너뛴 main push 뒤 다음 main push에서 같은 트리에 의존하는 회귀나 비결정 시험 실패가 나오면 끄고 원인을 고친다 | 권하는 안으로 정함(총괄, 2026-11-13, design-docs `ci/03-time-reduction-plan.md` 4.2·5절 D-1 (가)); CI-FE-0004 정정(2026-11-22, CI-X-0003 (바))으로 `now` 우선 |
| CI 계획 D-1 main push merge job 재사용 | 2026-11-13 | `refs/heads/main` push의 merge job 셋(`merge_static`·`merge_test`·`merge_browser`)은 `Frozen install` 다음 `main-push-reuse` step에서 여섯 조건(main push, 부모 둘 병합 커밋·`tree(HEAD)==tree(HEAD^2)`, `pnpm-lock.yaml`·`.nvmrc` 무변경, `HEAD^2` PR run의 같은 job `success`, 그 job 로그에 `건너뜀:` 없음, API 읽기 성공)이 모두 참이면 뒤 step(글꼴·게이트·`scripts/tests`·업로드)을 건너뛰고 `건너뜀:` 한 줄로 성공 종료한다. 하나라도 모르거나 실패하면 전부 돈다(`scripts/lib/main-push-reuse.ts`, `scripts/ci/main-push-reuse.ts`, `tests/unit/main-push-reuse.test.ts`). `main_gate`(FE-GATE-029·020·030)와 release·tag run은 늘 돈다. 이유: 최근 병합 대부분이 PR과 같은 트리인데 merge job 셋을 두 번 돌고 있었다. 대가: 같은 트리 두 번째 실행 표본이 줄어든다(CI 계획 D-3 판정용 재시도가 PR run 안에서 흔들림 판정을 대신한다). 버린 안: main에서 경로표 재계산(PR 기준 main과 HEAD^1 사이 되돌림을 놓친다), 보호 규칙만 믿고 조건 4 생략(우회 병합을 못 막는다), 게이트 단위 건너뛰기(D-1 범위 밖). 재검토: 건너뛴 main push 뒤 다음 main push에서 같은 트리에 의존하는 회귀나 비결정 시험 실패가 나오면 끄고 원인을 고친다 | 권하는 안으로 정함(총괄, 2026-11-13, design-docs `ci/03-time-reduction-plan.md` 4.2·5절 D-1 (가)); CI-FE-0004 정정(2026-11-22, CI-X-0003 (바))으로 `now` 우선 |
| CI-X-0002 (다) FE-GATE-020을 main 단계로 | 2026-11-22 | 기능·scaffold 제거 드릴 FE-GATE-020을 `merge` 단계(`merge_test`)에서 빼고 `main` 단계(`main_gate`, `MAIN_READY`)로 옮긴다(`config/ci/gates.json`, `scripts/contracts/ci-gates.ts`, `scripts/lib/promotion-readiness.ts`). `scripts/lib/feature-scaffold-drill.ts`는 되돌림 시 재귀를 막으려 자기 스크립트(`test:sample-removal`·`test:feature-scaffold`)를 제외 목록에 남기되 merge 밖 stale 거절에서만 면제한다. 경로표 `config/ci/pr-gate-selection.json`의 `accessibility-records`·`scaffold` 줄에서 FE-GATE-020을 빼고, `scaffold` 줄은 되돌림과 계약 시험을 위해 남긴다. 생성기·드릴·`src/features`·`src/contexts` 규칙을 바꾸는 PR은 `scripts/verify.sh gate FE-GATE-020`을 직접 돌린다. 이유: PR 실행 중앙값이 17.7분으로 15분 목표를 넘었고 FE-GATE-020이 PR 34건 중 25건에서 돌아 약 6분을 차지했다. 대가: 드릴 회귀가 PR이 아니라 main 빨강으로 드러나고, release·tag run과 `RELEASE_READY`도 FE-GATE-020을 요구하지 않는다. 버린 안: (나) FE-GATE-020 전용 드릴 입력 목록(정직한 목록이면 효과가 미미하고 손 목록이면 거짓 초록 자리가 생긴다), vitest `--changed`(coverage 문턱이 전체 실행을 전제한다). 재검토: 병합 뒤 4주 동안 `refs/heads/main` push의 `main_gate`에서 FE-GATE-020이 두 번 넘게 실패하면(취소·흔들림 장부 제외) merge 단계로 되돌린다 | 권하는 안으로 정함(ci, 2026-11-22, project-docs `README.md` 7절 1번, 결정 카드 CI-X-0002, 일감 CI-FE-0005) |
| 구조·기술 결정 기록 | 2026-07-26~ | `VD-01`~(빈 번호 있음) | `docs/adr/` |
## 3. 결정 대기 쓰는 법
+2 -1
View File
@@ -53,6 +53,7 @@ scripts/verify.sh <단계> [대상…] [--on here|<호스트>] [--log <이름>]
| 공급망·release 경로를 바꿀 때 | `scripts/verify.sh release` |
| 작업 매뉴얼·훅을 바꿀 때 | 노트북 `scripts/verify.sh docs`, `scripts/verify.sh hooks`. 문서(작업 매뉴얼, `.claude/` 아래 문서, `AGENTS.md`·`CLAUDE.md` 포함)를 바꿨으면 desktop `scripts/verify.sh script verify:documentation`도 |
| 검사 script·그 fixture를 바꿀 때 | merge에 더해 `scripts/verify.sh gate FE-GATE-029`(검사기 자기 시험은 main 단계에 있다) |
| 생성기(`scripts/create-feature.ts`·`scripts/create-feature-write-slice.ts`·`scripts/lib/generated-feature.ts`)·드릴·`src/features`·`src/contexts` 규칙을 바꿀 때 | merge에 더해 `scripts/verify.sh gate FE-GATE-020`(기능·scaffold 드릴은 main 단계에 있다) |
release 단계 게이트는 merge 단계에 없다. 그래서 lab 게이트 회귀가 147커밋 동안 아무 게이트에도 걸리지 않은 일이 있다. 바꾼 것이 release 단계 게이트가 지키는 것에 닿으면 그 게이트도 돌린다.
@@ -112,7 +113,7 @@ release 단계 게이트는 merge 단계에 없다. 그래서 lab 게이트 회
- **보는 것:** 언어(한국어인가), 문체(「~한다」), 숫자 복사, 기록의 머리 블록, 문서 지도와 루트 README 필수 절. 그리고 백틱 안의 repo 경로(`:줄` 꼬리는 떼고 본다), 셸 코드 블록과 백틱 안 명령의 경로 인자, 마크다운 링크, `corepack pnpm <script>`와 백틱 안 `<prefix>:<name>` 꼴의 package script, `FE-GATE-0NN` ID가 실제로 있는가. 설명·수치가 코드와 맞는지는 보지 않는다.
- **예외:** git이 무시하는 생성 산출물, 복사한 프로젝트가 지운 작업 이력(루트 `README.md`의 지워도 되는 파일 표)은 없어도 된다.
- **짝 백엔드 경로:** `config/contracts/backend-contract-pin.json`이 고정한 커밋의 트리에서 찾는다. 옆 checkout이 없거나 그 커밋이 없으면 실패가 아니라 "확인 못 함"으로 남긴다.
- **도는 곳:** FE-GATE-017은 merge 체인 밖이다. 그러나 같은 검사가 merge 게이트 안에서도 돈다. `tests/unit/documentation-readiness.test.ts`가 이 repo 그대로 한 번, 문서를 복사해 여러 번 검사를 돌리고(FE-GATE-005), 기능을 지우거나 더한 사본을 만드는 FE-GATE-020의 드릴도 문서를 복사해 돌린다(복사 목록은 `scripts/lib/removal-fixture.ts`). 그래서 살아 있는 문서의 경로 하나, 영어 문단 하나가 merge를 막는다.
- **도는 곳:** FE-GATE-017은 merge 체인 밖이다. 그러나 같은 검사가 merge 게이트 안에서도 돈다. `tests/unit/documentation-readiness.test.ts`가 이 repo 그대로 한 번, 문서를 복사해 여러 번 검사를 돌리고(FE-GATE-005), 기능을 지우거나 더한 사본을 만드는 FE-GATE-020(main 단계)의 드릴도 문서를 복사해 돌린다(복사 목록은 `scripts/lib/removal-fixture.ts`). 그래서 살아 있는 문서의 경로 하나, 영어 문단 하나가 merge와 main을 막는다.
- **돌리는 법:** desktop에서 `scripts/verify.sh script verify:documentation`. 설치가 끝난 worktree라 pnpm이 재설치 대기로 멈추지 않는다.
- 작업 매뉴얼의 분량·이력 ID·뼈대는 `verify:documentation`이 보지 않는다. `scripts/verify.sh docs`가 본다.
+1 -1
View File
@@ -114,7 +114,7 @@ src/ 최상위 폴더 ── 역할: docs/architecture/layers.md 표
## 12. 제거 가능성
지울 수 있는 단위는 드릴이 지킨다. 기능 드릴(샘플 제거, 생성 기능의 scaffold·제거)은 merge 게이트 FE-GATE-020, 선택 runtime 제거 드릴 셋(optional recipe, browser file/storage, realtime)은 main 단계 FE-GATE-030이다(권하는 안으로 정함 2026-11-12, 총괄). 드릴 목록은 `config/ci/gates.json`의 두 게이트 `commandIds`다. 선택 runtime을 바꾼 PR은 merge에서 FE-GATE-030이 돌지 않으니 `scripts/verify.sh gate FE-GATE-030`을 직접 돌린다.
지울 수 있는 단위는 드릴이 지킨다. 기능 드릴(샘플 제거, 생성 기능의 scaffold·제거)은 main 단계 FE-GATE-020(권하는 안으로 정함 2026-11-22, ci), 선택 runtime 제거 드릴 셋(optional recipe, browser file/storage, realtime)은 main 단계 FE-GATE-030이다(권하는 안으로 정함 2026-11-12, 총괄). 드릴 목록은 `config/ci/gates.json`의 두 게이트 `commandIds`다. 생성기·드릴·기능·context 규칙이나 선택 runtime을 바꾼 PR은 merge에서 두 게이트가 돌지 않으니 `scripts/verify.sh gate FE-GATE-020` 또는 `scripts/verify.sh gate FE-GATE-030`을 직접 돌린다.
- 구조를 바꾸면 드릴을 돌린다. 드릴 fixture가 복사하는 목록(`scripts/lib/removal-fixture.ts`, 이 목록 하나만 쓴다)이 바뀐 구조를 아는지 본다. 그 목록에 `README.md`·`CHANGELOG.md`가 없어 드릴 넷 중 셋이 항상 실패한 일이 있다(결함 패턴 G11).
- 드릴은 오래 걸린다(desktop 2026-11-13 실측: FE-GATE-020과 FE-GATE-030 합쳐 약 10분 30초). desktop에서 잠금 아래 돌린다.
+6 -6
View File
@@ -961,7 +961,7 @@ function validateContractSemantics(
// pushes initial JavaScript over budget fails before it merges, not at the
// next tagged release.
merge_static: ["FE-GATE-001", "FE-GATE-002", "FE-GATE-003", "FE-GATE-010", "FE-GATE-011", "FE-GATE-012"],
merge_test: ["FE-GATE-004", "FE-GATE-005", "FE-GATE-006", "FE-GATE-007", "FE-GATE-013", "FE-GATE-020"],
merge_test: ["FE-GATE-004", "FE-GATE-005", "FE-GATE-006", "FE-GATE-007", "FE-GATE-013"],
merge_browser: ["FE-GATE-008", "FE-GATE-009"],
release_gate: ["FE-GATE-014", "FE-GATE-026", "FE-GATE-028"],
immutable_build: ["FE-GATE-015", "FE-GATE-027"],
@@ -975,11 +975,11 @@ function validateContractSemantics(
field_gate: ["FE-GATE-018"],
documentation_gate: ["FE-GATE-017"],
// F2. The checkers' own negative fixtures and the gating coverage check
// run after a merge to main, not on every pull request. So do the optional
// runtime removal drills (FE-GATE-030, owner decision 2026-11-12 p): about
// seven of a pull request's thirty runner minutes, the same shape as the
// paired backend's nightly lanes.
main_gate: ["FE-GATE-029", "FE-GATE-030"],
// run after a merge to main, not on every pull request. So do the sample /
// feature scaffold drills (FE-GATE-020, CI-X-0002 (다) / CI-FE-0005) and
// the optional runtime removal drills (FE-GATE-030, owner decision
// 2026-11-12 p), the same shape as the paired backend's nightly lanes.
main_gate: ["FE-GATE-029", "FE-GATE-020", "FE-GATE-030"],
};
// 1101/13-03. The provider jobs run FE-GATE-013's sandbox (systemd-run
// scope, bwrap with the same namespace options), so they need its host.
+17 -4
View File
@@ -16,12 +16,22 @@ import type { RemovalCheck } from "./removal-fixture.ts";
* unless this list names it, with the reason it cannot run in the drill.
*/
const BROWSER =
"needs Playwright browsers. FE-GATE-020 runs in a merge job without them " +
"(merge_test installs none). The generated routes in the browser " +
"needs Playwright browsers. FE-GATE-020 runs in a main job without them " +
"(main_gate installs none). The generated routes in the browser " +
"gates are reviewed as 1103/12-01 and 12-03.";
const DRILL =
"a removal drill copies the repository again. The drill runs the generated " +
"feature's own removal instead (feature-removal).";
/**
* FE-GATE-020's own drill scripts. Kept in SCAFFOLD_DRILL_EXCLUDED_SCRIPTS
* even while FE-GATE-020 runs in the main stage (CI-X-0002 (다) / CI-FE-0005)
* so reverting FE-GATE-020 back to merge cannot make the drill recurse into
* itself inside its fixture copy.
*/
export const SCAFFOLD_DRILL_SELF_SCRIPTS: readonly string[] = Object.freeze([
"test:sample-removal",
"test:feature-scaffold",
]);
/**
* The drill runs FE-GATE-005's test:coverage in the same copy, and its paths
* hold every path of these suites (tests/unit/removal-drill-test-paths.test.ts).
@@ -119,10 +129,13 @@ export function scaffoldDrillCommands(
}
// An exclusion for a command that moved out of the merge stage would hide
// nothing today and silently drop it if it came back. A command the contract
// no longer has at all (a removal drill pruned its capability) is not stale.
// no longer has at all (a removal drill pruned its capability) is not stale,
// and FE-GATE-020's own drill scripts stay excluded so reverting FE-GATE-020
// back to merge never recurses.
const selfScripts = new Set<string>(SCAFFOLD_DRILL_SELF_SCRIPTS);
const contractScripts = new Set(contract.commands.map(({ script }) => script));
const stale = Object.keys(excluded).filter(
(script) => contractScripts.has(script) && !mergeScripts.has(script),
(script) => contractScripts.has(script) && !mergeScripts.has(script) && !selfScripts.has(script),
);
if (stale.length > 0) {
throw new TypeError(
+4 -4
View File
@@ -14,7 +14,6 @@ export const PROMOTION_FORMULA = Object.freeze({
// 15-01. Bundle budget: a PR that exceeds it is not merge-ready.
"FE-GATE-012",
"FE-GATE-013",
"FE-GATE-020",
]),
RELEASE_READY: Object.freeze([
"FE-GATE-014",
@@ -44,9 +43,10 @@ export const PROMOTION_FORMULA = Object.freeze({
// fixtures and the gating coverage check run after a merge to main. They
// test the checkers, not the change, so they hold no promotion.
// FE-GATE-030 (owner decision 2026-11-12 p): the optional runtime removal
// drills moved here from FE-GATE-020. A failure turns main red, and the next
// pull request fixes it before it merges.
MAIN_READY: Object.freeze(["FE-GATE-029", "FE-GATE-030"]),
// drills moved here from FE-GATE-020. FE-GATE-020 (CI-X-0002 (다) /
// CI-FE-0005) moved here too so PR runs skip the ~6-minute scaffold drill.
// A failure turns main red, and the next pull request fixes it before merge.
MAIN_READY: Object.freeze(["FE-GATE-029", "FE-GATE-020", "FE-GATE-030"]),
});
export type GateResult = "PASS" | "FAIL" | "UNVERIFIED";
@@ -181,9 +181,6 @@ jobs:
- name: "FE-GATE-013 / security"
if: \${{ steps.main-push-reuse.outputs.reuse != 'true' && !cancelled() }}
run: corepack pnpm ci:gate -- FE-GATE-013 --enter-host-environment
- name: "FE-GATE-020 / removability"
if: \${{ steps.main-push-reuse.outputs.reuse != 'true' && !cancelled() }}
run: corepack pnpm ci:gate -- FE-GATE-020
- name: Upload merge test evidence
if: \${{ always() && steps.main-push-reuse.outputs.reuse != 'true' }}
uses: https://github.com/ChristopherHX/gitea-upload-artifact@81f940d004763f986ba3582c007fd842dd5cb0d7
@@ -732,6 +729,9 @@ jobs:
- name: "FE-GATE-029 / checker-self-tests"
if: \${{ !cancelled() }}
run: corepack pnpm ci:gate -- FE-GATE-029
- name: "FE-GATE-020 / removability"
if: \${{ !cancelled() }}
run: corepack pnpm ci:gate -- FE-GATE-020
- name: "FE-GATE-030 / optional-removability"
if: \${{ !cancelled() }}
run: corepack pnpm ci:gate -- FE-GATE-030
+19 -5
View File
@@ -205,9 +205,10 @@ describe("CI gate contract", () => {
expect(index.gates.get("FE-GATE-020")?.name).toBe("removability");
});
it("runs the optional runtime removal drills in the main stage, the feature drills in merge", async () => {
// Owner decision 2026-11-12 p: the three optional runtime removal drills
// left the pull request's merge stage; the sample and scaffold drills stay.
it("runs both the feature and optional runtime removal drills in the main stage", async () => {
// Owner decision 2026-11-12 p moved FE-GATE-030 to main; CI-X-0002 (다)
// (CI-FE-0005) moved FE-GATE-020 to main so PR runs skip the ~6-minute
// scaffold drill while every main push still runs both removal drill gates.
const contract = await loadCiGateContract(process.cwd());
const index = indexCiGateContract(contract);
const scriptsOf = (gateId: string) =>
@@ -218,13 +219,26 @@ describe("CI gate contract", () => {
contract.jobs.find(({ gateIds }) => gateIds.includes(gateId))?.id;
expect(scriptsOf("FE-GATE-020")).toEqual(["test:sample-removal", "test:feature-scaffold"]);
expect([stageOf("FE-GATE-020"), jobOf("FE-GATE-020")]).toEqual(["merge", "merge_test"]);
expect([stageOf("FE-GATE-020"), jobOf("FE-GATE-020")]).toEqual(["main", "main_gate"]);
expect(scriptsOf("FE-GATE-030")).toEqual([
"test:optional-recipe-removal",
"test:browser-file-storage-removal",
"test:realtime-removal",
]);
expect([stageOf("FE-GATE-030"), jobOf("FE-GATE-030")]).toEqual(["main", "main_gate"]);
const workflow = renderCiWorkflow(contract);
const jobSection = (jobId: string) => {
const start = workflow.indexOf(`\n ${jobId}:\n`);
expect(start, jobId).toBeGreaterThan(0);
const next = workflow.slice(start + 1).search(/\n {2}[a-z_]+:\n/u);
return workflow.slice(start + 1, next < 0 ? undefined : start + 1 + next + 1);
};
for (const mergeJobId of ["merge_static", "merge_test", "merge_browser"] as const) {
expect(jobSection(mergeJobId), mergeJobId).not.toContain("FE-GATE-020");
}
expect(jobSection("main_gate")).toContain('name: "FE-GATE-020 / removability"');
expect(jobSection("main_gate")).toContain("run: corepack pnpm ci:gate -- FE-GATE-020");
});
it("runs the signed manual accessibility review at release, not merge (08-06)", async () => {
@@ -2231,7 +2245,7 @@ describe("CI workflow generation", () => {
it.each([
["a non-matrix gate step", " run: corepack pnpm ci:gate -- FE-GATE-027\n", "FE-GATE-027"],
["a matrix entry", " - { gate: FE-GATE-028, name: manual-accessibility-review, browser: false }\n", "FE-GATE-028"],
["a gate step of a merge job", " run: corepack pnpm ci:gate -- FE-GATE-020\n", "FE-GATE-020"],
["a gate step of a merge job", " run: corepack pnpm ci:gate -- FE-GATE-007\n", "FE-GATE-007"],
])("rejects a workflow that drops %s", async (_name, line, gateId) => {
const contract = await loadCiGateContract(process.cwd());
const workflow = renderCiWorkflow(contract);
+20 -1
View File
@@ -5,6 +5,7 @@ import { describe, expect, it } from "vitest";
import { loadCiGateContract } from "../../scripts/contracts/ci-gates.ts";
import {
SCAFFOLD_DRILL_EXCLUDED_SCRIPTS,
SCAFFOLD_DRILL_SELF_SCRIPTS,
scaffoldDrillCommands,
} from "../../scripts/lib/feature-scaffold-drill.ts";
@@ -71,13 +72,31 @@ describe("feature scaffold drill commands", () => {
const mergeScripts = new Set(
contract.commands.filter(({ id }) => mergeCommandIds.has(id)).map(({ script }) => script),
);
const outside = contract.commands.find(({ script }) => !mergeScripts.has(script))!;
const selfScripts = new Set<string>(SCAFFOLD_DRILL_SELF_SCRIPTS);
const outside = contract.commands.find(({ script }) => !mergeScripts.has(script) && !selfScripts.has(script))!;
expect(() => scaffoldDrillCommands(contract, {
...SCAFFOLD_DRILL_EXCLUDED_SCRIPTS,
[outside.script]: "not in the merge stage",
})).toThrow(`outside the merge stage: ${outside.script}`);
});
it("keeps FE-GATE-020's own drill scripts excluded even when FE-GATE-020 lives in main or moves back to merge", async () => {
const contract = structuredClone(await loadCiGateContract(process.cwd()));
const commandsInMain = scaffoldDrillCommands(contract);
expect(commandsInMain.length).toBeGreaterThan(0);
for (const script of SCAFFOLD_DRILL_SELF_SCRIPTS) {
expect(Object.hasOwn(SCAFFOLD_DRILL_EXCLUDED_SCRIPTS, script)).toBe(true);
expect(commandsInMain.map(({ script: runScript }) => runScript)).not.toContain(script);
}
const mergeStage = contract.stages.find(({ id }) => id === "merge")!;
const mainStage = contract.stages.find(({ id }) => id === "main")!;
mainStage.gateIds = mainStage.gateIds.filter((id) => id !== "FE-GATE-020");
mergeStage.gateIds.push("FE-GATE-020");
const commandsIfReverted = scaffoldDrillCommands(contract);
expect(commandsIfReverted).toEqual(commandsInMain);
});
// A removal drill prunes its capability's commands from the contract, and
// this file runs inside that fixture too.
it("accepts an exclusion whose command the contract no longer has", async () => {
+16 -12
View File
@@ -166,7 +166,7 @@ describe("PR path table (contract)", () => {
);
expect(uncovered).toEqual([]);
// The other way: an exact src path on the row is one a render imports, so
// a path the generator stopped importing does not keep FE-GATE-020 on it.
// the scaffold row stays aligned with generator imports for rollback.
const notImported = scaffold.paths.filter(
(pattern) => pattern.startsWith("src/") && !/[*?]/u.test(pattern) && !imports.named.has(pattern),
);
@@ -181,13 +181,13 @@ describe("PR gate selection", () => {
);
});
it("adds the accessibility gate and the removal drill for the accessibility records", () => {
it("adds the accessibility gate for the accessibility records without the main-stage removal drill", () => {
expect(selected(["docs/accessibility/route-reviews/APP_HOME.md"])).toEqual(
[...ALWAYS, "FE-GATE-005", "FE-GATE-009", "FE-GATE-020"].sort(),
[...ALWAYS, "FE-GATE-005", "FE-GATE-009"].sort(),
);
});
it("runs the application gates but not the scaffold drill for code outside its inputs", () => {
it("runs the application gates without the main-stage scaffold drill for code changes", () => {
const gates = selected(["src/presentation/pages/home-page.tsx", "tests/e2e/app-shell.spec.ts"]);
expect(gates).not.toBe("all");
expect(gates).toContain("FE-GATE-008");
@@ -195,10 +195,14 @@ describe("PR gate selection", () => {
expect(gates).not.toContain("FE-GATE-020");
});
it("runs the scaffold drill when its inputs change", () => {
expect(selected(["src/features/reference/index.ts"])).toContain("FE-GATE-020");
expect(selected(["src/features/reference/index.ts"])).toContain("FE-GATE-008");
expect(selected(["tests/mocks/scenarios/catalog.ts"])).toContain("FE-GATE-020");
it("keeps the scaffold row aligned for application gates while FE-GATE-020 runs in main", () => {
for (const file of ["src/features/reference/index.ts", "tests/mocks/scenarios/catalog.ts"]) {
const gates = selected([file]);
expect(gates).not.toBe("all");
expect(gates).toContain("FE-GATE-008");
expect(gates).toContain("FE-GATE-013");
expect(gates).not.toContain("FE-GATE-020");
}
});
it("runs every gate for a global file, an unknown file or an empty diff", () => {
@@ -294,14 +298,14 @@ describe("PR diff and the skip decision", () => {
const docsOnly = () =>
fakeGit({ "rev-parse": { stdout: "false\n" }, "merge-base": { stdout: "abc\n" }, diff: { stdout: "docs/a.md\n" } }).git;
const root = process.cwd();
expect(prGateSkipReason("FE-GATE-020", {}, root, docsOnly())).toBeUndefined();
expect(prGateSkipReason("FE-GATE-020", { [PR_BASE_REF_VARIABLE]: "" }, root, docsOnly())).toBeUndefined();
expect(prGateSkipReason("FE-GATE-020", { [PR_BASE_REF_VARIABLE]: "main" }, root, docsOnly())).toMatch(
expect(prGateSkipReason("FE-GATE-008", {}, root, docsOnly())).toBeUndefined();
expect(prGateSkipReason("FE-GATE-008", { [PR_BASE_REF_VARIABLE]: "" }, root, docsOnly())).toBeUndefined();
expect(prGateSkipReason("FE-GATE-008", { [PR_BASE_REF_VARIABLE]: "main" }, root, docsOnly())).toMatch(
/^바뀐 파일 1개가 경로표/u,
);
expect(prGateSkipReason("FE-GATE-005", { [PR_BASE_REF_VARIABLE]: "main" }, root, docsOnly())).toBeUndefined();
expect(
prGateSkipReason("FE-GATE-020", { [PR_BASE_REF_VARIABLE]: "main" }, root, fakeGit({ fetch: { status: 1 } }).git),
prGateSkipReason("FE-GATE-008", { [PR_BASE_REF_VARIABLE]: "main" }, root, fakeGit({ fetch: { status: 1 } }).git),
).toBeUndefined();
});
});
+1
View File
@@ -32,6 +32,7 @@ describe("promotion readiness formula", () => {
["FE-GATE-018", "FIELD_SLO_READY"],
["FE-GATE-017", "DOCUMENTATION_READY"],
["FE-GATE-029", "MAIN_READY"],
["FE-GATE-020", "MAIN_READY"],
["FE-GATE-030", "MAIN_READY"],
] as const)("fails closed when %s fails", (failedGate, readiness) => {
const result = evaluatePromotionReadiness({