From 52e7d2c74560926568c7cdfa46509ed9be93db30 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Sat, 21 Nov 2026 08:56:32 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix(fixture):=20design-system=C2=B7diagnost?= =?UTF-8?q?ics=20=EC=9D=8C=EC=84=B1=20fixture=EB=A5=BC=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=EB=A7=88=EB=8B=A4=20=EA=B1=B0=EC=A0=88=ED=95=9C?= =?UTF-8?q?=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit FE-GATE-029는 check:design-system:fixture와 check:diagnostics:fixture가 exit 1과 머리말을 내면 통과로 센다. 거절된 파일이 하나만 있어도 그 조건이 채워진다. 그래서 검사기에서 진짜 규칙(TSX의 raw palette·hue mix·inline style, direct console·민감 context)을 지워도 029가 초록이었다. fixture 폴더에서만 도는 표식 규칙(TOOLTIP_ONLY_REQUIRED_INFORMATION, UNKNOWN_DIAGNOSTIC_EVENT)이 자기 파일을 늘 거절했기 때문이다. check-i18n.ts가 하던 파일별 판정을 scripts/lib/fixture-rejection.ts로 옮기고 세 검사기가 같이 쓴다. fixture 모드에서 어느 failure도 이름을 대지 않는 fixture 파일이 있거나 fixture 파일이 하나도 없으면, 그 목록을 찍고 exit 2로 끝난다. 029는 exit 1을 기대하므로 실패한다. 파일 이름은 경로 경계로 맞춘다(a.ts가 a.tsx·b/a.ts에 맞지 않는다). i18n 판정은 endsWith에서 이 판정으로 바뀌어 조금 엄격해진다. 표식 규칙 둘을 지운다. tooltip-only.tsx는 그 표식 말고 거절할 규칙이 없어 지운다. headless-vendor-import.tsx·hue-mix.tsx를 더하고, raw-palette.tsx는 inline style 없이 SVG fill로 바꿔 fixture 하나가 규칙 하나에 걸리게 한다. direct-console.ts에서는 표식 문자열을 뺀다. fe-design-system 스킬이 지운 tooltip 규칙을 있는 것처럼 적던 줄도 고친다. 버린 안: gates.json의 expectedDiagnosticId를 규칙 문구로 좁히기. 항목 범위가 029 정의를 바꾸지 말라고 하고, 규칙이 여럿이라 문구 하나로는 다 못 본다. 한계: 파일마다 「failure가 하나라도 있는지」를 본다. fixture 하나에 서로 다른 규칙 둘이 걸리면 하나를 지워도 다른 하나가 거절한다. 지금 fixture는 규칙 하나씩이고 시험이 failure 목록을 그대로 단언하지만, 새 fixture에 그것을 강제하지는 않는다. check-i18n.ts가 helper를 부르는지 단언하는 시험은 없다(main에도 없다). 시험: design-system-rules.test.ts·fixture-rejection.test.ts가 임시 root에서 검사기를 돌려, fixture마다 기대한 failure만 나오는지와 거절되지 않는 파일을 더하면 exit 2와 그 파일이 찍히는지 본다. helper는 경로 경계· 빈 폴더를 단위로 본다. timeout은 desktop에서 잰 가장 긴 값(test:unit 1,038 ms)이다. design-system 쪽 두 시험(가장 긴 719 ms)은 기존 describe의 3,540 ms 안이다. RED·GREEN은 PR 본문에 적는다. Refs: REV-FE-0002 --- .claude/skills/fe-design-system/SKILL.md | 2 +- scripts/check-design-system.ts | 16 +-- scripts/check-diagnostics.ts | 15 +-- scripts/check-i18n.ts | 14 ++- scripts/lib/fixture-rejection.ts | 43 ++++++++ .../forbidden/headless-vendor-import.tsx | 3 + .../design-system/forbidden/hue-mix.tsx | 2 + .../design-system/forbidden/raw-palette.tsx | 8 +- .../design-system/forbidden/tooltip-only.tsx | 1 - .../diagnostics/forbidden/direct-console.ts | 2 +- tests/unit/design-system-rules.test.ts | 51 +++++++++ tests/unit/fixture-rejection.test.ts | 102 ++++++++++++++++++ 12 files changed, 235 insertions(+), 24 deletions(-) create mode 100644 scripts/lib/fixture-rejection.ts create mode 100644 tests/fixtures/design-system/forbidden/headless-vendor-import.tsx create mode 100644 tests/fixtures/design-system/forbidden/hue-mix.tsx delete mode 100644 tests/fixtures/design-system/forbidden/tooltip-only.tsx create mode 100644 tests/unit/fixture-rejection.test.ts diff --git a/.claude/skills/fe-design-system/SKILL.md b/.claude/skills/fe-design-system/SKILL.md index d6c84dfe..6bf45d98 100644 --- a/.claude/skills/fe-design-system/SKILL.md +++ b/.claude/skills/fe-design-system/SKILL.md @@ -31,7 +31,7 @@ paths: ## 함정 1. `check:design-system`이 통과했으니 토큰만 썼다고 본다. TS·TSX에서는 `#hex`·`oklch(`·`rgb(`와 `style={{ … }}`의 손 색·간격만 찾는다. 문자열로 조립한 class, Tailwind 임의 값(`text-[…]`), `hsl()`·색 이름을 담은 다른 문자열은 안 본다. CSS는 `src` 아래 전부를 보고 UI-06이 간격·글자·반경·층·그림자의 날 값을 거절하지만, 너비·높이·위치·opacity는 보지 않는다. 리뷰가 잡는다. — `scripts/check-design-system.ts`, `docs/design/2026-07-26-design-system-platform-design.md` 4.1절 「토큰 CSS 검사 규칙」 -2. tooltip에만 필요한 정보를 둔다. 검사기의 tooltip 규칙은 음성 fixture에서만 돌고 실제 소스는 보지 않는다. — `scripts/check-design-system.ts`, `docs/design/2026-07-26-design-system-platform-design.md` 6.1절 10번 +2. tooltip에만 필요한 정보를 둔다. 이 꼴을 거절하는 검사기 규칙은 없으니 리뷰에서 본다(음성 fixture의 표식만 보던 규칙은 REV-FE-0002에서 지웠다). — `docs/design/2026-07-26-design-system-platform-design.md` 6.1절 10번 3. 포커스 대비 토큰을 `color-mix()`·알파·키워드로 만든다. 3:1 계산은 불투명한 `oklch()`로 끝나는 토큰만 하고 나머지는 실패한다. `color-mix()`는 색상각 공간(oklch·lch·hsl·hwb)에서 섞지 않는다. 기본은 `in oklab`이고, 반투명 색을 브라우저가 겹쳐 그린 결과를 재현할 때만 `in srgb`를 쓴다(`component.css`의 가림막). — `docs/styling/design-tokens.md` UI-01·UI-02 4. 다크 테마 재정의를 빠뜨리거나 light 전용 패널·글자색을 박는다. 핵심 역할 토큰은 `:root[data-theme="dark"]`에 모두 있어야 하고, `component.css`에 forced-colors 대체가 있어야 한다. — `docs/styling/design-tokens.md`, `scripts/check-design-system.ts` 5. 디자인 시스템 하위 파일, `lucide-react`, headless 라이브러리를 직접 import한다. `src/presentation/design-system/index.ts`와 vendor facade로만 들어간다. — `docs/architecture/layers.md` 규칙 `design-system-is-reached-through-its-index`·`icon-vendor-is-facade-only`, `docs/design/2026-07-26-design-system-platform-design.md` 6.1절 diff --git a/scripts/check-design-system.ts b/scripts/check-design-system.ts index 07001af5..de7c68a7 100644 --- a/scripts/check-design-system.ts +++ b/scripts/check-design-system.ts @@ -1,6 +1,7 @@ import { mkdir, readFile, readdir } from "node:fs/promises"; import { designSystemReportArtifactSchema } from "./contracts/release-artifacts.ts"; +import { fixtureRejectionFailure } from "./lib/fixture-rejection.ts"; import { writeValidatedJsonArtifact } from "./lib/validated-json-artifact.ts"; import path from "node:path"; @@ -187,12 +188,6 @@ for (const file of sources) { failures.push(`raw palette value in ${file}`); } failures.push(...hueMixFailures({ file, source }), ...inlineStyleFailures({ file, source })); - if ( - file.includes("tests/fixtures/design-system/forbidden") && - source.includes("TOOLTIP_ONLY_REQUIRED_INFORMATION") - ) { - failures.push(`tooltip-only required information in ${file}`); - } } const report = designSystemReportArtifactSchema.parse({ @@ -214,6 +209,15 @@ await writeValidatedJsonArtifact({ value: report, }); +// Every fixture file must be rejected by a rule of its own (REV-FE-0002). +const unrejectedFixtures = fixtureMode + ? fixtureRejectionFailure("Design system", sources, failures) + : undefined; +if (unrejectedFixtures) { + process.stderr.write(unrejectedFixtures); + process.exit(2); +} + if (failures.length > 0) { process.stderr.write(`Design system contract failed:\n${failures.join("\n")}\n`); process.exit(1); diff --git a/scripts/check-diagnostics.ts b/scripts/check-diagnostics.ts index 384972b2..bf315627 100644 --- a/scripts/check-diagnostics.ts +++ b/scripts/check-diagnostics.ts @@ -1,6 +1,7 @@ import { mkdir, readFile, readdir } from "node:fs/promises"; import { diagnosticsReportArtifactSchema } from "./contracts/release-artifacts.ts"; +import { fixtureRejectionFailure } from "./lib/fixture-rejection.ts"; import { writeValidatedJsonArtifact } from "./lib/validated-json-artifact.ts"; import path from "node:path"; @@ -106,12 +107,6 @@ for (const file of sources) { if (calls.some((call) => sensitiveContext.test(call))) { failures.push(`sensitive diagnostic or telemetry context in ${file}`); } - if ( - file.includes("tests/fixtures/diagnostics/forbidden") && - source.includes("UNKNOWN_DIAGNOSTIC_EVENT") - ) { - failures.push(`unknown diagnostic event in ${file}`); - } } const report = diagnosticsReportArtifactSchema.parse({ @@ -131,6 +126,14 @@ await writeValidatedJsonArtifact({ schema: diagnosticsReportArtifactSchema, value: report, }); +// Every fixture file must be rejected by a rule of its own (REV-FE-0002). +const unrejectedFixtures = fixtureMode + ? fixtureRejectionFailure("Diagnostics", sources, failures) + : undefined; +if (unrejectedFixtures) { + process.stderr.write(unrejectedFixtures); + process.exit(2); +} if (failures.length > 0) { process.stderr.write( `Diagnostics contract failed:\n${failures.join("\n")}\n`, diff --git a/scripts/check-i18n.ts b/scripts/check-i18n.ts index ab236d6b..71af2219 100644 --- a/scripts/check-i18n.ts +++ b/scripts/check-i18n.ts @@ -1,6 +1,7 @@ import { mkdir, readFile, readdir } from "node:fs/promises"; import { i18nReportArtifactSchema } from "./contracts/release-artifacts.ts"; +import { fixtureRejectionFailure } from "./lib/fixture-rejection.ts"; import { writeValidatedJsonArtifact } from "./lib/validated-json-artifact.ts"; import path from "node:path"; @@ -153,14 +154,11 @@ await writeValidatedJsonArtifact({ // Every fixture file must be rejected on its own; one rejected file must not // hide a directory the discovery above stopped reaching. -const fixtureFiles = fixtureMode ? await listSourceFiles(sourceRoot) : []; -const unrejectedFixtures = fixtureFiles.filter( - (file) => !failures.some((failure) => failure.endsWith(file)), -); -if (fixtureMode && (fixtureFiles.length === 0 || unrejectedFixtures.length > 0)) { - process.stderr.write( - `I18n fixture was not rejected:\n${unrejectedFixtures.join("\n") || "(no fixture files found)"}\n`, - ); +const unrejectedFixtures = fixtureMode + ? fixtureRejectionFailure("I18n", await listSourceFiles(sourceRoot), failures) + : undefined; +if (unrejectedFixtures) { + process.stderr.write(unrejectedFixtures); process.exit(2); } // A comment, punctuation or catalog words must not be rejected (0929/08-02). diff --git a/scripts/lib/fixture-rejection.ts b/scripts/lib/fixture-rejection.ts new file mode 100644 index 00000000..a00e0ad2 --- /dev/null +++ b/scripts/lib/fixture-rejection.ts @@ -0,0 +1,43 @@ +// A `*:fixture` command passes when its checker exits 1 and prints its header +// (scripts/lib/ci-step-result.ts). One rejected file is enough for that, so a +// rule deleted from the checker hides behind the files that other rules still +// reject. A checker in fixture mode therefore asks that every fixture file is +// named by a failure of its own, and exits 2 when one is not: exit 2 is not +// the exit 1 the gate expects, so FE-GATE-029 fails (REV-FE-0002). + +/** + * Whether `failure` names `file` as a whole path: at the start or after + * white space, and followed by the end, white space or `:` (a line number). + * `a.ts` is not named by a failure about `a.tsx` or `b/a.ts`. + */ +export function failureNamesFile(failure: string, file: string): boolean { + for (let at = failure.indexOf(file); at !== -1; at = failure.indexOf(file, at + 1)) { + const before = at === 0 ? "" : failure[at - 1]; + const after = failure[at + file.length] ?? ""; + if ((before === "" || /\s/.test(before)) && (after === "" || /[\s:]/.test(after))) return true; + } + return false; +} + +/** The fixture files that no failure names. */ +export function unrejectedFixtureFiles( + fixtureFiles: readonly string[], + failures: readonly string[], +): string[] { + return fixtureFiles.filter((file) => !failures.some((failure) => failureNamesFile(failure, file))); +} + +/** + * The text a checker prints before it exits 2, or `undefined` when every + * fixture file is rejected. No fixture file at all is refused too: an empty or + * moved fixture folder must not pass as "every file rejected". + */ +export function fixtureRejectionFailure( + checker: string, + fixtureFiles: readonly string[], + failures: readonly string[], +): string | undefined { + const unrejected = unrejectedFixtureFiles(fixtureFiles, failures); + if (fixtureFiles.length > 0 && unrejected.length === 0) return undefined; + return `${checker} fixture was not rejected:\n${unrejected.join("\n") || "(no fixture files found)"}\n`; +} diff --git a/tests/fixtures/design-system/forbidden/headless-vendor-import.tsx b/tests/fixtures/design-system/forbidden/headless-vendor-import.tsx new file mode 100644 index 00000000..2bfcc36f --- /dev/null +++ b/tests/fixtures/design-system/forbidden/headless-vendor-import.tsx @@ -0,0 +1,3 @@ +// VD-05. A screen reaches the headless vendor instead of the design-system +// primitive that wraps it. +export { Button } from "react-aria-components"; diff --git a/tests/fixtures/design-system/forbidden/hue-mix.tsx b/tests/fixtures/design-system/forbidden/hue-mix.tsx new file mode 100644 index 00000000..d83170da --- /dev/null +++ b/tests/fixtures/design-system/forbidden/hue-mix.tsx @@ -0,0 +1,2 @@ +// UI-02. A chart setting mixes colours in a hue space. +export const CHART_FILL = "color-mix(in hsl, var(--color-action), var(--color-surface))"; diff --git a/tests/fixtures/design-system/forbidden/raw-palette.tsx b/tests/fixtures/design-system/forbidden/raw-palette.tsx index deba96ba..094da1df 100644 --- a/tests/fixtures/design-system/forbidden/raw-palette.tsx +++ b/tests/fixtures/design-system/forbidden/raw-palette.tsx @@ -1,3 +1,9 @@ +// A raw colour outside a style attribute: only the raw palette rule sees it, +// so each fixture here is rejected by one rule (REV-FE-0002). export function RawPalette() { - return
raw palette
; + return ( + + ); } diff --git a/tests/fixtures/design-system/forbidden/tooltip-only.tsx b/tests/fixtures/design-system/forbidden/tooltip-only.tsx deleted file mode 100644 index fb95fdc2..00000000 --- a/tests/fixtures/design-system/forbidden/tooltip-only.tsx +++ /dev/null @@ -1 +0,0 @@ -export const TOOLTIP_ONLY_REQUIRED_INFORMATION = "Required approval details"; diff --git a/tests/fixtures/diagnostics/forbidden/direct-console.ts b/tests/fixtures/diagnostics/forbidden/direct-console.ts index 7215b0c6..deaf508a 100644 --- a/tests/fixtures/diagnostics/forbidden/direct-console.ts +++ b/tests/fixtures/diagnostics/forbidden/direct-console.ts @@ -1,3 +1,3 @@ export function leakToConsole(token: string) { - console.error("UNKNOWN_DIAGNOSTIC_EVENT", token); + console.error("request failed", token); } diff --git a/tests/unit/design-system-rules.test.ts b/tests/unit/design-system-rules.test.ts index 9a3eb459..fd2a2a4a 100644 --- a/tests/unit/design-system-rules.test.ts +++ b/tests/unit/design-system-rules.test.ts @@ -425,4 +425,55 @@ describe("design system rules", { timeout: childProcessTimeout(3_540) }, () => { await rm(root, { recursive: true, force: true }); } }); + + // REV-FE-0002. check:design-system:fixture passes on exit 1 and the header, + // which one rejected file gives. Each forbidden fixture is rejected by the + // one rule it is for, and a file no rule rejects makes the script exit 2, + // so a rule dropped from the TSX loop fails here and in FE-GATE-029. + describe("check-design-system.ts --fixture", () => { + const fixtures = "tests/fixtures/design-system/forbidden"; + const runFixtureMode = async (extra?: { file: string; source: string }) => { + const root = await mkdtemp(path.join(tmpdir(), "design-system-fixture-")); + try { + for (const folder of ["src/presentation/design-system/tokens", "src/presentation/styles", fixtures]) { + await cp(folder, path.join(root, folder), { recursive: true }); + } + if (extra) await writeFile(path.join(root, fixtures, extra.file), extra.source); + const result = spawnSync(process.execPath, [path.resolve("scripts/check-design-system.ts"), "--fixture"], { + cwd: root, + encoding: "utf8", + }); + const { failures } = JSON.parse( + await readFile(path.join(root, "artifacts/quality/design-system-fixture.json"), "utf8"), + ) as { failures: string[] }; + return { status: result.status, stderr: result.stderr, failures }; + } finally { + await rm(root, { recursive: true, force: true }); + } + }; + + it("rejects every forbidden fixture by its own rule", async () => { + const { status, stderr, failures } = await runFixtureMode(); + expect(status, stderr).toBe(1); + expect(stderr).toContain("Design system contract failed:"); + expect([...failures].sort()).toEqual( + [ + `${fixtures}/hue-mix.tsx mixes colours in hsl; use oklab`, + `${fixtures}/raw-inline-style.tsx style color: "red" is written by hand; read a token or use a primitive variant`, + `${fixtures}/raw-inline-style.tsx style padding: 13 is written by hand; read a token or use a primitive variant`, + `direct headless vendor import in ${fixtures}/headless-vendor-import.tsx`, + `raw palette value in ${fixtures}/raw-palette.tsx`, + ].sort(), + ); + }); + + it("exits 2 when a fixture file is not rejected", async () => { + const { status, stderr } = await runFixtureMode({ + file: "probe.tsx", + source: 'export function Probe() {\n return

reads tokens

;\n}\n', + }); + expect(status, stderr).toBe(2); + expect(stderr).toBe(`Design system fixture was not rejected:\n${fixtures}/probe.tsx\n`); + }); + }); }); diff --git a/tests/unit/fixture-rejection.test.ts b/tests/unit/fixture-rejection.test.ts new file mode 100644 index 00000000..61bab863 --- /dev/null +++ b/tests/unit/fixture-rejection.test.ts @@ -0,0 +1,102 @@ +import { spawnSync } from "node:child_process"; +import { cp, mkdtemp, readFile, rm, writeFile } from "node:fs/promises"; +import { tmpdir } from "node:os"; +import path from "node:path"; + +import { describe, expect, it } from "vitest"; + +import { + failureNamesFile, + fixtureRejectionFailure, + unrejectedFixtureFiles, +} from "../../scripts/lib/fixture-rejection.ts"; +import { childProcessTimeout } from "../helpers/child-process-timeout.ts"; + +// REV-FE-0002. A `*:fixture` command passes on exit 1 and the header, which +// one rejected file gives; check-i18n, check-design-system and +// check-diagnostics ask that every fixture file is rejected on its own. +describe("negative fixture rejection", { timeout: childProcessTimeout(1_038) }, () => { + describe("failureNamesFile", () => { + it.each([ + ["raw palette value in tests/a.tsx", true], + ["tests/a.tsx mixes colours in hsl; use oklab", true], + ["tests/a.tsx:2 z-index: 50 writes 50 by hand", true], + ["eslint 1:1 message in tests/a.tsx", true], + ["raw palette value in tests/a.tsx.bak", false], + ["raw palette value in other/tests/a.tsx", false], + ["raw palette value in tests/a.tsxx", false], + ["direct console diagnostics bypass", false], + ])("%s names tests/a.tsx: %s", (failure, named) => { + expect(failureNamesFile(failure, "tests/a.tsx")).toBe(named); + }); + + it("does not take a file for the longer path it starts", () => { + expect(failureNamesFile("raw palette value in tests/a.tsx", "tests/a.ts")).toBe(false); + }); + + it("finds the file after an earlier partial match", () => { + expect(failureNamesFile("tests/a.tsx.bak and tests/a.tsx", "tests/a.tsx")).toBe(true); + }); + }); + + it("lists the fixture files no failure names", () => { + expect( + unrejectedFixtureFiles(["tests/a.ts", "tests/b.ts", "tests/c.ts"], ["rule one in tests/a.ts", "tests/c.ts:1 rule two"]), + ).toEqual(["tests/b.ts"]); + }); + + it("passes only when every fixture file is rejected", () => { + expect(fixtureRejectionFailure("Probe", ["tests/a.ts"], ["rule in tests/a.ts"])).toBeUndefined(); + expect(fixtureRejectionFailure("Probe", ["tests/a.ts", "tests/b.ts"], ["rule in tests/a.ts"])).toBe( + "Probe fixture was not rejected:\ntests/b.ts\n", + ); + }); + + it("refuses a fixture folder with no files", () => { + expect(fixtureRejectionFailure("Probe", [], ["rule in tests/a.ts"])).toBe( + "Probe fixture was not rejected:\n(no fixture files found)\n", + ); + }); + + // A rule dropped from check-diagnostics.ts leaves its fixture unrejected: + // the script exits 2 and FE-GATE-029, which expects exit 1, fails. + describe("check-diagnostics.ts --fixture", () => { + const fixtures = "tests/fixtures/diagnostics/forbidden"; + const runFixtureMode = async (extra?: { file: string; source: string }) => { + const root = await mkdtemp(path.join(tmpdir(), "diagnostics-fixture-")); + try { + await cp(fixtures, path.join(root, fixtures), { recursive: true }); + if (extra) await writeFile(path.join(root, fixtures, extra.file), extra.source); + const result = spawnSync(process.execPath, [path.resolve("scripts/check-diagnostics.ts"), "--fixture"], { + cwd: root, + encoding: "utf8", + }); + const { failures } = JSON.parse( + await readFile(path.join(root, "artifacts/quality/diagnostics-fixture.json"), "utf8"), + ) as { failures: string[] }; + return { status: result.status, stderr: result.stderr, failures }; + } finally { + await rm(root, { recursive: true, force: true }); + } + }; + + it("rejects every forbidden fixture by its own rule", async () => { + const { status, stderr, failures } = await runFixtureMode(); + expect(status, stderr).toBe(1); + expect(stderr).toContain("Diagnostics contract failed:"); + expect([...failures].sort()).toEqual([ + `direct console diagnostics bypass in ${fixtures}/direct-console.ts`, + `sensitive diagnostic or telemetry context in ${fixtures}/raw-context.ts`, + ]); + }); + + it("exits 2 when a fixture file is not rejected", async () => { + const { status, stderr } = await runFixtureMode({ + file: "probe.ts", + source: "export function probe(): number {\n return 1;\n}\n", + }); + expect(status, stderr).toBe(2); + expect(stderr).toBe(`Diagnostics fixture was not rejected:\n${fixtures}/probe.ts\n`); + }); + }); +}); -- 2.54.0 From 9e51efc80d1095e96c459bffe8ad42466cb6d7c8 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Sat, 21 Nov 2026 08:56:32 +0900 Subject: [PATCH 2/2] =?UTF-8?q?docs(changelog):=20design-system=C2=B7diagn?= =?UTF-8?q?ostics=20=EC=9D=8C=EC=84=B1=20fixture=EB=A5=BC=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=EB=A7=88=EB=8B=A4=20=EA=B1=B0=EC=A0=88=ED=95=98?= =?UTF-8?q?=EB=8A=94=20=EA=B2=83=EC=9D=84=20=EC=A0=81=EB=8A=94=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 어느 규칙에도 걸리지 않는 fixture 파일이 있으면 이제 FE-GATE-029가 실패하므로 먼저 할 일에 옮기는 법과 확인 명령을 적고, 보안·계약 변경 표에 52e7d2c7 행을 더한다. Refs: REV-FE-0002 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bde9a480..5adc786c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ Gitea runner에서 merge 단계를 초록으로 만들고, worker를 늘리지 - 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`). - FE-GATE-029가 `playwright test`의 `--grep-invert P` 실행마다 같은 testDir을 `--grep P`로 도는 게이트 실행을 요구한다. 자기 `test:e2e`·`test:a11y`의 패턴을 바꿨으면 두 글자를 같게 둔다. 게이트 명령에 파일 필터나 `grep`이 든 설정으로만 도는 testDir이 있으면 필터 없는 실행을 더한다. 짝이 없으면 main push의 FE-GATE-029가 그 testDir과 빠진 짝을 대며 실패한다(`scripts/verify.sh gate FE-GATE-029`). - `check:test-evidence`(FE-GATE-008, fixture는 029)가 skip·fixme를 구문 트리로 찾는다. `testInfo.skip()`·`test.info().skip()`·import 별칭(`strictTest.skip()`)과 `.mts`·`.cts`·`.js`·`.mjs`·`.cjs`·`.jsx` 시험 파일도 본다. 이런 호출이 quarantine 주석 없이 있으면 실패한다. 옮긴 뒤 확인: `scripts/verify.sh script check:test-evidence:source`. +- `check:design-system:fixture`·`check:diagnostics:fixture`(FE-GATE-029)가 fixture 파일마다 거절을 요구한다. `tests/fixtures/design-system/forbidden/`·`tests/fixtures/diagnostics/forbidden/`에 어느 규칙에도 걸리지 않는 파일이 있으면 그 파일을 찍고 exit 2로 끝나 029가 실패한다. 표식 문자열(`TOOLTIP_ONLY_REQUIRED_INFORMATION`, `UNKNOWN_DIAGNOSTIC_EVENT`)만 보던 규칙이 없어지니, 자기 fixture가 그 표식에만 기대면 진짜 규칙 하나에 걸리게 고치거나 지운다. `check:i18n:fixture`의 파일 이름 판정도 끝 일치에서 경로 경계 일치로 바뀐다. 자기 규칙의 failure 문구는 경로 앞에 공백을, 뒤에 공백·`:`·끝을 두어야 그 파일을 거절한 것으로 센다(`"${file}"`·`(${file})` 꼴은 안 센다). 그 폴더에 자기 fixture를 더했으면 `tests/unit/design-system-rules.test.ts`·`tests/unit/fixture-rejection.test.ts`가 단언하는 failure 목록에도 더한다(FE-GATE-005). 옮긴 뒤 확인: `scripts/verify.sh gate FE-GATE-029 FE-GATE-005`. - 수동 접근성 기록(`docs/accessibility/route-reviews/`)에 WCAG 2.2 칸 둘이 생기고, `Release ID`를 릴리스 태그와 대조한다. - 옮기기 전: 자기 기록에 `M8`·`M9` 줄이 없으면 FE-GATE-009 형식 검사가 그 필드 이름을 대며 실패한다. release 단계를 태그 없이(브랜치에서 수동으로) 돌리면 FE-GATE-028이 `missing required environment: RELEASE_TAG`로 멈춘다. - 옮기는 법: 기록마다 `M8 Focus not obscured: pending`, `M9 Target size: pending` 두 줄을 더한다. 서명하는 기록의 `Release ID`는 다음 release부터 그 릴리스 태그(예 `v1.4.0`)로 적는다. release 단계는 태그 run에서 돈다. @@ -111,6 +112,7 @@ Gitea runner에서 merge 단계를 초록으로 만들고, worker를 늘리지 | [계약] | PR run은 바뀐 경로로 merge 게이트를 고른다. 경로표 `config/ci/pr-gate-selection.json`의 줄을 위에서부터 보고 처음 맞는 줄의 게이트를 늘 도는 001·002·003·010에 더한다. global 파일(`config/`, `scripts/`, `.gitea/`, 도구 설정, lockfile 등)이 하나라도 바뀌면 전부 돈다. 안 도는 게이트는 `건너뜀: — <이유>`를 찍고 성공으로 끝난다. main run과 수동 실행은 늘 전부 돈다. diff는 origin에서 인증 없이 base를 받아 잰다. 비공개 repo라 받지 못하면 이유를 찍고 전부 돈다. 경로표가 추적 파일을 모두 덮는지 시험이 본다(위 "먼저 할 일"). 시험 fixture는 PR job의 `CI_PR_BASE_REF`를 물려받지 않는다(소유자 결정 2026-11-13) | `config/ci/pr-gate-selection.json`, `scripts/lib/pr-gate-selection.ts`, `scripts/run-ci-gate.ts`, `scripts/contracts/ci-gates.ts`, `config/ci/gates.json`, `.gitea/workflows/quality-gates.yml`, `scripts/lib/fixture-node-modules.ts`, `tests/unit/pr-gate-selection.test.ts` | `9f8b2c1c`, `f0a8582c` | | [계약] | `check:ci:gating`(FE-GATE-029)이 경로마다 그 경로를 돌리는 runner를 본다. Vitest 경로 아래의 `*.spec.*` 파일은 어느 게이트도 돌리지 않으므로 게이트 밖으로 세어 실패한다. 자기 Vitest 시험 파일이 `.spec`이면 `.test`로 바꾼다 (0929/12-06) | `scripts/check-ci-gating.ts`, `scripts/lib/ungated-tests.ts` | `d838be54` | | [계약] | `check:test-evidence`의 skip·fixme 검사가 정규식에서 Babel 구문 트리로 바뀐다. 정규식은 `test.skip(` 꼴만 봐서 `testInfo.skip()`·`test.info().skip()`·import 별칭의 skip이 quarantine 없이 Playwright 시험을 뺐다. 파일은 Playwright `testMatch` 기본값의 확장자로 넓히고, 파싱이 안 되는 파일은 실패로 적는다. `test.fail()`은 그대로 허용한다 | `scripts/check-test-evidence.ts`, `tests/fixtures/test-evidence/forbidden/`, `tests/unit/test-evidence-source-rules.test.ts` | `6830ec5a` | +| [계약] | design-system·diagnostics 음성 fixture 판정이 「실패가 하나라도 있으면 통과」에서 「fixture 파일마다 자기 실패가 있어야 통과」로 바뀐다. 전에는 fixture 폴더에서만 도는 표식 규칙이 자기 파일을 늘 거절해, 검사기의 진짜 규칙(TSX의 raw palette·hue mix·inline style, direct console·민감 context)을 지워도 FE-GATE-029가 초록이었다. 세 검사기(`check-i18n.ts` 포함)가 같은 판정(`scripts/lib/fixture-rejection.ts`)을 쓰고, 거절되지 않은 파일이 있거나 fixture가 없으면 exit 2로 끝난다 | `scripts/check-design-system.ts`, `scripts/check-diagnostics.ts`, `scripts/check-i18n.ts`, `scripts/lib/fixture-rejection.ts`, `tests/fixtures/design-system/forbidden/`, `tests/fixtures/diagnostics/forbidden/` | `52e7d2c7` | | [계약] | `verify:documentation`(FE-GATE-017)이 `scripts/verify.sh`와 `python3` 명령 안의 경로·script 이름도 대조한다. 자기 문서의 `scripts/verify.sh script <이름>`·`python3 <경로>`가 낡았으면 실패하니 고친다 (1112/08-06) | `scripts/verify-documentation-readiness.ts` | `aebb7c8c` | | [계약] | release의 provider job 둘(vulnerability·provenance)에 FE-GATE-013과 같은 runner 요구(`hostRequirements`)를 적고, 계약이 둘이 같은지 본다. provider 감독 스크립트가 provider를 띄우기 전에 비특권 user namespace를 점검하고, 막혔으면 `test:system` 사전 점검과 같은 문구로 멈춘다 (1101/13-03) | `config/ci/gates.json`, `scripts/contracts/ci-gates.ts`, `scripts/generate-ci-workflow.ts`, `.gitea/workflows/quality-gates.yml`, `scripts/check-system-test-prerequisites.ts`, `scripts/run-and-validate-provider.ts` | `9ebd0856` | | [계약] | 브라우저 job 컨테이너가 `--shm-size=2g`로 뜨고, Firefox 시험 프로필을 RAM 파일시스템(`/dev/shm`)에 둔다. Firefox가 시험 context의 저장소를 디스크 프로필에 두어, 디스크가 붐비면 첫 화면 5초 대기를 넘겼다. 자리가 모자라면 디스크 프로필로 돌고 이유를 한 줄 찍는다 | `scripts/generate-ci-workflow.ts`, `.gitea/workflows/quality-gates.yml`, `tests/support/browser/browser-test.ts`, `docs/operations/ci-quality-gates.md` | `f81dda49`, `c239bdf4` | -- 2.54.0