merge 단계(=PR)가 변경이 아니라 검사기 자신을 시험하는 명령까지 돈다. 검사기가 나쁜 입력을 거부하는지 보는 `*:fixture` 명령 15개, 모든 시험 파일과 검증 script가 게이트에 걸렸는지 보는 ungated 검사, CI 계약의 개수·해시 기준선(`config/ci/contract-baseline.json`)이다. 기준선은 게이트 명령 하나를 더하거나 빼도 OWNER·REASON을 붙여 다시 받아야 했다. 소유자 결정(2026-09-16)은 개수·배선 검사를 main 단계에 두는 것이다. 고른 방법(design-docs repo-structure/03-ci.md 7.3절 F2, README.md 3.3절, 소유자 승인 2026-11-07): - 새 게이트 FE-GATE-029 `checker-self-tests`, 새 단계 `main` (`MAIN_READY`, 승격을 막지 않는다), 새 job `main_gate`. 브랜치 push와 `workflow_dispatch`(stage=main)에서만 돈다. PR과 태그에서는 돌지 않는다. - FE-GATE-001·005·008·010·013의 `*:fixture` 명령 15개와 그 증거 산출물 10개를 FE-GATE-029로 옮긴다. - `check:ci`의 ungated 검사를 `scripts/check-ci-gating.ts` (`check:ci:gating`)로 떼어 FE-GATE-029에 둔다. `check:ci`는 계약· workflow 검사만 PR에서 돈다. - 기준선 파일, `update:ci-contract-baseline`, 그 검사를 지운다(소유자 결정). 계약 모양은 ci-gates.ts의 의미 검사가 지킨다. 개수를 고정하던 단위 시험의 개수 단언도 뺐다. 남긴 것: 음성 타입 fixture(`check:types:fixtures`, FE-GATE-003)는 이름이 `*:fixture`여도 merge에 둔다. 검사기가 아니라 src의 포트·계약 타입을 시험한다. `TelemetryPort.emit`을 넓히는 변경을 PR에서 막는다(정리 3단계 9.3절 변이로 확인). merge 단계 명령 참조 64 → 49. 위험: 검사기를 망가뜨린 PR은 merge를 통과하고 main에서 빨개진다. 그 대가로 PR이 검사기 자기 시험을 기다리지 않는다(설계 7.5절의 같은 교환). FE-GATE-029의 명령이 앞 게이트 산출물 없이 새 checkout에서 도는지는 desktop에서 따로 확인했다(PR 본문). 검증(desktop): check:ci, check:ci:gating, check:types, CI 시험 통과. merge 단계·FE-GATE-029 실행 결과는 PR 본문에 적는다. Refs: design-docs repo-structure/03-ci.md 7.3·7.4절, README.md 3.3절
47 lines
1.4 KiB
TypeScript
47 lines
1.4 KiB
TypeScript
import { z } from "zod";
|
|
|
|
export const ciContractReportSchema = z
|
|
.object({
|
|
schemaVersion: z.literal(2),
|
|
nodeVersion: z.string().regex(/^\d+\.\d+\.\d+$/u),
|
|
gateCount: z.literal(28),
|
|
commandDefinitionCount: z.number().int().positive(),
|
|
commandReferenceCount: z.number().int().positive(),
|
|
artifactCount: z.number().int().positive(),
|
|
jobCount: z.literal(13),
|
|
workflowSha256: z.string().regex(/^[a-f0-9]{64}$/u),
|
|
durationStatus: z.string().min(1),
|
|
negativeFixtures: z.array(
|
|
z
|
|
.object({
|
|
readiness: z.enum([
|
|
"MERGE_READY",
|
|
"RELEASE_READY",
|
|
"PROD_PROMOTION_READY",
|
|
"FIELD_SLO_READY",
|
|
"DOCUMENTATION_READY",
|
|
"MAIN_READY",
|
|
]),
|
|
failedGate: z.string().regex(/^FE-GATE-\d{3}$/u),
|
|
passed: z.boolean(),
|
|
})
|
|
.strict(),
|
|
),
|
|
failures: z.array(z.string()),
|
|
passed: z.boolean(),
|
|
})
|
|
.strict()
|
|
.superRefine((report, context) => {
|
|
const fail = (path: PropertyKey[], message: string) =>
|
|
context.addIssue({ code: "custom", path, message });
|
|
if ((report.passed === true) !== (report.failures.length === 0)) {
|
|
fail(["passed"], "passed must agree with failures");
|
|
}
|
|
if (
|
|
report.negativeFixtures.length !== 6 ||
|
|
report.negativeFixtures.some((fixture) => !fixture.passed)
|
|
) {
|
|
fail(["negativeFixtures"], "every readiness negative fixture must pass");
|
|
}
|
|
});
|