From bca5fc279691267fcd45fff1dcbc0e477afdcc60 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Wed, 4 Nov 2026 20:22:13 +0900 Subject: [PATCH 01/22] =?UTF-8?q?fix(ci):=20coverage=20=EC=A6=9D=EA=B1=B0?= =?UTF-8?q?=20=EA=B2=80=EC=82=AC=EA=B0=80=20summary=EC=9D=98=20branchesTru?= =?UTF-8?q?e=EB=A5=BC=20=EB=B0=9B=EB=8A=94=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제 FE-GATE-005의 증거 검사(scripts/lib/ci-artifact-validator.ts)는 coverage-summary.json 항목마다 lines·statements·functions·branches만 허용하는 .strict() schema를 쓴다. istanbul-lib-coverage 3.2.2는 빈 summary에 branchesTrue를 항상 넣으므로 total에 그 키가 있다. 그래서 테스트가 모두 통과해도 증거 단계에서 게이트가 실패한다. 같은 파일을 읽는 risk-coverage 게이트는 이 키를 허용해 두 검사기가 갈라져 있었다. 고른 방법 - 키 목록을 scripts/lib/coverage-summary-metrics.ts 한 곳에 두고 두 검사기가 같이 쓴다. 평가하는 네 지표와, 보고기가 더할 수 있는 선택 지표(branchesTrue)를 나눴다. 선택 지표도 counter 형식(pct 정확성 포함)은 그대로 검사한다. - 버린 대안: validator schema에만 branchesTrue를 더하기. 지금 고장의 원인(두 목록)이 그대로 남는다. 상수를 risk-coverage.ts에서 export하기. validator가 @babel/eslint-parser까지 읽게 된다. 위험·한계 - 다른 미지의 키는 여전히 거절한다(의도). 보고기를 올리면 새 키가 생길 수 있다. - ci:gate FE-GATE-005 전체는 이 커밋에서 돌리지 않았다. 검증 - RED: 새 tests/unit/coverage-summary-artifact.test.ts 3건 중 2건 실패 (Unrecognized key: "branchesTrue"). - 수정 뒤 coverage-summary-artifact·risk-coverage·risk-coverage-files 44건 통과. check:types 통과, 바꾼 파일 eslint 통과. Refs: docs/reviews/2026-11-03-maturity-review/README.md 12-09 --- scripts/lib/ci-artifact-validator.ts | 17 +++-- scripts/lib/coverage-summary-metrics.ts | 24 +++++++ scripts/lib/risk-coverage.ts | 20 +++--- tests/unit/coverage-summary-artifact.test.ts | 66 ++++++++++++++++++++ 4 files changed, 112 insertions(+), 15 deletions(-) create mode 100644 scripts/lib/coverage-summary-metrics.ts create mode 100644 tests/unit/coverage-summary-artifact.test.ts diff --git a/scripts/lib/ci-artifact-validator.ts b/scripts/lib/ci-artifact-validator.ts index 2c309466..c39cd78e 100644 --- a/scripts/lib/ci-artifact-validator.ts +++ b/scripts/lib/ci-artifact-validator.ts @@ -9,6 +9,10 @@ import type { CiGateArtifactSchema, } from "../contracts/ci-gates.ts"; import { ciContractReportSchema } from "./ci-contract-report.ts"; +import { + COVERAGE_SUMMARY_METRICS, + COVERAGE_SUMMARY_OPTIONAL_METRICS, +} from "./coverage-summary-metrics.ts"; import { architectureDependencyReportArtifactSchema, automatedA11yArtifactSchema, @@ -76,16 +80,17 @@ const coverageCounterSchema = z context.addIssue({ code: "custom", path: ["pct"], message: "coverage pct is not exact" }); } }); +// 1103/12-09. The key list is shared with the risk coverage gate, which reads +// the same file; this schema used to refuse the `branchesTrue` the reporter +// always writes. const coverageSummarySchema = z .record( z.string(), z - .object({ - lines: coverageCounterSchema, - statements: coverageCounterSchema, - functions: coverageCounterSchema, - branches: coverageCounterSchema, - }) + .object(Object.fromEntries([ + ...COVERAGE_SUMMARY_METRICS.map((metric) => [metric, coverageCounterSchema]), + ...COVERAGE_SUMMARY_OPTIONAL_METRICS.map((metric) => [metric, coverageCounterSchema.optional()]), + ])) .strict(), ) .refine((value) => "total" in value, "coverage summary lacks total"); diff --git a/scripts/lib/coverage-summary-metrics.ts b/scripts/lib/coverage-summary-metrics.ts new file mode 100644 index 00000000..9579bb33 --- /dev/null +++ b/scripts/lib/coverage-summary-metrics.ts @@ -0,0 +1,24 @@ +/** + * The keys of one entry in Vitest's `coverage-summary.json`. Two readers check + * that file: the CI evidence validator (ci-artifact-validator.ts) and the risk + * coverage gate (risk-coverage.ts). They kept separate lists, and the + * validator refused `branchesTrue` while the gate accepted it, so FE-GATE-005 + * failed at its evidence step after every test had passed (1103/12-09). + */ + +/** The four metrics both readers evaluate. */ +export const COVERAGE_SUMMARY_METRICS = Object.freeze([ + "lines", + "statements", + "functions", + "branches", +] as const); + +/** + * Keys the reporter may add. istanbul-lib-coverage 3.2.2 puts `branchesTrue` + * in every blank summary, so the total always carries it. Each is still + * checked as a counter; neither reader evaluates it. + */ +export const COVERAGE_SUMMARY_OPTIONAL_METRICS = Object.freeze([ + "branchesTrue", +] as const); diff --git a/scripts/lib/risk-coverage.ts b/scripts/lib/risk-coverage.ts index 0d951f22..9a12908a 100644 --- a/scripts/lib/risk-coverage.ts +++ b/scripts/lib/risk-coverage.ts @@ -8,14 +8,12 @@ import { import path from "node:path"; import babelParser from "@babel/eslint-parser"; +import { + COVERAGE_SUMMARY_METRICS as coverageMetrics, + COVERAGE_SUMMARY_OPTIONAL_METRICS, +} from "./coverage-summary-metrics.ts"; import { normalizeRepositoryRelativePath } from "./repository-file-inventory.ts"; -const coverageMetrics = [ - "lines", - "statements", - "functions", - "branches", -] as const; const teamIdPattern = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u; const maximumWaiverDurationMs = 90 * 24 * 60 * 60 * 1_000; @@ -641,16 +639,20 @@ function parseCoverageCounter(value: unknown, label: string): CoverageCounter { function parseCoverageMetrics(value: unknown, label: string): CoverageMetrics { if (!isRecord(value)) throw new TypeError(`${label} must be an object`); + const optionalMetrics: readonly string[] = COVERAGE_SUMMARY_OPTIONAL_METRICS; const unknownMetrics = Object.keys(value).filter( - (metric) => metric !== "branchesTrue" && !coverageMetrics.includes(metric as CoverageMetric), + (metric) => + !optionalMetrics.includes(metric) && !coverageMetrics.includes(metric as CoverageMetric), ); if (unknownMetrics.length > 0) { throw new TypeError( `${label} has unknown coverage metric keys: ${unknownMetrics.sort().join(", ")}`, ); } - if (value.branchesTrue !== undefined) { - parseCoverageCounter(value.branchesTrue, `${label}.branchesTrue`); + for (const metric of optionalMetrics) { + if (value[metric] !== undefined) { + parseCoverageCounter(value[metric], `${label}.${metric}`); + } } const parsed = {} as Record; for (const metric of coverageMetrics) { diff --git a/tests/unit/coverage-summary-artifact.test.ts b/tests/unit/coverage-summary-artifact.test.ts new file mode 100644 index 00000000..960c3c5f --- /dev/null +++ b/tests/unit/coverage-summary-artifact.test.ts @@ -0,0 +1,66 @@ +import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises"; +import { tmpdir } from "node:os"; +import path from "node:path"; + +import { afterEach, describe, expect, it } from "vitest"; + +import { loadCiGateContract } from "../../scripts/contracts/ci-gates.ts"; +import { validateCiArtifact } from "../../scripts/lib/ci-artifact-validator.ts"; + +const SUMMARY_PATH = "artifacts/tests/coverage/coverage-summary.json"; +const roots: string[] = []; + +afterEach(async () => { + await Promise.all(roots.splice(0).map((root) => rm(root, { recursive: true, force: true }))); +}); + +const counter = (total: number, covered = total) => ({ + total, + covered, + skipped: 0, + pct: total === 0 ? 100 : Math.floor((covered / total) * 10_000) / 100, +}); +const metrics = { + lines: counter(4), + statements: counter(4), + functions: counter(1), + branches: counter(2), +}; + +async function validateSummary(summary: unknown): Promise { + const contract = await loadCiGateContract(process.cwd()); + const artifact = contract.artifacts.find((entry) => entry.path === SUMMARY_PATH); + const schema = contract.artifactSchemas.find((entry) => entry.id === artifact?.schemaId); + if (!artifact || !schema) throw new Error(`the CI contract no longer declares ${SUMMARY_PATH}`); + const root = await mkdtemp(path.join(tmpdir(), "coverage-summary-artifact-")); + roots.push(root); + await mkdir(path.join(root, path.dirname(SUMMARY_PATH)), { recursive: true }); + await writeFile(path.join(root, SUMMARY_PATH), `${JSON.stringify(summary)}\n`); + await validateCiArtifact({ root, artifact, schema }); +} + +// 1103/12-09. istanbul-lib-coverage 3.2.2 puts `branchesTrue` in every blank +// summary, so the json-summary total always carries it. The CI evidence check +// refused the key that the risk-coverage gate reading the same file accepts, +// and FE-GATE-005 failed after every test had passed. +describe("coverage summary evidence (1103/12-09)", () => { + it("accepts the summary the coverage reporter writes, with branchesTrue", async () => { + await expect(validateSummary({ + total: { ...metrics, branchesTrue: counter(0) }, + "src/a.ts": metrics, + })).resolves.toBeUndefined(); + }); + + it("accepts a summary without branchesTrue", async () => { + await expect(validateSummary({ total: metrics, "src/a.ts": metrics })) + .resolves.toBeUndefined(); + }); + + it("still validates branchesTrue as a counter and refuses other keys", async () => { + await expect(validateSummary({ + total: { ...metrics, branchesTrue: { ...counter(0), pct: 0 } }, + })).rejects.toThrow(/pct/u); + await expect(validateSummary({ total: { ...metrics, branchesFalse: counter(0) } })) + .rejects.toThrow(/branchesFalse/u); + }); +}); From b3ce732249c279d8452c657dd1fdc99bd59be5d1 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Wed, 4 Nov 2026 20:23:33 +0900 Subject: [PATCH 02/22] =?UTF-8?q?test(e2e):=20compact=20smoke=EA=B0=80=20?= =?UTF-8?q?=EB=B9=8C=EB=93=9C=EC=97=90=20=EC=A4=80=20VITE=5FBUILD=5FID?= =?UTF-8?q?=EB=A5=BC=20=EA=B8=B0=EB=8C=80=EA=B0=92=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EC=93=B4=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제 tests/e2e/compact-smoke.spec.ts가 html의 data-build-id를 "local-build"로 고정해 비교한다. workflow는 전체 env에 VITE_BUILD_ID=gitea--를 넣고, preview 서버가 그 env로 빌드한다. 그래서 실제 CI에서 FE-GATE-008이 코드와 무관하게 항상 실패한다. 고른 방법 - 기대값을 이 프로세스의 VITE_BUILD_ID에서 읽고, 비었으면 "local-build"를 쓴다. playwright webServer가 같은 env로 빌드하고, scripts/generate-runtime-config.ts가 같은 규칙(값 || "local-build")으로 BUILD_ID를 정한다. - 버린 대안: build id가 비어 있지 않은지만 보기. 빌드에 준 값이 화면까지 오는지(release manifest·runtime config 일치)를 더는 확인하지 못한다. vite loadEnv로 .env 파일까지 읽기. build id는 .env가 아니라 프로세스 env에서만 온다(generate-runtime-config.ts, generate-build-manifest.ts). 위험·한계 - CI=true와 러너 이미지 조건, ci:gate FE-GATE-008 전체는 돌리지 않았다. 검증 - RED: VITE_BUILD_ID=gitea-1-1로 chromium-compact 1건 실패 (data-build-id "local-build" 기대). - 수정 뒤 VITE_BUILD_ID=gitea-1-1, 기본값 두 경우 모두 1 passed. Refs: docs/reviews/2026-11-03-maturity-review/README.md 11-06 --- tests/e2e/compact-smoke.spec.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/e2e/compact-smoke.spec.ts b/tests/e2e/compact-smoke.spec.ts index 73269951..d084c229 100644 --- a/tests/e2e/compact-smoke.spec.ts +++ b/tests/e2e/compact-smoke.spec.ts @@ -1,5 +1,14 @@ import { expect, test } from "../support/browser/strict-browser-test.ts"; +/** + * 1103/11-06. The preview server serves a build made from this process's + * environment (playwright.config.ts webServer), and the build takes its + * identity from VITE_BUILD_ID the way scripts/generate-runtime-config.ts + * does: CI sets gitea--, a local run falls back to + * "local-build". A fixed "local-build" failed FE-GATE-008 in every CI run. + */ +const EXPECTED_BUILD_ID = process.env["VITE_BUILD_ID"] || "local-build"; + test("boots and navigates the compact production shell", async ({ page }) => { await page.goto("/"); await expect(page.getByRole("main")).toBeVisible(); @@ -15,7 +24,7 @@ test("boots and navigates the compact production shell", async ({ page }) => { .getByRole("link", { name: "UI 구성요소", exact: true }) .click(); await expect(page).toHaveURL(/\/examples\/ui$/); - await expect(page.locator("html")).toHaveAttribute("data-build-id", "local-build"); + await expect(page.locator("html")).toHaveAttribute("data-build-id", EXPECTED_BUILD_ID); const overflow = await page.evaluate( () => document.documentElement.scrollWidth - window.innerWidth, ); From 4e37b07ff9dadf2e72e171188e257d7a1611e58e Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Wed, 4 Nov 2026 20:24:02 +0900 Subject: [PATCH 03/22] =?UTF-8?q?fix(removal):=20CI=20=EC=8A=A4=ED=81=AC?= =?UTF-8?q?=EB=A6=BD=ED=8A=B8=EA=B0=80=20=EC=97=86=EB=8A=94=20=EA=B8=B0?= =?UTF-8?q?=EB=8A=A5=20=EC=A0=9C=EA=B1=B0=EB=8F=84=20CI=20=EA=B8=B0?= =?UTF-8?q?=EC=A4=80=EC=84=A0=20=EC=82=AC=EC=9C=A0=EB=A5=BC=20=EB=A7=8C?= =?UTF-8?q?=EB=93=A0=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제 test:sample-removal -- --feature=는 참조 기능이 아닌 기능에 ciScripts: []를 쓴다. pruneRemovalFixtureCiContract가 그 빈 집합으로 기준선 사유를 "removal fixture pruned "(끝 공백)로 만들고, 바로 뒤 기준선 검사가 "leading/trailing whitespace is forbidden"으로 거부한다. 그래서 create:feature로 만든 모든 기능의 제거 드릴이 3초 만에 무관한 오류로 끝나고 게이트 검사는 하나도 돌지 않는다. 고른 방법 - 지운 스크립트가 없으면 사유를 "removal fixture pruned no CI scripts"로 쓴다. - 이 길을 merge 게이트가 돌게 하는 것(test:feature-scaffold가 생성 기능에 --feature 드릴을 한 번 돌림)은 같은 발견의 둘째 절반이라 드릴 범위를 고치는 다음 커밋에서 한다. 위험·한계 - 이 커밋만으로는 제품 기능 제거 드릴 전체를 실행해 보지 않았다. 검증 - RED: 새 테스트 "re-baselines a removal that prunes no CI script" 실패 (reason 'removal fixture pruned '). - 수정 뒤 tests/unit/removal-fixture.test.ts 9건 통과. Refs: docs/reviews/2026-11-03-maturity-review/16-structure-patterns.md 16-02 --- scripts/lib/removal-fixture.ts | 8 +++++++- tests/unit/removal-fixture.test.ts | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/scripts/lib/removal-fixture.ts b/scripts/lib/removal-fixture.ts index fd39e717..ed3d2741 100644 --- a/scripts/lib/removal-fixture.ts +++ b/scripts/lib/removal-fixture.ts @@ -465,8 +465,14 @@ export async function pruneRemovalFixtureCiContract(options: Readonly<{ ]); // D-13: the reduced contract is a new baseline, recorded the way a project // that removes the capability records it; canonical check:ci then applies. + // 1103/16-02. A product feature owns no CI script; an empty list used to + // leave a trailing blank that the baseline schema refuses. await updateCiContractBaseline(options.root, { owner: "removal-fixture", - reason: `removal fixture pruned ${[...options.removedScripts].join(", ")}`, + reason: `removal fixture pruned ${ + options.removedScripts.size === 0 + ? "no CI scripts" + : [...options.removedScripts].join(", ") + }`, }); } diff --git a/tests/unit/removal-fixture.test.ts b/tests/unit/removal-fixture.test.ts index 001b11e0..b117687b 100644 --- a/tests/unit/removal-fixture.test.ts +++ b/tests/unit/removal-fixture.test.ts @@ -92,6 +92,25 @@ it("prunes removed command and evidence references and re-baselines the contract expect(packageDocument.scripts["check:ci"]).not.toMatch(/reduced/u); }); +// 1103/16-02. A product feature owns no CI script, so its removal prunes +// nothing. The baseline reason then ended in a blank ("removal fixture pruned +// ") and the baseline schema refused it before any gate ran. +it("re-baselines a removal that prunes no CI script", async () => { + const root = await copyCiContract("removal-fixture-no-scripts-"); + + await pruneRemovalFixtureCiContract({ + root, + removedScripts: new Set(), + removedEvidencePathFragments: [], + }); + + const baseline = JSON.parse( + await readFile(path.join(root, "config/ci/contract-baseline.json"), "utf8"), + ) as Record; + expect(baseline["reason"]).toBe("removal fixture pruned no CI scripts"); + await expect(loadCiGateContract(root)).resolves.toBeDefined(); +}); + it("rejects a contract that no longer matches its committed baseline", async () => { const root = await copyCiContract("removal-fixture-baseline-drift-"); const baselinePath = path.join(root, "config/ci/contract-baseline.json"); From 529615dc8ee33faba94261afc69f1283d12b4c1e Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Wed, 4 Nov 2026 20:24:58 +0900 Subject: [PATCH 04/22] =?UTF-8?q?chore(artifacts):=20=EC=8B=A4=ED=96=89=20?= =?UTF-8?q?=EB=A1=9C=EA=B7=B8=EB=A5=BC=20=EC=B6=94=EC=A0=81=ED=95=98?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=EB=8A=94=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제 scripts/scale/run-scale-profile.ts는 단계 출력을 artifacts/scale//.log에 쓴다. 이 로그와 verify:extreme-scale·phase5 로그 63개가 git에 추적되고, .gitignore는 artifacts의 json·xml·txt·sarif만 무시한다. 그래서 merge 게이트 check:scale:pr(FE-GATE-005)를 로컬에서 한 번 돌리면 추적 로그 3개가 바뀌고 새 로그 1개가 생겨 작업 트리가 더러워진다. 커밋된 판은 다른 기계의 경로와 ANSI 색 코드를 담고, 읽는 코드·테스트·설정은 없다. 고른 방법 - .gitignore에 artifacts/**/*.log를 넣고 63개 추적을 끊는다. scale 로그(12-08) 35개만이 아니라 같은 원인의 extreme-scale·phase5 로그도 같이 뺀다(0929/11-09 남은 항목). - 기준 측정은 이미 config/scale/benchmark-baseline.json 같은 정해진 JSON이 맡는다. 로그를 증거로 쓰는 곳은 없다(git grep). 위험·한계 - 동기화 때 다운스트림에서 이 파일들이 지워진다. 두 다운스트림은 이미 지웠다(지난 리뷰 기록). 검증 - check:scale:pr PASSED 뒤 git status에 로그 변경이 없다. Refs: docs/reviews/2026-11-03-maturity-review/12-guardrails-ci.md 12-08 Refs: docs/reviews/2026-11-03-maturity-review/11-tests-browser-release-scale.md 0929/11-09 --- .gitignore | 3 + artifacts/phase5/check-architecture.log | 5 -- artifacts/phase5/check-types-app.log | 1 - artifacts/phase5/check-types-test.log | 1 - artifacts/phase5/traffic-regression.log | 20 ------- .../quality/extreme-scale-gates/build.log | 37 ------------- .../check-app-build-input-bundle.log | 2 - .../check-app-build-input.log | 2 - .../check-architecture.log | 5 -- .../extreme-scale-gates/check-diagnostics.log | 2 - .../check-feature-index.log | 1 - .../check-observability.log | 23 -------- .../extreme-scale-gates/check-registries.log | 2 - .../check-release-coherence.log | 16 ------ .../check-request-fanout.log | 3 - .../check-scale-baseline.log | 4 -- .../extreme-scale-gates/check-scale-main.log | 10 ---- .../check-scale-nightly.log | 14 ----- .../extreme-scale-gates/check-scale-pr.log | 6 -- .../check-scale-release.log | 13 ----- .../extreme-scale-gates/check-topology.log | 19 ------- .../extreme-scale-gates/check-traffic.log | 21 ------- .../extreme-scale-gates/check-types-app.log | 1 - .../extreme-scale-gates/check-types-test.log | 1 - .../extreme-scale-gates/check-types.log | 7 --- .../quality/extreme-scale-gates/lint.log | 1 - .../test-extreme-scale-focused.log | 23 -------- .../extreme-scale-gates/test-platform.log | 55 ------------------- .../test-reference-feature.log | 30 ---------- .../scale/main/architecture-topology.log | 25 --------- artifacts/scale/main/baseline-regression.log | 3 - artifacts/scale/main/composition-s0-s1.log | 5 -- artifacts/scale/main/composition-s0-s2.log | 5 -- .../scale/main/composition-scale-suite.log | 11 ---- artifacts/scale/main/scale-units.log | 17 ------ artifacts/scale/main/traffic-budgets.log | 20 ------- .../scale/main/typescript-diagnostics.log | 5 -- .../scale/nightly/architecture-topology.log | 25 --------- .../scale/nightly/baseline-regression.log | 3 - artifacts/scale/nightly/browser-soak.log | 12 ---- artifacts/scale/nightly/composition-s0-s1.log | 5 -- artifacts/scale/nightly/composition-s0-s2.log | 5 -- .../scale/nightly/composition-scale-suite.log | 11 ---- artifacts/scale/nightly/scale-units.log | 17 ------ artifacts/scale/nightly/session-cycles.log | 12 ---- artifacts/scale/nightly/telemetry-storm.log | 19 ------- artifacts/scale/nightly/topology-s3-s4.log | 16 ------ artifacts/scale/nightly/traffic-budgets.log | 20 ------- .../scale/nightly/typescript-diagnostics.log | 5 -- artifacts/scale/pr/architecture-topology.log | 25 --------- artifacts/scale/pr/composition-s0-s1.log | 5 -- artifacts/scale/pr/scale-units.log | 17 ------ artifacts/scale/pr/traffic-budgets.log | 20 ------- .../scale/release/architecture-topology.log | 25 --------- .../scale/release/baseline-regression.log | 3 - artifacts/scale/release/composition-s0-s1.log | 5 -- artifacts/scale/release/composition-s0-s2.log | 5 -- .../scale/release/composition-scale-suite.log | 11 ---- artifacts/scale/release/release-coherence.log | 15 ----- artifacts/scale/release/scale-units.log | 17 ------ artifacts/scale/release/telemetry-storm.log | 12 ---- artifacts/scale/release/topology-s3-s4.log | 12 ---- artifacts/scale/release/traffic-budgets.log | 20 ------- .../scale/release/typescript-diagnostics.log | 5 -- 64 files changed, 3 insertions(+), 763 deletions(-) delete mode 100644 artifacts/phase5/check-architecture.log delete mode 100644 artifacts/phase5/check-types-app.log delete mode 100644 artifacts/phase5/check-types-test.log delete mode 100644 artifacts/phase5/traffic-regression.log delete mode 100644 artifacts/quality/extreme-scale-gates/build.log delete mode 100644 artifacts/quality/extreme-scale-gates/check-app-build-input-bundle.log delete mode 100644 artifacts/quality/extreme-scale-gates/check-app-build-input.log delete mode 100644 artifacts/quality/extreme-scale-gates/check-architecture.log delete mode 100644 artifacts/quality/extreme-scale-gates/check-diagnostics.log delete mode 100644 artifacts/quality/extreme-scale-gates/check-feature-index.log delete mode 100644 artifacts/quality/extreme-scale-gates/check-observability.log delete mode 100644 artifacts/quality/extreme-scale-gates/check-registries.log delete mode 100644 artifacts/quality/extreme-scale-gates/check-release-coherence.log delete mode 100644 artifacts/quality/extreme-scale-gates/check-request-fanout.log delete mode 100644 artifacts/quality/extreme-scale-gates/check-scale-baseline.log delete mode 100644 artifacts/quality/extreme-scale-gates/check-scale-main.log delete mode 100644 artifacts/quality/extreme-scale-gates/check-scale-nightly.log delete mode 100644 artifacts/quality/extreme-scale-gates/check-scale-pr.log delete mode 100644 artifacts/quality/extreme-scale-gates/check-scale-release.log delete mode 100644 artifacts/quality/extreme-scale-gates/check-topology.log delete mode 100644 artifacts/quality/extreme-scale-gates/check-traffic.log delete mode 100644 artifacts/quality/extreme-scale-gates/check-types-app.log delete mode 100644 artifacts/quality/extreme-scale-gates/check-types-test.log delete mode 100644 artifacts/quality/extreme-scale-gates/check-types.log delete mode 100644 artifacts/quality/extreme-scale-gates/lint.log delete mode 100644 artifacts/quality/extreme-scale-gates/test-extreme-scale-focused.log delete mode 100644 artifacts/quality/extreme-scale-gates/test-platform.log delete mode 100644 artifacts/quality/extreme-scale-gates/test-reference-feature.log delete mode 100644 artifacts/scale/main/architecture-topology.log delete mode 100644 artifacts/scale/main/baseline-regression.log delete mode 100644 artifacts/scale/main/composition-s0-s1.log delete mode 100644 artifacts/scale/main/composition-s0-s2.log delete mode 100644 artifacts/scale/main/composition-scale-suite.log delete mode 100644 artifacts/scale/main/scale-units.log delete mode 100644 artifacts/scale/main/traffic-budgets.log delete mode 100644 artifacts/scale/main/typescript-diagnostics.log delete mode 100644 artifacts/scale/nightly/architecture-topology.log delete mode 100644 artifacts/scale/nightly/baseline-regression.log delete mode 100644 artifacts/scale/nightly/browser-soak.log delete mode 100644 artifacts/scale/nightly/composition-s0-s1.log delete mode 100644 artifacts/scale/nightly/composition-s0-s2.log delete mode 100644 artifacts/scale/nightly/composition-scale-suite.log delete mode 100644 artifacts/scale/nightly/scale-units.log delete mode 100644 artifacts/scale/nightly/session-cycles.log delete mode 100644 artifacts/scale/nightly/telemetry-storm.log delete mode 100644 artifacts/scale/nightly/topology-s3-s4.log delete mode 100644 artifacts/scale/nightly/traffic-budgets.log delete mode 100644 artifacts/scale/nightly/typescript-diagnostics.log delete mode 100644 artifacts/scale/pr/architecture-topology.log delete mode 100644 artifacts/scale/pr/composition-s0-s1.log delete mode 100644 artifacts/scale/pr/scale-units.log delete mode 100644 artifacts/scale/pr/traffic-budgets.log delete mode 100644 artifacts/scale/release/architecture-topology.log delete mode 100644 artifacts/scale/release/baseline-regression.log delete mode 100644 artifacts/scale/release/composition-s0-s1.log delete mode 100644 artifacts/scale/release/composition-s0-s2.log delete mode 100644 artifacts/scale/release/composition-scale-suite.log delete mode 100644 artifacts/scale/release/release-coherence.log delete mode 100644 artifacts/scale/release/scale-units.log delete mode 100644 artifacts/scale/release/telemetry-storm.log delete mode 100644 artifacts/scale/release/topology-s3-s4.log delete mode 100644 artifacts/scale/release/traffic-budgets.log delete mode 100644 artifacts/scale/release/typescript-diagnostics.log diff --git a/.gitignore b/.gitignore index b19dcdf9..5a42d78c 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,9 @@ artifacts/**/*.json artifacts/**/*.xml artifacts/**/*.txt artifacts/**/*.sarif +# 1103/12-08. Step logs from check:scale:* and verify:extreme-scale. They were +# committed once, and every local merge-gate run rewrote them. +artifacts/**/*.log artifacts/tests/e2e/ artifacts/tests/browser-capabilities/ artifacts/storybook/ diff --git a/artifacts/phase5/check-architecture.log b/artifacts/phase5/check-architecture.log deleted file mode 100644 index 70a3edf3..00000000 --- a/artifacts/phase5/check-architecture.log +++ /dev/null @@ -1,5 +0,0 @@ -$ node scripts/check-architecture.ts -Static import graph: 330 modules, 984 dependencies, all imports resolved -Architecture graph fixtures: 16 regression checks PASS -TypeScript-only source policy: PASS (src, scripts, tests, .storybook, recipes; no fixture exceptions) -Architecture fixtures: allowed PASS, 9 forbidden rejected diff --git a/artifacts/phase5/check-types-app.log b/artifacts/phase5/check-types-app.log deleted file mode 100644 index 388c04b1..00000000 --- a/artifacts/phase5/check-types-app.log +++ /dev/null @@ -1 +0,0 @@ -$ tsc --project tsconfig.app.json diff --git a/artifacts/phase5/check-types-test.log b/artifacts/phase5/check-types-test.log deleted file mode 100644 index 08d11af4..00000000 --- a/artifacts/phase5/check-types-test.log +++ /dev/null @@ -1 +0,0 @@ -$ tsc --project tsconfig.test.json diff --git a/artifacts/phase5/traffic-regression.log b/artifacts/phase5/traffic-regression.log deleted file mode 100644 index fe4cb21b..00000000 --- a/artifacts/phase5/traffic-regression.log +++ /dev/null @@ -1,20 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/unit/http-retry-lifecycle.test.ts (4 tests) 4ms - ✓ tests/unit/realtime/bounded-polling-policy.test.ts (3 tests) 6ms - ✓ tests/unit/realtime/realtime-reconnect-policy.test.ts (7 tests) 6ms - ✓ tests/unit/retry-policy.test.ts (4 tests) 5ms - ✓ tests/unit/realtime/bounded-poll-coordinator.test.ts (16 tests) 25ms - ✓ tests/unit/realtime/live-poll-handoff-coordinator.test.ts (13 tests) 71ms - ✓ tests/unit/resumable-upload-runtime.test.ts (18 tests) 87ms - ✓ tests/unit/realtime/realtime-reconnect-coordinator.test.ts (25 tests) 32ms - ✓ tests/unit/tanstack-cache-coordinator.test.ts (8 tests) 168ms - ✓ tests/unit/resumable-upload-runtime-teardown.test.ts (4 tests) 163ms - ✓ tests/unit/realtime/stream-coordinator.test.ts (36 tests) 625ms - - Test Files  11 passed (11) - Tests  138 passed (138) - Start at  08:27:14 - Duration  1.40s (transform 1.56s, setup 3.50s, import 2.09s, tests 1.19s, environment 2ms) - diff --git a/artifacts/quality/extreme-scale-gates/build.log b/artifacts/quality/extreme-scale-gates/build.log deleted file mode 100644 index 98603526..00000000 --- a/artifacts/quality/extreme-scale-gates/build.log +++ /dev/null @@ -1,37 +0,0 @@ -contract set: 0 package(s) sha256:ad6aab71fea6a9ff87cbd170b984b339965afc90d85bb57f87801c9e0c020da2 -vite v8.1.5 building client environment for production... - transforming...✓ 2113 modules transformed. -rendering chunks... -computing gzip size... -dist/index.html 1.12 kB │ gzip: 0.45 kB -dist/.vite/manifest.json 8.11 kB │ gzip: 1.04 kB -dist/.vite/module-inventory.json 21.94 kB │ gzip: 3.15 kB -dist/assets/index-C0p5zoj4.css 39.62 kB │ gzip: 8.51 kB -dist/assets/installed-contract-contributions-CFHdeDEf.js 0.16 kB │ gzip: 0.15 kB -dist/assets/not-found-page-CHQA5rw5.js 0.45 kB │ gzip: 0.30 kB -dist/assets/reference-resource-status-page-t3RWROLD.js 0.51 kB │ gzip: 0.45 kB -dist/assets/use-reference-failure-action-BYb2UYeT.js 0.57 kB │ gzip: 0.37 kB -dist/assets/session-provider-CIR3Mmin.js 0.60 kB │ gzip: 0.39 kB -dist/assets/application-provider-_OkSTAcq.js 0.61 kB │ gzip: 0.34 kB -dist/assets/reference-resource-page-1-Q0DGen.js 1.21 kB │ gzip: 0.77 kB -dist/assets/reference-resource-detail-page-D5mbWw2a.js 1.23 kB │ gzip: 0.72 kB -dist/assets/async-state-CfvFHl3I.js 1.53 kB │ gzip: 0.49 kB -dist/assets/auth-example-page-htVwyPYW.js 1.78 kB │ gzip: 0.94 kB -dist/assets/context-routes-CEM0c3Wb.js 1.80 kB │ gzip: 0.70 kB -dist/assets/server-state-DQADfngu.js 2.24 kB │ gzip: 0.90 kB -dist/assets/home-page-a_jMrdst.js 2.37 kB │ gzip: 1.27 kB -dist/assets/state-gallery-page-CunviFji.js 2.70 kB │ gzip: 1.22 kB -dist/assets/reference-resource-form-page-BHq_gRJf.js 2.77 kB │ gzip: 1.50 kB -dist/assets/installed-feature-contracts-DgTAlLr2.js 4.52 kB │ gzip: 1.43 kB -dist/assets/ui-gallery-page-Ru0CrH32.js 8.09 kB │ gzip: 2.90 kB -dist/assets/platform-overview-page-BgxC-c_W.js 11.90 kB │ gzip: 4.08 kB -dist/assets/route-input-DpW3PpRj.js 19.72 kB │ gzip: 6.27 kB -dist/assets/use-reference-feature-DkrwJNPz.js 23.75 kB │ gzip: 8.06 kB -dist/assets/preload-helper-ChbRSsLi.js 101.06 kB │ gzip: 27.93 kB -dist/assets/design-system-Bd1NzELd.js 213.52 kB │ gzip: 65.78 kB -dist/assets/index-zhAbJ8ef.js 294.86 kB │ gzip: 91.72 kB - -✓ built in 361ms -runtime config: local profile written to dist/config.json (APP_ENV=local, AUTH_MODE=demo) -service worker mode null: skipping worker build -$ node scripts/build-frontend.ts diff --git a/artifacts/quality/extreme-scale-gates/check-app-build-input-bundle.log b/artifacts/quality/extreme-scale-gates/check-app-build-input-bundle.log deleted file mode 100644 index d6bc0c9a..00000000 --- a/artifacts/quality/extreme-scale-gates/check-app-build-input-bundle.log +++ /dev/null @@ -1,2 +0,0 @@ -app build input: app=template-app contexts=1 features=1 generatedImports=1 bundle=1 feature dirs PASS -$ node scripts/check-app-build-input.ts --require-bundle diff --git a/artifacts/quality/extreme-scale-gates/check-app-build-input.log b/artifacts/quality/extreme-scale-gates/check-app-build-input.log deleted file mode 100644 index 24ccd47a..00000000 --- a/artifacts/quality/extreme-scale-gates/check-app-build-input.log +++ /dev/null @@ -1,2 +0,0 @@ -app build input: app=template-app contexts=1 features=1 generatedImports=1 bundle=not checked PASS -$ node scripts/check-app-build-input.ts diff --git a/artifacts/quality/extreme-scale-gates/check-architecture.log b/artifacts/quality/extreme-scale-gates/check-architecture.log deleted file mode 100644 index 565ed845..00000000 --- a/artifacts/quality/extreme-scale-gates/check-architecture.log +++ /dev/null @@ -1,5 +0,0 @@ -Static import graph: 363 modules, 1043 dependencies, all imports resolved -Architecture graph fixtures: 16 regression checks PASS -TypeScript-only source policy: PASS (src, scripts, tests, .storybook, recipes; no fixture exceptions) -Architecture fixtures: allowed PASS, 9 forbidden rejected -$ node scripts/check-architecture.ts diff --git a/artifacts/quality/extreme-scale-gates/check-diagnostics.log b/artifacts/quality/extreme-scale-gates/check-diagnostics.log deleted file mode 100644 index bfc6c2b0..00000000 --- a/artifacts/quality/extreme-scale-gates/check-diagnostics.log +++ /dev/null @@ -1,2 +0,0 @@ -Diagnostics contract: 8 diagnostics and 5 telemetry producers PASS -$ node scripts/check-diagnostics.ts diff --git a/artifacts/quality/extreme-scale-gates/check-feature-index.log b/artifacts/quality/extreme-scale-gates/check-feature-index.log deleted file mode 100644 index 27dc0c3a..00000000 --- a/artifacts/quality/extreme-scale-gates/check-feature-index.log +++ /dev/null @@ -1 +0,0 @@ -$ node scripts/generate-product-feature-index.ts --check diff --git a/artifacts/quality/extreme-scale-gates/check-observability.log b/artifacts/quality/extreme-scale-gates/check-observability.log deleted file mode 100644 index 02d9e4c9..00000000 --- a/artifacts/quality/extreme-scale-gates/check-observability.log +++ /dev/null @@ -1,23 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/platform/telemetry/telemetry-port.test.ts (3 tests) 8ms - ✓ tests/platform/telemetry/redact-telemetry.test.ts (14 tests) 17ms - ✓ tests/platform/telemetry/telemetry-buffer.test.ts (8 tests) 22ms - ✓ tests/platform/validation/validation-budget.test.ts (7 tests) 10ms - ✓ tests/platform/telemetry/telemetry-deduplicator.test.ts (8 tests) 13ms - ✓ tests/architecture/observability-boundaries.test.ts (4 tests) 142ms - ✓ tests/platform/errors/platform-errors.test.ts (16 tests) 23ms - ✓ tests/platform/telemetry/trace-context.test.ts (6 tests) 63ms - ✓ tests/platform/validation/bounded-json.test.ts (10 tests) 107ms - ✓ tests/platform/errors/app-error.test.ts (10 tests) 7ms - ✓ tests/platform/errors/failure-boundary.test.tsx (4 tests) 55ms - ✓ tests/platform/telemetry/telemetry-pipeline.test.ts (9 tests) 785ms - ✓ bounds network sends during a repeated error storm  718ms - - Test Files  12 passed (12) - Tests  99 passed (99) - Start at  13:29:27 - Duration  1.58s (transform 1.38s, setup 3.81s, import 1.84s, tests 1.25s, environment 902ms) - -$ node scripts/run-vitest.ts run tests/platform/errors tests/platform/validation tests/platform/telemetry tests/architecture/observability-boundaries.test.ts --reporter=default diff --git a/artifacts/quality/extreme-scale-gates/check-registries.log b/artifacts/quality/extreme-scale-gates/check-registries.log deleted file mode 100644 index 1abd421a..00000000 --- a/artifacts/quality/extreme-scale-gates/check-registries.log +++ /dev/null @@ -1,2 +0,0 @@ -Registry governance: 11 registries PASS; compatibility=breaking -$ node scripts/check-registries.ts diff --git a/artifacts/quality/extreme-scale-gates/check-release-coherence.log b/artifacts/quality/extreme-scale-gates/check-release-coherence.log deleted file mode 100644 index e981f0df..00000000 --- a/artifacts/quality/extreme-scale-gates/check-release-coherence.log +++ /dev/null @@ -1,16 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/platform/release/release-coherence.test.ts (10 tests) 9ms - ✓ tests/platform/release/release-mismatch-recovery.test.ts (10 tests) 14ms - ✓ tests/release/old-asset-reachability.test.ts (4 tests) 8ms - ✓ tests/platform/release/cache-policy.test.ts (5 tests) 39ms - ✓ tests/release/release-matrix.test.ts (7 tests) 48ms - ✓ tests/release/mixed-replica.test.ts (7 tests) 69ms - - Test Files  6 passed (6) - Tests  43 passed (43) - Start at  13:29:30 - Duration  914ms (transform 1.31s, setup 1.45s, import 2.18s, tests 187ms, environment 1ms) - -$ node scripts/run-vitest.ts run tests/platform/release tests/release --reporter=default diff --git a/artifacts/quality/extreme-scale-gates/check-request-fanout.log b/artifacts/quality/extreme-scale-gates/check-request-fanout.log deleted file mode 100644 index 03e090d1..00000000 --- a/artifacts/quality/extreme-scale-gates/check-request-fanout.log +++ /dev/null @@ -1,3 +0,0 @@ -request fan-out: 77 files scanned, 0 per-row dispatches PASS -request fan-out fixtures: forbidden 3 rejected in 3 files, allowed 0 violations PASS -$ node scripts/check-request-fanout.ts && node scripts/check-request-fanout.ts --fixture diff --git a/artifacts/quality/extreme-scale-gates/check-scale-baseline.log b/artifacts/quality/extreme-scale-gates/check-scale-baseline.log deleted file mode 100644 index b624defd..00000000 --- a/artifacts/quality/extreme-scale-gates/check-scale-baseline.log +++ /dev/null @@ -1,4 +0,0 @@ -compatibility: structural=true compiler=true timing=true -axes: absolute 28 (ok), growth 8 (ok), relative 16 compiler + 12 timing -scale baseline gate: PASSED (artifacts/scale/baseline-comparison.json) -$ node scripts/scale/check-scale-baseline.ts diff --git a/artifacts/quality/extreme-scale-gates/check-scale-main.log b/artifacts/quality/extreme-scale-gates/check-scale-main.log deleted file mode 100644 index c9cf9ea5..00000000 --- a/artifacts/quality/extreme-scale-gates/check-scale-main.log +++ /dev/null @@ -1,10 +0,0 @@ -PASSED main:architecture-topology (3173ms) -PASSED main:traffic-budgets (1489ms) -PASSED main:scale-units (2433ms) -PASSED main:composition-s0-s1 (91ms) -PASSED main:composition-s0-s2 (232ms) -PASSED main:composition-scale-suite (941ms) -PASSED main:typescript-diagnostics (1543ms) -PASSED main:baseline-regression (1739ms) -scale tier main: PASSED (artifacts/scale/main/summary.json) -$ node scripts/scale/run-scale-profile.ts main diff --git a/artifacts/quality/extreme-scale-gates/check-scale-nightly.log b/artifacts/quality/extreme-scale-gates/check-scale-nightly.log deleted file mode 100644 index 32a2a312..00000000 --- a/artifacts/quality/extreme-scale-gates/check-scale-nightly.log +++ /dev/null @@ -1,14 +0,0 @@ -PASSED nightly:architecture-topology (3175ms) -PASSED nightly:traffic-budgets (1393ms) -PASSED nightly:scale-units (2435ms) -PASSED nightly:composition-s0-s1 (90ms) -PASSED nightly:composition-s0-s2 (226ms) -PASSED nightly:composition-scale-suite (861ms) -PASSED nightly:typescript-diagnostics (1552ms) -PASSED nightly:baseline-regression (1750ms) -PASSED nightly:topology-s3-s4 (6995ms) -PASSED nightly:telemetry-storm (3703ms) -PASSED nightly:session-cycles (1703ms) -PASSED nightly:browser-soak (121407ms) -scale tier nightly: PASSED (artifacts/scale/nightly/summary.json) -$ node scripts/scale/run-scale-profile.ts nightly diff --git a/artifacts/quality/extreme-scale-gates/check-scale-pr.log b/artifacts/quality/extreme-scale-gates/check-scale-pr.log deleted file mode 100644 index e629a086..00000000 --- a/artifacts/quality/extreme-scale-gates/check-scale-pr.log +++ /dev/null @@ -1,6 +0,0 @@ -PASSED pr:architecture-topology (4307ms) -PASSED pr:traffic-budgets (1446ms) -PASSED pr:scale-units (2377ms) -PASSED pr:composition-s0-s1 (87ms) -scale tier pr: PASSED (artifacts/scale/pr/summary.json) -$ node scripts/scale/run-scale-profile.ts pr diff --git a/artifacts/quality/extreme-scale-gates/check-scale-release.log b/artifacts/quality/extreme-scale-gates/check-scale-release.log deleted file mode 100644 index d145f26f..00000000 --- a/artifacts/quality/extreme-scale-gates/check-scale-release.log +++ /dev/null @@ -1,13 +0,0 @@ -PASSED release:release-coherence (1123ms) -PASSED release:architecture-topology (3142ms) -PASSED release:traffic-budgets (1432ms) -PASSED release:scale-units (2318ms) -PASSED release:composition-s0-s1 (95ms) -PASSED release:composition-s0-s2 (235ms) -PASSED release:composition-scale-suite (843ms) -PASSED release:typescript-diagnostics (1499ms) -PASSED release:baseline-regression (1820ms) -PASSED release:topology-s3-s4 (7137ms) -PASSED release:telemetry-storm (3364ms) -scale tier release: PASSED (artifacts/scale/release/summary.json) -$ node scripts/scale/run-scale-profile.ts release diff --git a/artifacts/quality/extreme-scale-gates/check-topology.log b/artifacts/quality/extreme-scale-gates/check-topology.log deleted file mode 100644 index f971e428..00000000 --- a/artifacts/quality/extreme-scale-gates/check-topology.log +++ /dev/null @@ -1,19 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/platform/cardinality/cardinality-budget.test.ts (3 tests) 7ms - ✓ tests/platform/cardinality/compose-unique-record.test.ts (2 tests) 9ms - ✓ tests/architecture/context-lazy-loading.test.ts (1 test) 6ms - ✓ tests/platform/routing/context-route-module.test.ts (3 tests) 9ms - ✓ tests/architecture/topology-cardinality.test.ts (9 tests) 13ms - ✓ tests/platform/cardinality/extreme-scale-registry.test.ts (3 tests) 2363ms - ✓ keeps 10k -> 100k composition growth below a quadratic regression budget  391ms - ✓ keeps one million lookups bounded on a 100k-entry runtime registry  1515ms - ✓ selects and resolves 100k feature ids within the membership budget  455ms - - Test Files  6 passed (6) - Tests  21 passed (21) - Start at  13:29:21 - Duration  2.94s (transform 231ms, setup 1.63s, import 305ms, tests 2.41s, environment 1ms) - -$ node scripts/run-vitest.ts run tests/architecture/topology-cardinality.test.ts tests/architecture/context-lazy-loading.test.ts tests/platform/cardinality tests/platform/routing --reporter=default diff --git a/artifacts/quality/extreme-scale-gates/check-traffic.log b/artifacts/quality/extreme-scale-gates/check-traffic.log deleted file mode 100644 index dbc62acb..00000000 --- a/artifacts/quality/extreme-scale-gates/check-traffic.log +++ /dev/null @@ -1,21 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/platform/traffic/request-budget.test.ts (7 tests) 17ms - ✓ tests/platform/resilience/retry-budget.test.ts (6 tests) 7ms - ✓ tests/platform/resilience/deadline.test.ts (3 tests) 6ms - ✓ tests/platform/traffic/concurrency-budget.test.ts (6 tests) 11ms - ✓ tests/platform/execution/execution-context.test.ts (10 tests) 11ms - ✓ tests/platform/traffic/traffic-budget.test.ts (9 tests) 11ms - ✓ tests/platform/traffic/operation-traffic-policy.test.ts (7 tests) 10ms - ✓ tests/platform/traffic/request-fanout.test.ts (6 tests) 49ms - ✓ tests/platform/traffic/request-deduplication.test.ts (3 tests) 47ms - ✓ tests/platform/traffic/http-budget-integration.test.ts (9 tests) 130ms - ✓ tests/platform/traffic/traffic-amplification.test.ts (3 tests) 391ms - - Test Files  11 passed (11) - Tests  69 passed (69) - Start at  13:29:25 - Duration  1.34s (transform 858ms, setup 4.17s, import 1.44s, tests 690ms, environment 2ms) - -$ node scripts/run-vitest.ts run tests/platform/execution tests/platform/traffic tests/platform/resilience --reporter=default diff --git a/artifacts/quality/extreme-scale-gates/check-types-app.log b/artifacts/quality/extreme-scale-gates/check-types-app.log deleted file mode 100644 index 388c04b1..00000000 --- a/artifacts/quality/extreme-scale-gates/check-types-app.log +++ /dev/null @@ -1 +0,0 @@ -$ tsc --project tsconfig.app.json diff --git a/artifacts/quality/extreme-scale-gates/check-types-test.log b/artifacts/quality/extreme-scale-gates/check-types-test.log deleted file mode 100644 index 08d11af4..00000000 --- a/artifacts/quality/extreme-scale-gates/check-types-test.log +++ /dev/null @@ -1 +0,0 @@ -$ tsc --project tsconfig.test.json diff --git a/artifacts/quality/extreme-scale-gates/check-types.log b/artifacts/quality/extreme-scale-gates/check-types.log deleted file mode 100644 index 9a7a2716..00000000 --- a/artifacts/quality/extreme-scale-gates/check-types.log +++ /dev/null @@ -1,7 +0,0 @@ -$ corepack pnpm check:types:app && corepack pnpm check:types:node && corepack pnpm check:types:test && corepack pnpm check:types:recipes && corepack pnpm check:types:web-worker && corepack pnpm check:types:service-worker -$ tsc --project tsconfig.app.json -$ tsc --project tsconfig.node.json -$ tsc --project tsconfig.test.json -$ node scripts/check-optional-recipe-types.ts -$ tsc --project tsconfig.web-worker.json -$ tsc --project tsconfig.service-worker.json diff --git a/artifacts/quality/extreme-scale-gates/lint.log b/artifacts/quality/extreme-scale-gates/lint.log deleted file mode 100644 index 90a5c4cf..00000000 --- a/artifacts/quality/extreme-scale-gates/lint.log +++ /dev/null @@ -1 +0,0 @@ -$ eslint src scripts tests recipes .storybook vite.config.ts vitest.config.ts playwright*.config.ts --max-warnings=0 diff --git a/artifacts/quality/extreme-scale-gates/test-extreme-scale-focused.log b/artifacts/quality/extreme-scale-gates/test-extreme-scale-focused.log deleted file mode 100644 index 45372352..00000000 --- a/artifacts/quality/extreme-scale-gates/test-extreme-scale-focused.log +++ /dev/null @@ -1,23 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/scripts/generate-product-feature-index.test.ts (8 tests) 41ms - ✓ tests/platform/traffic/request-deduplication.test.ts (3 tests) 54ms - ✓ tests/platform/traffic/request-fanout.test.ts (6 tests) 56ms - ✓ tests/architecture/request-fanout.test.ts (4 tests) 194ms - ✓ tests/features/reference-feature/reference-request-deduplication.test.ts (3 tests) 50ms - ✓ tests/features/reference-feature/reference-request-fanout.test.ts (8 tests) 68ms - ✓ tests/architecture/app-build-input.test.ts (4 tests) 2380ms - ✓ accepts the production generator's output and an app-local bundle  771ms - ✓ rejects a generator regression that imports every discovered feature  673ms - ✓ rejects a production bundle that contains another app's feature  643ms - ✓ tests/scale/global-local-independence.test.ts (7 tests) 7755ms - ✓ keeps App A's generated indexes and reachable source graph identical from S0 to S2 on disk  5260ms - ✓ selects another app from the same repository without App A's features  982ms - - Test Files  8 passed (8) - Tests  43 passed (43) - Start at  13:29:12 - Duration  8.30s (transform 919ms, setup 1.94s, import 1.61s, tests 10.60s, environment 1ms) - -$ node scripts/run-vitest.ts run tests/scale/global-local-independence.test.ts tests/architecture/app-build-input.test.ts tests/architecture/request-fanout.test.ts tests/platform/traffic/request-fanout.test.ts tests/platform/traffic/request-deduplication.test.ts tests/features/reference-feature/reference-request-fanout.test.ts tests/features/reference-feature/reference-request-deduplication.test.ts tests/scripts/generate-product-feature-index.test.ts --reporter=default diff --git a/artifacts/quality/extreme-scale-gates/test-platform.log b/artifacts/quality/extreme-scale-gates/test-platform.log deleted file mode 100644 index d634a635..00000000 --- a/artifacts/quality/extreme-scale-gates/test-platform.log +++ /dev/null @@ -1,55 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/architecture/app-build-input.test.ts (4 tests) 9429ms - ✓ accepts the production generator's output and an app-local bundle  1340ms - ✓ rejects a generator regression that imports every discovered feature  5122ms - ✓ rejects a production bundle that contains another app's feature  2464ms - ✓ tests/platform/cardinality/extreme-scale-registry.test.ts (3 tests) 3975ms - ✓ keeps 10k -> 100k composition growth below a quadratic regression budget  634ms - ✓ keeps one million lookups bounded on a 100k-entry runtime registry  2331ms - ✓ selects and resolves 100k feature ids within the membership budget  1007ms - ✓ tests/platform/telemetry/telemetry-pipeline.test.ts (9 tests) 1077ms - ✓ bounds network sends during a repeated error storm  961ms - ✓ tests/platform/traffic/traffic-amplification.test.ts (3 tests) 558ms - ✓ keeps physical requests bounded when every dispatch fails  307ms - ✓ tests/architecture/request-fanout.test.ts (4 tests) 344ms - ✓ finds no per-row dispatch in feature code or application use cases  330ms - ✓ tests/architecture/observability-boundaries.test.ts (4 tests) 235ms - ✓ tests/platform/traffic/http-budget-integration.test.ts (9 tests) 133ms - ✓ tests/platform/validation/bounded-json.test.ts (10 tests) 140ms - ✓ tests/platform/telemetry/trace-context.test.ts (6 tests) 82ms - ✓ tests/platform/errors/failure-boundary.test.tsx (4 tests) 87ms - ✓ tests/platform/traffic/request-fanout.test.ts (6 tests) 75ms - ✓ tests/platform/traffic/request-deduplication.test.ts (3 tests) 74ms - ✓ tests/platform/release/cache-policy.test.ts (5 tests) 40ms - ✓ tests/platform/errors/platform-errors.test.ts (16 tests) 19ms - ✓ tests/platform/telemetry/telemetry-buffer.test.ts (8 tests) 20ms - ✓ tests/platform/telemetry/redact-telemetry.test.ts (14 tests) 14ms - ✓ tests/platform/traffic/request-budget.test.ts (7 tests) 7ms - ✓ tests/platform/release/release-mismatch-recovery.test.ts (10 tests) 12ms - ✓ tests/architecture/topology-cardinality.test.ts (9 tests) 10ms - ✓ tests/platform/telemetry/telemetry-deduplicator.test.ts (8 tests) 9ms - ✓ tests/platform/traffic/concurrency-budget.test.ts (6 tests) 11ms - ✓ tests/platform/execution/execution-context.test.ts (10 tests) 12ms - ✓ tests/platform/traffic/traffic-budget.test.ts (9 tests) 8ms - ✓ tests/platform/validation/validation-budget.test.ts (7 tests) 11ms - ✓ tests/platform/traffic/operation-traffic-policy.test.ts (7 tests) 11ms - ✓ tests/platform/routing/context-route-module.test.ts (3 tests) 10ms - ✓ tests/platform/release/release-coherence.test.ts (10 tests) 13ms - ✓ tests/platform/cardinality/compose-unique-record.test.ts (2 tests) 5ms - ✓ tests/platform/telemetry/telemetry-port.test.ts (3 tests) 6ms - ✓ tests/platform/resilience/retry-budget.test.ts (6 tests) 5ms - ✓ tests/platform/errors/app-error.test.ts (10 tests) 6ms - ✓ tests/platform/cardinality/cardinality-budget.test.ts (3 tests) 7ms - ✓ tests/architecture/context-lazy-loading.test.ts (1 test) 6ms - ✓ tests/platform/resilience/deadline.test.ts (3 tests) 7ms - ✓ tests/architecture/module-hierarchy.test.ts (1 test) 6ms - - Test Files  35 passed (35) - Tests  223 passed (223) - Start at  13:29:32 - Duration  33.44s (transform 977ms, setup 7.36s, import 2.52s, tests 16.46s, environment 1.01s) - -JUNIT report written to /shared/codebase/clean-architecture-frontend-template/artifacts/tests/platform.xml -$ node scripts/run-vitest.ts run tests/platform tests/architecture --no-file-parallelism --reporter=default --reporter=junit --outputFile.junit=artifacts/tests/platform.xml diff --git a/artifacts/quality/extreme-scale-gates/test-reference-feature.log b/artifacts/quality/extreme-scale-gates/test-reference-feature.log deleted file mode 100644 index 84e4fd89..00000000 --- a/artifacts/quality/extreme-scale-gates/test-reference-feature.log +++ /dev/null @@ -1,30 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/features/reference-feature/reference-error.test.ts (3 tests) 102ms - ✓ tests/features/reference-feature/reference-telemetry.test.ts (4 tests) 55ms - ✓ tests/features/reference-feature/reference-http-problem-mapping.test.ts (6 tests) 12ms - ✓ tests/features/reference-feature/reference-request-deduplication.test.ts (3 tests) 112ms - ✓ tests/features/reference-feature/reference-request-fanout.test.ts (8 tests) 189ms - ✓ tests/features/reference-feature/reference-traffic-policy.test.ts (1 test) 9ms - ✓ tests/features/reference-feature/installed-context-routing.test.ts (2 tests) 108ms - ✓ tests/features/reference-feature/reference-contract.test.ts (7 tests) 35ms - ✓ tests/features/reference-feature/feature-module.test.ts (1 test) 6ms - ✓ tests/features/reference-feature/reference-http-gateway.test.ts (2 tests) 8ms - ✓ tests/features/reference-feature/reference-installed-executor.test.ts (1 test) 7ms - ✓ tests/features/reference-feature/reference-diagnostics.test.ts (1 test) 81ms - ✓ tests/features/reference-feature/reference-runtime-composition.test.ts (3 tests) 201ms - ✓ tests/features/reference-feature/reference-production-vertical.test.tsx (1 test) 1243ms - ✓ traverses bootstrap, router, application, HTTP schema/mapper and query cache  1237ms - ✓ tests/features/reference-feature/reference-page.test.tsx (11 tests) 3248ms - ✓ mounts list and detail keys under the installed governed namespace  1035ms - ✓ renders backend forbidden even when the client access hint allowed entry  423ms - ✓ deduplicates create, preserves input and surfaces a conflict  584ms - - Test Files  15 passed (15) - Tests  54 passed (54) - Start at  13:30:06 - Duration  7.80s (transform 13.26s, setup 7.90s, import 20.03s, tests 5.42s, environment 2.84s) - -JUNIT report written to /shared/codebase/clean-architecture-frontend-template/artifacts/tests/reference-feature.xml -$ node scripts/run-vitest.ts run tests/features/reference-feature --reporter=default --reporter=junit --outputFile.junit=artifacts/tests/reference-feature.xml --passWithNoTests diff --git a/artifacts/scale/main/architecture-topology.log b/artifacts/scale/main/architecture-topology.log deleted file mode 100644 index 26511617..00000000 --- a/artifacts/scale/main/architecture-topology.log +++ /dev/null @@ -1,25 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/platform/cardinality/cardinality-budget.test.ts (3 tests) 6ms - ✓ tests/platform/cardinality/compose-unique-record.test.ts (2 tests) 7ms - ✓ tests/architecture/module-hierarchy.test.ts (1 test) 5ms - ✓ tests/architecture/context-lazy-loading.test.ts (1 test) 6ms - ✓ tests/platform/routing/context-route-module.test.ts (3 tests) 10ms - ✓ tests/architecture/topology-cardinality.test.ts (9 tests) 11ms - ✓ tests/architecture/observability-boundaries.test.ts (4 tests) 97ms - ✓ tests/architecture/request-fanout.test.ts (4 tests) 206ms - ✓ tests/platform/cardinality/extreme-scale-registry.test.ts (3 tests) 2005ms - ✓ keeps 10k -> 100k composition growth below a quadratic regression budget  407ms - ✓ keeps one million lookups bounded on a 100k-entry runtime registry  1229ms - ✓ selects and resolves 100k feature ids within the membership budget  366ms - ✓ tests/architecture/app-build-input.test.ts (4 tests) 2215ms - ✓ accepts the production generator's output and an app-local bundle  714ms - ✓ rejects a generator regression that imports every discovered feature  626ms - ✓ rejects a production bundle that contains another app's feature  613ms - - Test Files  10 passed (10) - Tests  34 passed (34) - Start at  13:30:24 - Duration  2.82s (transform 645ms, setup 2.94s, import 949ms, tests 4.57s, environment 2ms) - diff --git a/artifacts/scale/main/baseline-regression.log b/artifacts/scale/main/baseline-regression.log deleted file mode 100644 index 041945a2..00000000 --- a/artifacts/scale/main/baseline-regression.log +++ /dev/null @@ -1,3 +0,0 @@ -compatibility: structural=true compiler=true timing=true -axes: absolute 28 (ok), growth 8 (ok), relative 16 compiler + 12 timing -scale baseline gate: PASSED (artifacts/scale/main/baseline-regression.json) diff --git a/artifacts/scale/main/composition-s0-s1.log b/artifacts/scale/main/composition-s0-s1.log deleted file mode 100644 index 8b47e2ad..00000000 --- a/artifacts/scale/main/composition-s0-s1.log +++ /dev/null @@ -1,5 +0,0 @@ -PASS registry-composition:growth (exponents 0.00) -PASS product-feature-selection:growth (exponents 0.00) -PASS product-feature-resolution:growth (exponents 0.00) -PASS context-hierarchy-composition:growth (exponents 0.00) -composition scale artifact: /shared/codebase/clean-architecture-frontend-template/artifacts/scale/main/composition-s0-s1.json diff --git a/artifacts/scale/main/composition-s0-s2.log b/artifacts/scale/main/composition-s0-s2.log deleted file mode 100644 index 5a79c68b..00000000 --- a/artifacts/scale/main/composition-s0-s2.log +++ /dev/null @@ -1,5 +0,0 @@ -PASS registry-composition:growth (exponents 0.00, 0.64) -PASS product-feature-selection:growth (exponents 0.00, 0.83) -PASS product-feature-resolution:growth (exponents 0.00, 0.83) -PASS context-hierarchy-composition:growth (exponents 0.00, 0.34) -composition scale artifact: /shared/codebase/clean-architecture-frontend-template/artifacts/scale/main/composition-s0-s2.json diff --git a/artifacts/scale/main/composition-scale-suite.log b/artifacts/scale/main/composition-scale-suite.log deleted file mode 100644 index 9ce1a4eb..00000000 --- a/artifacts/scale/main/composition-scale-suite.log +++ /dev/null @@ -1,11 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/scale/tsc-diagnostics-parser.test.ts (3 tests) 7ms - ✓ tests/scale/composition-scale.test.ts (6 tests) 232ms - - Test Files  2 passed (2) - Tests  9 passed (9) - Start at  13:30:31 - Duration  596ms (transform 94ms, setup 326ms, import 114ms, tests 239ms, environment 0ms) - diff --git a/artifacts/scale/main/scale-units.log b/artifacts/scale/main/scale-units.log deleted file mode 100644 index 52c54bf4..00000000 --- a/artifacts/scale/main/scale-units.log +++ /dev/null @@ -1,17 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/scale/growth-regression.test.ts (7 tests) 6ms - ✓ tests/scale/traffic/retry-after-jitter.test.ts (5 tests) 38ms - ✓ tests/scale/traffic/amplification-metrics.test.ts (6 tests) 5ms - ✓ tests/scale/benchmark.test.ts (4 tests) 8ms - ✓ tests/scale/synthetic-topology.test.ts (8 tests) 8ms - ✓ tests/scale/scale-baseline.test.ts (11 tests) 11ms - ✓ tests/scale/traffic/failure-scenarios.test.ts (5 tests) 1420ms - ✓ bounds physical requests when all upstream calls fail  896ms - - Test Files  7 passed (7) - Tests  46 passed (46) - Start at  13:30:29 - Duration  2.04s (transform 695ms, setup 1.76s, import 808ms, tests 1.50s, environment 1ms) - diff --git a/artifacts/scale/main/traffic-budgets.log b/artifacts/scale/main/traffic-budgets.log deleted file mode 100644 index b49a8ea7..00000000 --- a/artifacts/scale/main/traffic-budgets.log +++ /dev/null @@ -1,20 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/platform/resilience/deadline.test.ts (3 tests) 4ms - ✓ tests/platform/traffic/request-budget.test.ts (7 tests) 5ms - ✓ tests/platform/resilience/retry-budget.test.ts (6 tests) 7ms - ✓ tests/platform/traffic/concurrency-budget.test.ts (6 tests) 11ms - ✓ tests/platform/traffic/traffic-budget.test.ts (9 tests) 10ms - ✓ tests/platform/execution/execution-context.test.ts (10 tests) 9ms - ✓ tests/platform/traffic/operation-traffic-policy.test.ts (7 tests) 9ms - ✓ tests/platform/traffic/request-fanout.test.ts (6 tests) 59ms - ✓ tests/platform/traffic/request-deduplication.test.ts (3 tests) 47ms - ✓ tests/platform/traffic/http-budget-integration.test.ts (9 tests) 124ms - ✓ tests/platform/traffic/traffic-amplification.test.ts (3 tests) 379ms - - Test Files  11 passed (11) - Tests  69 passed (69) - Start at  13:30:27 - Duration  1.13s (transform 1.01s, setup 3.62s, import 1.55s, tests 663ms, environment 2ms) - diff --git a/artifacts/scale/main/typescript-diagnostics.log b/artifacts/scale/main/typescript-diagnostics.log deleted file mode 100644 index f0982fbb..00000000 --- a/artifacts/scale/main/typescript-diagnostics.log +++ /dev/null @@ -1,5 +0,0 @@ -tsc app: files=827 types=279186 instantiations=700415 -PASS tsc:types (exponents 0.84, 0.96) -PASS tsc:symbols (exponents 0.51, 0.80) -PASS tsc:instantiations (exponents 0.97, 0.99) -tsc diagnostics artifact: /shared/codebase/clean-architecture-frontend-template/artifacts/scale/main/typescript-diagnostics.json diff --git a/artifacts/scale/nightly/architecture-topology.log b/artifacts/scale/nightly/architecture-topology.log deleted file mode 100644 index 9debb7bf..00000000 --- a/artifacts/scale/nightly/architecture-topology.log +++ /dev/null @@ -1,25 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/platform/cardinality/compose-unique-record.test.ts (2 tests) 5ms - ✓ tests/platform/cardinality/cardinality-budget.test.ts (3 tests) 5ms - ✓ tests/architecture/module-hierarchy.test.ts (1 test) 6ms - ✓ tests/architecture/context-lazy-loading.test.ts (1 test) 7ms - ✓ tests/platform/routing/context-route-module.test.ts (3 tests) 8ms - ✓ tests/architecture/topology-cardinality.test.ts (9 tests) 13ms - ✓ tests/architecture/observability-boundaries.test.ts (4 tests) 109ms - ✓ tests/architecture/request-fanout.test.ts (4 tests) 151ms - ✓ tests/platform/cardinality/extreme-scale-registry.test.ts (3 tests) 1946ms - ✓ keeps 10k -> 100k composition growth below a quadratic regression budget  378ms - ✓ keeps one million lookups bounded on a 100k-entry runtime registry  1201ms - ✓ selects and resolves 100k feature ids within the membership budget  365ms - ✓ tests/architecture/app-build-input.test.ts (4 tests) 2219ms - ✓ accepts the production generator's output and an app-local bundle  671ms - ✓ rejects a generator regression that imports every discovered feature  648ms - ✓ rejects a production bundle that contains another app's feature  649ms - - Test Files  10 passed (10) - Tests  34 passed (34) - Start at  13:30:41 - Duration  2.82s (transform 580ms, setup 3.20s, import 787ms, tests 4.47s, environment 2ms) - diff --git a/artifacts/scale/nightly/baseline-regression.log b/artifacts/scale/nightly/baseline-regression.log deleted file mode 100644 index 47c89185..00000000 --- a/artifacts/scale/nightly/baseline-regression.log +++ /dev/null @@ -1,3 +0,0 @@ -compatibility: structural=true compiler=true timing=true -axes: absolute 28 (ok), growth 8 (ok), relative 16 compiler + 12 timing -scale baseline gate: PASSED (artifacts/scale/nightly/baseline-regression.json) diff --git a/artifacts/scale/nightly/browser-soak.log b/artifacts/scale/nightly/browser-soak.log deleted file mode 100644 index 7751993d..00000000 --- a/artifacts/scale/nightly/browser-soak.log +++ /dev/null @@ -1,12 +0,0 @@ -browser soak: passed classification=stable samples=24 cycles=2012 -PASS cycles (2012 >= 200) -PASS post-warmup samples (18 >= 3) -PASS navigation (0 failures) -PASS heap slope (stable) -PASS listeners (stable, delta 2) -PASS timers (delta 0, max 2) -PASS in-flight settles (final 0, max 0) -PASS storage growth (keys 0, bytes 0) -PASS backend failure exercised (68 settled visits, 479 API requests, 24 telemetry events) -PASS request amplification (479 requests / 336 visits) -PASS telemetry rate (max 14/min, 24 posts, 24 events) diff --git a/artifacts/scale/nightly/composition-s0-s1.log b/artifacts/scale/nightly/composition-s0-s1.log deleted file mode 100644 index f6854892..00000000 --- a/artifacts/scale/nightly/composition-s0-s1.log +++ /dev/null @@ -1,5 +0,0 @@ -PASS registry-composition:growth (exponents 0.00) -PASS product-feature-selection:growth (exponents 0.00) -PASS product-feature-resolution:growth (exponents 0.00) -PASS context-hierarchy-composition:growth (exponents 0.00) -composition scale artifact: /shared/codebase/clean-architecture-frontend-template/artifacts/scale/nightly/composition-s0-s1.json diff --git a/artifacts/scale/nightly/composition-s0-s2.log b/artifacts/scale/nightly/composition-s0-s2.log deleted file mode 100644 index cf0e827b..00000000 --- a/artifacts/scale/nightly/composition-s0-s2.log +++ /dev/null @@ -1,5 +0,0 @@ -PASS registry-composition:growth (exponents 0.00, 0.64) -PASS product-feature-selection:growth (exponents 0.00, 0.85) -PASS product-feature-resolution:growth (exponents 0.00, 0.83) -PASS context-hierarchy-composition:growth (exponents 0.00, 0.34) -composition scale artifact: /shared/codebase/clean-architecture-frontend-template/artifacts/scale/nightly/composition-s0-s2.json diff --git a/artifacts/scale/nightly/composition-scale-suite.log b/artifacts/scale/nightly/composition-scale-suite.log deleted file mode 100644 index 055c5b6a..00000000 --- a/artifacts/scale/nightly/composition-scale-suite.log +++ /dev/null @@ -1,11 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/scale/tsc-diagnostics-parser.test.ts (3 tests) 6ms - ✓ tests/scale/composition-scale.test.ts (6 tests) 191ms - - Test Files  2 passed (2) - Tests  9 passed (9) - Start at  13:30:48 - Duration  514ms (transform 78ms, setup 296ms, import 81ms, tests 197ms, environment 0ms) - diff --git a/artifacts/scale/nightly/scale-units.log b/artifacts/scale/nightly/scale-units.log deleted file mode 100644 index acaba57c..00000000 --- a/artifacts/scale/nightly/scale-units.log +++ /dev/null @@ -1,17 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/scale/traffic/retry-after-jitter.test.ts (5 tests) 34ms - ✓ tests/scale/traffic/amplification-metrics.test.ts (6 tests) 6ms - ✓ tests/scale/benchmark.test.ts (4 tests) 8ms - ✓ tests/scale/growth-regression.test.ts (7 tests) 6ms - ✓ tests/scale/synthetic-topology.test.ts (8 tests) 8ms - ✓ tests/scale/scale-baseline.test.ts (11 tests) 14ms - ✓ tests/scale/traffic/failure-scenarios.test.ts (5 tests) 1453ms - ✓ bounds physical requests when all upstream calls fail  896ms - - Test Files  7 passed (7) - Tests  46 passed (46) - Start at  13:30:45 - Duration  2.07s (transform 436ms, setup 1.74s, import 563ms, tests 1.53s, environment 1ms) - diff --git a/artifacts/scale/nightly/session-cycles.log b/artifacts/scale/nightly/session-cycles.log deleted file mode 100644 index 978ef846..00000000 --- a/artifacts/scale/nightly/session-cycles.log +++ /dev/null @@ -1,12 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/scale/session/network-flap.test.ts (2 tests) 324ms - ✓ tests/scale/session/long-session.test.ts (1 test) 921ms - ✓ returns timers, listeners, leases, buffers and cache entries to a stable bound  919ms - - Test Files  2 passed (2) - Tests  3 passed (3) - Start at  13:31:03 - Duration  1.37s (transform 228ms, setup 296ms, import 363ms, tests 1.24s, environment 0ms) - diff --git a/artifacts/scale/nightly/telemetry-storm.log b/artifacts/scale/nightly/telemetry-storm.log deleted file mode 100644 index 0823d58b..00000000 --- a/artifacts/scale/nightly/telemetry-storm.log +++ /dev/null @@ -1,19 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/platform/telemetry/telemetry-port.test.ts (3 tests) 6ms - ✓ tests/platform/telemetry/telemetry-deduplicator.test.ts (8 tests) 11ms - ✓ tests/platform/telemetry/telemetry-buffer.test.ts (8 tests) 15ms - ✓ tests/platform/telemetry/redact-telemetry.test.ts (14 tests) 11ms - ✓ tests/platform/telemetry/trace-context.test.ts (6 tests) 43ms - ✓ tests/platform/telemetry/telemetry-pipeline.test.ts (9 tests) 669ms - ✓ bounds network sends during a repeated error storm  609ms - ✓ tests/scale/telemetry/telemetry-storm.test.ts (4 tests) 2882ms - ✓ does not turn 100000 identical failures into 100000 sends  748ms - ✓ bounds sends and buffer when a storm has many distinct fingerprints  2099ms - - Test Files  7 passed (7) - Tests  52 passed (52) - Start at  13:30:59 - Duration  3.35s (transform 427ms, setup 1.75s, import 534ms, tests 3.64s, environment 1ms) - diff --git a/artifacts/scale/nightly/topology-s3-s4.log b/artifacts/scale/nightly/topology-s3-s4.log deleted file mode 100644 index d035d0dc..00000000 --- a/artifacts/scale/nightly/topology-s3-s4.log +++ /dev/null @@ -1,16 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/platform/cardinality/extreme-scale-registry.test.ts (3 tests) 1822ms - ✓ keeps 10k -> 100k composition growth below a quadratic regression budget  313ms - ✓ keeps one million lookups bounded on a 100k-entry runtime registry  1163ms - ✓ selects and resolves 100k feature ids within the membership budget  345ms - ✓ tests/scale/global-local-independence.test.ts (7 tests) 6311ms - ✓ keeps App A's generated indexes and reachable source graph identical from S0 to S2 on disk  4764ms - ✓ selects another app from the same repository without App A's features  583ms - - Test Files  2 passed (2) - Tests  10 passed (10) - Start at  13:30:52 - Duration  6.64s (transform 87ms, setup 327ms, import 80ms, tests 8.13s, environment 0ms) - diff --git a/artifacts/scale/nightly/traffic-budgets.log b/artifacts/scale/nightly/traffic-budgets.log deleted file mode 100644 index 7d62db26..00000000 --- a/artifacts/scale/nightly/traffic-budgets.log +++ /dev/null @@ -1,20 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/platform/traffic/concurrency-budget.test.ts (6 tests) 9ms - ✓ tests/platform/resilience/deadline.test.ts (3 tests) 4ms - ✓ tests/platform/traffic/request-budget.test.ts (7 tests) 7ms - ✓ tests/platform/resilience/retry-budget.test.ts (6 tests) 5ms - ✓ tests/platform/traffic/traffic-budget.test.ts (9 tests) 8ms - ✓ tests/platform/execution/execution-context.test.ts (10 tests) 10ms - ✓ tests/platform/traffic/operation-traffic-policy.test.ts (7 tests) 9ms - ✓ tests/platform/traffic/request-fanout.test.ts (6 tests) 41ms - ✓ tests/platform/traffic/request-deduplication.test.ts (3 tests) 40ms - ✓ tests/platform/traffic/http-budget-integration.test.ts (9 tests) 121ms - ✓ tests/platform/traffic/traffic-amplification.test.ts (3 tests) 316ms - - Test Files  11 passed (11) - Tests  69 passed (69) - Start at  13:30:44 - Duration  1.04s (transform 890ms, setup 3.40s, import 1.40s, tests 570ms, environment 2ms) - diff --git a/artifacts/scale/nightly/typescript-diagnostics.log b/artifacts/scale/nightly/typescript-diagnostics.log deleted file mode 100644 index a9f17c57..00000000 --- a/artifacts/scale/nightly/typescript-diagnostics.log +++ /dev/null @@ -1,5 +0,0 @@ -tsc app: files=827 types=279186 instantiations=700415 -PASS tsc:types (exponents 0.84, 0.96) -PASS tsc:symbols (exponents 0.51, 0.80) -PASS tsc:instantiations (exponents 0.97, 0.99) -tsc diagnostics artifact: /shared/codebase/clean-architecture-frontend-template/artifacts/scale/nightly/typescript-diagnostics.json diff --git a/artifacts/scale/pr/architecture-topology.log b/artifacts/scale/pr/architecture-topology.log deleted file mode 100644 index 7bb024ec..00000000 --- a/artifacts/scale/pr/architecture-topology.log +++ /dev/null @@ -1,25 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/architecture/module-hierarchy.test.ts (1 test) 14ms - ✓ tests/architecture/topology-cardinality.test.ts (9 tests) 37ms - ✓ tests/architecture/observability-boundaries.test.ts (4 tests) 210ms - ✓ tests/architecture/context-lazy-loading.test.ts (1 test) 18ms - ✓ tests/platform/cardinality/cardinality-budget.test.ts (3 tests) 22ms - ✓ tests/platform/cardinality/compose-unique-record.test.ts (2 tests) 12ms - ✓ tests/platform/routing/context-route-module.test.ts (3 tests) 11ms - ✓ tests/architecture/request-fanout.test.ts (4 tests) 234ms - ✓ tests/platform/cardinality/extreme-scale-registry.test.ts (3 tests) 2791ms - ✓ keeps 10k -> 100k composition growth below a quadratic regression budget  721ms - ✓ keeps one million lookups bounded on a 100k-entry runtime registry  1649ms - ✓ selects and resolves 100k feature ids within the membership budget  420ms - ✓ tests/architecture/app-build-input.test.ts (4 tests) 2872ms - ✓ accepts the production generator's output and an app-local bundle  996ms - ✓ rejects a generator regression that imports every discovered feature  897ms - ✓ rejects a production bundle that contains another app's feature  723ms - - Test Files  10 passed (10) - Tests  34 passed (34) - Start at  13:30:15 - Duration  3.81s (transform 625ms, setup 4.78s, import 1.11s, tests 6.22s, environment 2ms) - diff --git a/artifacts/scale/pr/composition-s0-s1.log b/artifacts/scale/pr/composition-s0-s1.log deleted file mode 100644 index bd2058b4..00000000 --- a/artifacts/scale/pr/composition-s0-s1.log +++ /dev/null @@ -1,5 +0,0 @@ -PASS registry-composition:growth (exponents 0.00) -PASS product-feature-selection:growth (exponents 0.00) -PASS product-feature-resolution:growth (exponents 0.00) -PASS context-hierarchy-composition:growth (exponents 0.00) -composition scale artifact: /shared/codebase/clean-architecture-frontend-template/artifacts/scale/pr/composition-s0-s1.json diff --git a/artifacts/scale/pr/scale-units.log b/artifacts/scale/pr/scale-units.log deleted file mode 100644 index 7d2a53fa..00000000 --- a/artifacts/scale/pr/scale-units.log +++ /dev/null @@ -1,17 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/scale/traffic/amplification-metrics.test.ts (6 tests) 5ms - ✓ tests/scale/growth-regression.test.ts (7 tests) 6ms - ✓ tests/scale/traffic/retry-after-jitter.test.ts (5 tests) 38ms - ✓ tests/scale/benchmark.test.ts (4 tests) 7ms - ✓ tests/scale/synthetic-topology.test.ts (8 tests) 10ms - ✓ tests/scale/scale-baseline.test.ts (11 tests) 11ms - ✓ tests/scale/traffic/failure-scenarios.test.ts (5 tests) 1429ms - ✓ bounds physical requests when all upstream calls fail  919ms - - Test Files  7 passed (7) - Tests  46 passed (46) - Start at  13:30:21 - Duration  2.02s (transform 485ms, setup 1.52s, import 646ms, tests 1.51s, environment 1ms) - diff --git a/artifacts/scale/pr/traffic-budgets.log b/artifacts/scale/pr/traffic-budgets.log deleted file mode 100644 index 2026fd77..00000000 --- a/artifacts/scale/pr/traffic-budgets.log +++ /dev/null @@ -1,20 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/platform/traffic/request-budget.test.ts (7 tests) 5ms - ✓ tests/platform/resilience/deadline.test.ts (3 tests) 5ms - ✓ tests/platform/traffic/concurrency-budget.test.ts (6 tests) 10ms - ✓ tests/platform/resilience/retry-budget.test.ts (6 tests) 5ms - ✓ tests/platform/execution/execution-context.test.ts (10 tests) 9ms - ✓ tests/platform/traffic/traffic-budget.test.ts (9 tests) 10ms - ✓ tests/platform/traffic/operation-traffic-policy.test.ts (7 tests) 7ms - ✓ tests/platform/traffic/request-fanout.test.ts (6 tests) 44ms - ✓ tests/platform/traffic/request-deduplication.test.ts (3 tests) 40ms - ✓ tests/platform/traffic/http-budget-integration.test.ts (9 tests) 127ms - ✓ tests/platform/traffic/traffic-amplification.test.ts (3 tests) 328ms - - Test Files  11 passed (11) - Tests  69 passed (69) - Start at  13:30:20 - Duration  1.09s (transform 1.03s, setup 3.64s, import 1.52s, tests 590ms, environment 2ms) - diff --git a/artifacts/scale/release/architecture-topology.log b/artifacts/scale/release/architecture-topology.log deleted file mode 100644 index 30f4f1ab..00000000 --- a/artifacts/scale/release/architecture-topology.log +++ /dev/null @@ -1,25 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/platform/cardinality/compose-unique-record.test.ts (2 tests) 7ms - ✓ tests/architecture/context-lazy-loading.test.ts (1 test) 7ms - ✓ tests/platform/routing/context-route-module.test.ts (3 tests) 9ms - ✓ tests/platform/cardinality/cardinality-budget.test.ts (3 tests) 6ms - ✓ tests/architecture/module-hierarchy.test.ts (1 test) 6ms - ✓ tests/architecture/topology-cardinality.test.ts (9 tests) 12ms - ✓ tests/architecture/observability-boundaries.test.ts (4 tests) 101ms - ✓ tests/architecture/request-fanout.test.ts (4 tests) 155ms - ✓ tests/platform/cardinality/extreme-scale-registry.test.ts (3 tests) 1941ms - ✓ keeps 10k -> 100k composition growth below a quadratic regression budget  383ms - ✓ keeps one million lookups bounded on a 100k-entry runtime registry  1177ms - ✓ selects and resolves 100k feature ids within the membership budget  379ms - ✓ tests/architecture/app-build-input.test.ts (4 tests) 2191ms - ✓ accepts the production generator's output and an app-local bundle  659ms - ✓ rejects a generator regression that imports every discovered feature  635ms - ✓ rejects a production bundle that contains another app's feature  660ms - - Test Files  10 passed (10) - Tests  34 passed (34) - Start at  13:33:08 - Duration  2.80s (transform 512ms, setup 3.13s, import 681ms, tests 4.43s, environment 2ms) - diff --git a/artifacts/scale/release/baseline-regression.log b/artifacts/scale/release/baseline-regression.log deleted file mode 100644 index 2de93de9..00000000 --- a/artifacts/scale/release/baseline-regression.log +++ /dev/null @@ -1,3 +0,0 @@ -compatibility: structural=true compiler=true timing=true -axes: absolute 28 (ok), growth 8 (ok), relative 16 compiler + 12 timing -scale baseline gate: PASSED (artifacts/scale/release/baseline-regression.json) diff --git a/artifacts/scale/release/composition-s0-s1.log b/artifacts/scale/release/composition-s0-s1.log deleted file mode 100644 index edb0d391..00000000 --- a/artifacts/scale/release/composition-s0-s1.log +++ /dev/null @@ -1,5 +0,0 @@ -PASS registry-composition:growth (exponents 0.00) -PASS product-feature-selection:growth (exponents 0.00) -PASS product-feature-resolution:growth (exponents 0.00) -PASS context-hierarchy-composition:growth (exponents 0.00) -composition scale artifact: /shared/codebase/clean-architecture-frontend-template/artifacts/scale/release/composition-s0-s1.json diff --git a/artifacts/scale/release/composition-s0-s2.log b/artifacts/scale/release/composition-s0-s2.log deleted file mode 100644 index c3156c6c..00000000 --- a/artifacts/scale/release/composition-s0-s2.log +++ /dev/null @@ -1,5 +0,0 @@ -PASS registry-composition:growth (exponents 0.00, 0.65) -PASS product-feature-selection:growth (exponents 0.00, 0.90) -PASS product-feature-resolution:growth (exponents 0.00, 0.85) -PASS context-hierarchy-composition:growth (exponents 0.00, 0.44) -composition scale artifact: /shared/codebase/clean-architecture-frontend-template/artifacts/scale/release/composition-s0-s2.json diff --git a/artifacts/scale/release/composition-scale-suite.log b/artifacts/scale/release/composition-scale-suite.log deleted file mode 100644 index d366d63e..00000000 --- a/artifacts/scale/release/composition-scale-suite.log +++ /dev/null @@ -1,11 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/scale/tsc-diagnostics-parser.test.ts (3 tests) 7ms - ✓ tests/scale/composition-scale.test.ts (6 tests) 186ms - - Test Files  2 passed (2) - Tests  9 passed (9) - Start at  13:33:15 - Duration  494ms (transform 86ms, setup 297ms, import 80ms, tests 193ms, environment 0ms) - diff --git a/artifacts/scale/release/release-coherence.log b/artifacts/scale/release/release-coherence.log deleted file mode 100644 index f348e9a1..00000000 --- a/artifacts/scale/release/release-coherence.log +++ /dev/null @@ -1,15 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/platform/release/release-coherence.test.ts (10 tests) 8ms - ✓ tests/platform/release/release-mismatch-recovery.test.ts (10 tests) 14ms - ✓ tests/release/old-asset-reachability.test.ts (4 tests) 7ms - ✓ tests/platform/release/cache-policy.test.ts (5 tests) 29ms - ✓ tests/release/release-matrix.test.ts (7 tests) 39ms - ✓ tests/release/mixed-replica.test.ts (7 tests) 67ms - - Test Files  6 passed (6) - Tests  43 passed (43) - Start at  13:33:06 - Duration  780ms (transform 1.11s, setup 1.22s, import 1.79s, tests 163ms, environment 1ms) - diff --git a/artifacts/scale/release/scale-units.log b/artifacts/scale/release/scale-units.log deleted file mode 100644 index 12c471b0..00000000 --- a/artifacts/scale/release/scale-units.log +++ /dev/null @@ -1,17 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/scale/traffic/amplification-metrics.test.ts (6 tests) 6ms - ✓ tests/scale/growth-regression.test.ts (7 tests) 9ms - ✓ tests/scale/traffic/retry-after-jitter.test.ts (5 tests) 27ms - ✓ tests/scale/benchmark.test.ts (4 tests) 11ms - ✓ tests/scale/synthetic-topology.test.ts (8 tests) 13ms - ✓ tests/scale/scale-baseline.test.ts (11 tests) 11ms - ✓ tests/scale/traffic/failure-scenarios.test.ts (5 tests) 1362ms - ✓ bounds physical requests when all upstream calls fail  874ms - - Test Files  7 passed (7) - Tests  46 passed (46) - Start at  13:33:12 - Duration  1.96s (transform 513ms, setup 1.59s, import 672ms, tests 1.44s, environment 1ms) - diff --git a/artifacts/scale/release/telemetry-storm.log b/artifacts/scale/release/telemetry-storm.log deleted file mode 100644 index 89083c98..00000000 --- a/artifacts/scale/release/telemetry-storm.log +++ /dev/null @@ -1,12 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/scale/telemetry/telemetry-storm.test.ts (4 tests) 2705ms - ✓ does not turn 100000 identical failures into 100000 sends  672ms - ✓ bounds sends and buffer when a storm has many distinct fingerprints  1998ms - - Test Files  1 passed (1) - Tests  4 passed (4) - Start at  13:33:26 - Duration  3.01s (transform 58ms, setup 146ms, import 52ms, tests 2.71s, environment 0ms) - diff --git a/artifacts/scale/release/topology-s3-s4.log b/artifacts/scale/release/topology-s3-s4.log deleted file mode 100644 index 2ada7f2a..00000000 --- a/artifacts/scale/release/topology-s3-s4.log +++ /dev/null @@ -1,12 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/scale/global-local-independence.test.ts (7 tests) 6484ms - ✓ keeps App A's generated indexes and reachable source graph identical from S0 to S2 on disk  4707ms - ✓ selects another app from the same repository without App A's features  646ms - - Test Files  1 passed (1) - Tests  7 passed (7) - Start at  13:33:19 - Duration  6.79s (transform 53ms, setup 145ms, import 49ms, tests 6.48s, environment 0ms) - diff --git a/artifacts/scale/release/traffic-budgets.log b/artifacts/scale/release/traffic-budgets.log deleted file mode 100644 index 31abbdee..00000000 --- a/artifacts/scale/release/traffic-budgets.log +++ /dev/null @@ -1,20 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/platform/traffic/request-budget.test.ts (7 tests) 5ms - ✓ tests/platform/traffic/concurrency-budget.test.ts (6 tests) 10ms - ✓ tests/platform/resilience/retry-budget.test.ts (6 tests) 5ms - ✓ tests/platform/resilience/deadline.test.ts (3 tests) 6ms - ✓ tests/platform/traffic/traffic-budget.test.ts (9 tests) 9ms - ✓ tests/platform/execution/execution-context.test.ts (10 tests) 13ms - ✓ tests/platform/traffic/operation-traffic-policy.test.ts (7 tests) 7ms - ✓ tests/platform/traffic/request-fanout.test.ts (6 tests) 47ms - ✓ tests/platform/traffic/request-deduplication.test.ts (3 tests) 50ms - ✓ tests/platform/traffic/http-budget-integration.test.ts (9 tests) 121ms - ✓ tests/platform/traffic/traffic-amplification.test.ts (3 tests) 331ms - - Test Files  11 passed (11) - Tests  69 passed (69) - Start at  13:33:11 - Duration  1.08s (transform 940ms, setup 3.62s, import 1.46s, tests 603ms, environment 2ms) - diff --git a/artifacts/scale/release/typescript-diagnostics.log b/artifacts/scale/release/typescript-diagnostics.log deleted file mode 100644 index a9e02468..00000000 --- a/artifacts/scale/release/typescript-diagnostics.log +++ /dev/null @@ -1,5 +0,0 @@ -tsc app: files=827 types=279186 instantiations=700415 -PASS tsc:types (exponents 0.84, 0.96) -PASS tsc:symbols (exponents 0.51, 0.80) -PASS tsc:instantiations (exponents 0.97, 0.99) -tsc diagnostics artifact: /shared/codebase/clean-architecture-frontend-template/artifacts/scale/release/typescript-diagnostics.json From 12395662903533e162f1e0bdf7f61cf877f3c18f Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Wed, 4 Nov 2026 20:32:17 +0900 Subject: [PATCH 05/22] =?UTF-8?q?test(provider):=20scope=20wrapper=20EOF?= =?UTF-8?q?=20=ED=85=8C=EC=8A=A4=ED=8A=B8=EA=B0=80=20=EC=A4=80=EB=B9=84=20?= =?UTF-8?q?=EC=8B=A0=ED=98=B8=20=EB=92=A4=EC=97=90=20stdin=EC=9D=84=20?= =?UTF-8?q?=EB=8B=AB=EB=8A=94=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제 tests/unit/task3-selective-integration.test.ts의 EOF 테스트는 provider-scope-wrapper.ts를 새 Node로 띄우고, 준비 신호 없이 75 ms를 잔 뒤 stdin을 닫고 1초 안에 끝나기를 기다린다. 75 ms 안에 자식이 기동을 끝내지 못하면 Node 기동과 TS 모듈 import가 그 1초에 들어간다. 그래서 부하가 걸린 호스트에서 "provider scope EOF close timed out"으로 merge 게이트가 코드와 무관하게 떨어진다. 고른 방법 - guardian 테스트(c862004)와 같은 방식: 자식을 loader로 띄우고, loader가 바뀌지 않은 wrapper를 import한 뒤 여분 pipe(fd 3)에 1바이트를 쓴다. 테스트는 그 신호를 받은 뒤에 stdin을 닫는다. import가 끝나면 wrapper는 liveness 채널을 열고 EOF 처리기를 붙인 상태다. - 한도는 1초 대신 같은 계열의 watchdog 5초로 둔다. 이 한도는 멈춤만 판정한다. wrapper에 EOF 마감 같은 프로토콜 요구는 없다. - 버린 대안: 한도만 5초로 올리기. 기동 시간이 계속 한도 안에 든다. PROVIDER_PROCESS_TRACE_PATH 기록을 준비 신호로 쓰기. 파일 poll에 다시 마감이 필요하다. 위험·한계 - wrapper는 main 모듈이 아니라 loader가 import한 모듈로 돈다. wrapper는 argv[2..]만 읽고 import.meta를 쓰지 않는다. 여분 fd 3은 신호 뒤 닫힌다. - 파일 위치(tests/unit vs taxonomy의 tests/integration)는 1101/10-05와 같이 정할 일이라 옮기지 않았다. 검증 - RED: 자식만 기동에 1.5초를 쓰게 하는 --import 훅(scratchpad slow-start.mjs)으로 수정 전 테스트가 "provider scope EOF close timed out"으로 실패했다. 수정 뒤 같은 조건에서 통과(1.6초). - 한 코어에 바쁜 이웃 14개(taskset) 5회 모두 통과. - 변이: wrapper의 liveness.once("end", …)를 지우면 테스트가 실패한다 (code 0 ≠ 125). 되돌렸다. - 파일 전체 7건 통과, eslint 통과. Refs: docs/reviews/2026-11-03-maturity-review/10-tests-fast-layers.md 10-01 --- .../unit/task3-selective-integration.test.ts | 60 +++++++++++++++++-- 1 file changed, 54 insertions(+), 6 deletions(-) diff --git a/tests/unit/task3-selective-integration.test.ts b/tests/unit/task3-selective-integration.test.ts index 9a000c10..fcc47b9b 100644 --- a/tests/unit/task3-selective-integration.test.ts +++ b/tests/unit/task3-selective-integration.test.ts @@ -1,7 +1,9 @@ import { spawn } from "node:child_process"; +import { writeFileSync } from "node:fs"; import { lstat, mkdir, mkdtemp, readFile, readdir, rename, rm, writeFile } from "node:fs/promises"; import { tmpdir } from "node:os"; import path from "node:path"; +import { pathToFileURL } from "node:url"; import { afterEach, describe, expect, it } from "vitest"; @@ -15,6 +17,14 @@ import { generateCiWorkflow } from "../../scripts/generate-ci-workflow.ts"; import { validatePackageScriptGraph } from "../../scripts/lib/package-script-graph.ts"; const roots: string[] = []; +/** + * Test watchdog only, as in tests/integration/provider-guardian-transaction.test.ts. + * It bounds a hang. The wrapper has no protocol deadline for EOF, and a loaded + * host can take longer than a second just to start a child. + */ +const PROCESS_WATCHDOG_MS = 5_000; +/** The extra pipe on which spawnLoadedScopeWrapper reports the wrapper loaded. */ +const SCOPE_WRAPPER_LOADED_FD = 3; afterEach(async () => { await Promise.all(roots.splice(0).map((root) => rm(root, { recursive: true, force: true }))); @@ -154,23 +164,24 @@ describe("selective Task 3 contract closure", () => { const reportPath = path.join(root, "raw.json"); await writeFile(reportPath, "partial\n"); const identity = await lstat(reportPath); - const child = spawn(process.execPath, [ - path.resolve("scripts/lib/provider-scope-wrapper.ts"), + const child = spawnLoadedScopeWrapper(await mkdtemp(path.join(tmpdir(), "provider-scope-loader-")), [ "1", reportPath, String(identity.dev), String(identity.ino), - ], { stdio: ["pipe", "pipe", "pipe"] }); + ]); const completion = waitForChildResult(child); + await waitForScopeWrapperLoaded(child); + // Time to exit on its own, which it must not do before EOF. await new Promise((resolve) => setTimeout(resolve, 75)); expect(child.exitCode).toBeNull(); await expect(readFile(reportPath, "utf8")).resolves.toBe("partial\n"); - child.stdin.end(); - const result = await within(completion, 1_000, "provider scope EOF close"); + child.stdin!.end(); + const result = await within(completion, PROCESS_WATCHDOG_MS, "provider scope EOF close"); expect(result).toEqual({ code: 125, signal: null }); await expect(lstat(reportPath)).rejects.toMatchObject({ code: "ENOENT" }); await expect(readdir(root)).resolves.toEqual([]); - }); + }, PROCESS_WATCHDOG_MS * 3); it("tracks npm run-script dependencies instead of bypassing the graph", () => { expect(validatePackageScriptGraph({ root: "npm run-script missing" }, "root")) @@ -224,6 +235,43 @@ describe("selective Task 3 contract closure", () => { }); }); +/** + * 1103/10-01. Starts the unchanged scope wrapper through a loader that writes + * one byte to an extra pipe once the import has finished: by then the wrapper + * has opened its liveness channel and attached the EOF handler. Closing stdin + * at a fixed 75 ms put the child's whole start-up inside the EOF limit, and a + * loaded host failed the test with "EOF close timed out". The wrapper reads its + * launch identity from argv after the main module, so the loader takes the + * wrapper's place there. + */ +function spawnLoadedScopeWrapper( + loaderDirectory: string, + launchArguments: readonly string[], +): ReturnType { + roots.push(loaderDirectory); + const loader = path.join(loaderDirectory, "provider-scope-loaded.mjs"); + writeFileSync(loader, [ + 'import { closeSync, writeSync } from "node:fs";', + `await import(${JSON.stringify( + pathToFileURL(path.resolve("scripts/lib/provider-scope-wrapper.ts")).href, + )});`, + `writeSync(${SCOPE_WRAPPER_LOADED_FD}, "1");`, + `closeSync(${SCOPE_WRAPPER_LOADED_FD});`, + "", + ].join("\n")); + return spawn(process.execPath, [loader, ...launchArguments], { + stdio: ["pipe", "pipe", "pipe", "pipe"], + }); +} + +async function waitForScopeWrapperLoaded(child: ReturnType): Promise { + const loaded = (child.stdio as readonly unknown[])[SCOPE_WRAPPER_LOADED_FD] as NodeJS.ReadableStream; + await within(new Promise((resolve, reject) => { + loaded.once("data", () => resolve()); + loaded.once("end", () => reject(new Error("provider scope wrapper exited before it loaded"))); + }), PROCESS_WATCHDOG_MS, "provider scope wrapper start-up"); +} + async function waitForChildResult( child: ReturnType, ): Promise> { From 8d328c9ceab12878d371c4d3d93a97618a4f606b Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Wed, 4 Nov 2026 20:34:22 +0900 Subject: [PATCH 06/22] =?UTF-8?q?test(indexeddb):=20=EC=B0=A8=EB=8B=A8=20?= =?UTF-8?q?=EC=97=85=EA=B7=B8=EB=A0=88=EC=9D=B4=EB=93=9C=20=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=EA=B0=80=20500=20ms=20=EC=A0=84=EC=9D=B4=20?= =?UTF-8?q?=EC=83=81=ED=83=9C=EB=A5=BC=20=ED=8F=B4=EB=A7=81=ED=95=98?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=EB=8A=94=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제 tests/browser-capabilities/indexeddb-runtime.spec.ts의 차단 업그레이드 테스트는 v2 runtime을 blockedTimeoutMs 500으로 시작한 뒤 expect.poll(lifecycleStatus)로 BLOCKED 상태를 기다린다. 이 상태는 500 ms 뒤 CLOSED/NOT_OPENED로 바뀌고, 폴링 한 번은 page.evaluate 왕복이다. 그래서 바쁜 호스트에서는 첫 관찰 전에 창이 닫혀 FE-GATE-008이 코드와 무관하게 떨어진다(리뷰 전체 실행에서 chromium·webkit 실패). 고른 방법 - 전이 상태 폴링을 지우고, 바로 뒤 settleLifecycleRuntime 결과 (opened.error.code BLOCKED, recovery RELOAD_OTHER_CONTEXTS, status CLOSED/NOT_OPENED)로 차단을 판정한다. 전이 상태 BLOCKED는 제어한 scheduler로 tests/unit/indexeddb-runtime.test.ts가 이미 고정한다. - 버린 대안: blockedTimeoutMs를 늘리기. 창이 넓어질 뿐 경쟁이 남는다. runtime이 상태 변화를 기록하게 하기. 운영 코드에 테스트용 기록이 생긴다. 위험·한계 - 실제 브라우저에서 getStatus()가 BLOCKED를 돌려주는 순간은 이 spec이 더는 보지 않는다(단위 테스트가 본다). 검증 - RED: 창을 20 ms로 줄이면 수정 전 테스트가 chromium·webkit에서 CLOSED/NOT_OPENED를 받아 실패했다(리뷰 실패와 같은 모양). 수정 뒤 같은 20 ms에서 세 엔진 통과. 값은 500으로 되돌렸다. - test:browser-capabilities 전체 63 passed(load 15~20). 5회 반복은 하지 않았다. Refs: docs/reviews/2026-11-03-maturity-review/11-tests-browser-release-scale.md 11-05 --- .../browser-capabilities/indexeddb-runtime.spec.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/tests/browser-capabilities/indexeddb-runtime.spec.ts b/tests/browser-capabilities/indexeddb-runtime.spec.ts index e3fa690b..c02a959f 100644 --- a/tests/browser-capabilities/indexeddb-runtime.spec.ts +++ b/tests/browser-capabilities/indexeddb-runtime.spec.ts @@ -1020,15 +1020,12 @@ test("fails a blocked v2 upgrade closed, then closes its late connection after t ); expect(blocker).toBe("OPEN"); + // 1103/11-05. The BLOCKED status lasts only blockedTimeoutMs before the + // runtime closes, and each poll is a page.evaluate round trip, so a loaded + // host saw CLOSED first. The settled open result below already says the + // upgrade was blocked; tests/unit/indexeddb-runtime.test.ts pins the + // transient status on a controlled clock. await startLifecycleRuntime(page, name, 2, 500); - await expect - .poll(async () => await lifecycleStatus(page)) - .toEqual({ - kind: "BLOCKED", - currentVersion: 1, - targetVersion: 2, - }); - const blocked = await settleLifecycleRuntime(page); expect(blocked).toMatchObject({ opened: { From f08c93ab2e8d7be2441ebf22b7ddd213a47dcbed Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Wed, 4 Nov 2026 21:01:33 +0900 Subject: [PATCH 07/22] =?UTF-8?q?fix(removal):=20=EB=AC=B8=EC=84=9C?= =?UTF-8?q?=EB=A5=BC=20=EC=9D=BD=EB=8A=94=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EC=A0=9C=EC=99=B8=20=EB=AA=A9=EB=A1=9D=EC=9D=84=20=EB=AA=A8?= =?UTF-8?q?=EB=93=A0=20=EC=A0=9C=EA=B1=B0=20=EB=93=9C=EB=A6=B4=EC=9D=B4=20?= =?UTF-8?q?=EA=B0=99=EC=9D=B4=20=EC=93=B4=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제 FE-GATE-020의 제거 드릴은 정해진 목록만 fixture에 복사하고, 그 목록에 README.md·CHANGELOG.md·docs/가 없다. 그런데 fixture에서 도는 test:all에는 그 문서를 읽는 테스트 두 개(documentation-readiness, changelog-review-ids)가 들어 있다. sample-removal 드릴만 두 테스트를 지웠고, browser-file-storage·realtime·optional-recipe 드릴은 제거 대상과 무관하게 `test` 검사에서 ENOENT로 항상 실패했다. 세 드릴의 실패는 merge 게이트를 빨갛게 하고 release 단계도 막는다. 고른 방법 - scripts/lib/removal-fixture.ts에 문서 목록 (REMOVAL_FIXTURE_DOCUMENT_TARGETS)과 그 문서를 읽는 테스트 목록 (REMOVAL_FIXTURE_DOCUMENT_TESTS)을 한 번만 둔다. prepareRemovalFixture는 문서를 복사하지 않은 fixture에서 그 테스트를 지운다. 문서를 복사하는 드릴(test:feature-scaffold)에서는 그대로 돈다. - sample-removal 드릴의 자체 제외 두 줄을 지운다. - 버린 대안: 모든 드릴이 문서까지 복사. capability 드릴은 문서가 설명하는 runtime을 지우므로, 문서 테스트가 지운 경로를 실패로 본다. 드릴마다 문서 예외가 필요해진다. 드릴마다 제외를 복사. 지금 고장의 원인(갈라진 목록)을 되풀이한다. - 단위 테스트가 목록을 고정한다: 문서 없이 복사하면 제외, 문서를 복사하면 제외 없음, 제외 대상이 실제로 문서를 읽음, 다섯 드릴이 모두 prepareRemovalFixture를 쓰고 자체 제외 목록을 두지 않음. 위험·한계 - 저장소 루트 문서를 읽는 테스트가 더 생기면 이 목록에 더해야 한다. 더하지 않으면 capability 드릴이 다시 ENOENT로 실패한다(조용히 통과하지는 않는다). - 세 드릴의 실제 실행 결과는 이 커밋 메시지에 적지 않았다(공유 잠금 대기). 검증 - RED: 새 테스트 "is the only exclusion list"가 수정 전 sample 드릴의 자체 목록 때문에 실패. - tests/unit/removal-fixture.test.ts 12건 통과, 바꾼 파일 eslint 통과. Refs: docs/reviews/2026-11-03-maturity-review/02-adapters-browser-files-cache.md 02-06 --- scripts/lib/removal-fixture.ts | 38 ++++++++++++++++++++++++++++ scripts/test-feature-scaffold.ts | 5 ++-- scripts/test-sample-removal.ts | 4 --- tests/unit/removal-fixture.test.ts | 40 ++++++++++++++++++++++++++++++ 4 files changed, 80 insertions(+), 7 deletions(-) diff --git a/scripts/lib/removal-fixture.ts b/scripts/lib/removal-fixture.ts index ed3d2741..efbbf9b3 100644 --- a/scripts/lib/removal-fixture.ts +++ b/scripts/lib/removal-fixture.ts @@ -46,6 +46,41 @@ export const REMOVAL_FIXTURE_COPY_TARGETS = Object.freeze([ * provider suite down with it — twenty-odd failures with one cause. */ +/** + * The repository's documents. A drill that adds or removes a feature copies + * them as well (REMOVAL_FIXTURE_COPY_TARGETS plus these), because the change + * must leave the documents valid (1103/14-04). The capability drills do not: + * the documents describe the capability they delete, and what those drills + * prove is that the code still builds and tests without it. + */ +export const REMOVAL_FIXTURE_DOCUMENT_TARGETS = Object.freeze([ + "README.md", + "CHANGELOG.md", + "docs", +] as const); + +/** + * 1103/02-06. Tests that read REMOVAL_FIXTURE_DOCUMENT_TARGETS. A fixture + * copied without the documents cannot run them: every capability drill + * (FE-GATE-020) failed its `test` check on ENOENT for README.md and + * CHANGELOG.md, whatever the removal did. prepareRemovalFixture deletes them + * from such a fixture, and the repository's own test:unit keeps running them. + * This is the only list; the sample drill used to keep the exclusion to itself. + */ +export const REMOVAL_FIXTURE_DOCUMENT_TESTS = Object.freeze([ + "tests/unit/changelog-review-ids.test.ts", + "tests/unit/documentation-readiness.test.ts", +] as const); + +/** The tests a fixture copied from `copyTargets` cannot run. */ +export function removalFixtureExcludedTests( + copyTargets: readonly string[], +): readonly string[] { + return REMOVAL_FIXTURE_DOCUMENT_TARGETS.every((target) => copyTargets.includes(target)) + ? [] + : REMOVAL_FIXTURE_DOCUMENT_TESTS; +} + /** * Regenerated result trees under `artifacts/`: traces, coverage HTML, recorded * videos and Storybook bundles. They are tens of megabytes and mean nothing to @@ -114,6 +149,9 @@ export async function prepareRemovalFixture( for (const target of copyTargets) { await cp(target, path.join(root, target), { recursive: true }); } + for (const test of removalFixtureExcludedTests(copyTargets)) { + await rm(path.join(root, test), { force: true }); + } await copyReleaseEvidenceTree(process.cwd(), root); runFixtureGit(root, ["init", "--quiet", "--initial-branch=fixture"]); await linkFixtureNodeModules(root); diff --git a/scripts/test-feature-scaffold.ts b/scripts/test-feature-scaffold.ts index 61654558..6348a516 100644 --- a/scripts/test-feature-scaffold.ts +++ b/scripts/test-feature-scaffold.ts @@ -4,6 +4,7 @@ import { createRemovalFixtureRoot, prepareRemovalFixture, REMOVAL_FIXTURE_COPY_TARGETS, + REMOVAL_FIXTURE_DOCUMENT_TARGETS, renderRemovalJunit, requireRemovalFixtureEnvironment, runRemovalFixtureCheck, @@ -32,9 +33,7 @@ try { // verify:documentation and the documentation tests read these. await prepareRemovalFixture(fixtureRoot, [ ...REMOVAL_FIXTURE_COPY_TARGETS, - "README.md", - "CHANGELOG.md", - "docs", + ...REMOVAL_FIXTURE_DOCUMENT_TARGETS, ]); const created = check("create-feature", "create:feature", [FEATURE_ID]); const checks: RemovalCheck[] = [created]; diff --git a/scripts/test-sample-removal.ts b/scripts/test-sample-removal.ts index 81bec4c0..dab5ac93 100644 --- a/scripts/test-sample-removal.ts +++ b/scripts/test-sample-removal.ts @@ -207,10 +207,6 @@ try { "tests/unit/__snapshots__/ci-workflow-generation.test.ts.snap", "tests/unit/removal-fixture.test.ts", "tests/unit/http-scenario-evidence.test.ts", - // They check README.md and CHANGELOG.md, which the fixture does not copy - // (REMOVAL_FIXTURE_COPY_TARGETS); removing a feature does not change them. - "tests/unit/changelog-review-ids.test.ts", - "tests/unit/documentation-readiness.test.ts", ]) { await rm(path.join(fixtureRoot, excludedFixtureTest), { force: true }); } diff --git a/tests/unit/removal-fixture.test.ts b/tests/unit/removal-fixture.test.ts index b117687b..b34457c0 100644 --- a/tests/unit/removal-fixture.test.ts +++ b/tests/unit/removal-fixture.test.ts @@ -8,6 +8,10 @@ import { loadCiGateContract } from "../../scripts/contracts/ci-gates.ts"; import { assertNoRuntimeImports, pruneRemovalFixtureCiContract, + REMOVAL_FIXTURE_COPY_TARGETS, + REMOVAL_FIXTURE_DOCUMENT_TARGETS, + REMOVAL_FIXTURE_DOCUMENT_TESTS, + removalFixtureExcludedTests, removeRuntimeDependentTests, renderRemovalJunit, runtimeImportGraph, @@ -132,6 +136,42 @@ it("rejects pruning that leaves a reduced gate without commands", async () => { })).rejects.toThrow(/commandIds|too small|at least 1/i); }); +// 1103/02-06. Three FE-GATE-020 drills copied the repository without its +// documents and still ran the tests that read them, so each failed its `test` +// check on ENOENT whatever it removed. Only the sample drill excluded them. +describe("document tests in a removal fixture", () => { + it("leaves the document tests out exactly when the documents are not copied", () => { + expect(removalFixtureExcludedTests(REMOVAL_FIXTURE_COPY_TARGETS)) + .toEqual(REMOVAL_FIXTURE_DOCUMENT_TESTS); + expect(removalFixtureExcludedTests([ + ...REMOVAL_FIXTURE_COPY_TARGETS, + ...REMOVAL_FIXTURE_DOCUMENT_TARGETS, + ])).toEqual([]); + }); + + it("names tests that exist and read the documents", async () => { + for (const test of REMOVAL_FIXTURE_DOCUMENT_TESTS) { + await expect(readFile(test, "utf8")).resolves.toMatch(/README\.md|CHANGELOG\.md/u); + } + }); + + it("is the only exclusion list: every drill prepares its fixture through it", async () => { + for (const drill of [ + "scripts/test-sample-removal.ts", + "scripts/test-feature-scaffold.ts", + "scripts/test-browser-file-storage-runtime-removal.ts", + "scripts/test-realtime-runtime-removal.ts", + "scripts/test-optional-recipe-removal.ts", + ]) { + const source = await readFile(drill, "utf8"); + expect(source, drill).toContain("prepareRemovalFixture("); + for (const test of REMOVAL_FIXTURE_DOCUMENT_TESTS) { + expect(source, drill).not.toContain(test); + } + } + }); +}); + describe("release evidence fixture copy", () => { it("keeps the release evidence and leaves the regenerated trees behind", async () => { const { copyReleaseEvidenceTree, RELEASE_EVIDENCE_REGENERATED_TREES } = From c4d587052edc706c752e7c7c2b284882dc53a26e Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Wed, 4 Nov 2026 21:02:14 +0900 Subject: [PATCH 08/22] =?UTF-8?q?fix(removal):=20=EC=B0=B8=EC=A1=B0=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=EC=9D=84=20=EC=A7=80=EC=9B=8C=EB=8F=84=20?= =?UTF-8?q?=EB=AC=B8=EC=84=9C=20=EA=B2=8C=EC=9D=B4=ED=8A=B8=EA=B0=80=20?= =?UTF-8?q?=ED=86=B5=EA=B3=BC=ED=95=98=EA=B3=A0=20=EB=93=9C=EB=A6=B4?= =?UTF-8?q?=EC=9D=B4=20=EA=B7=B8=EA=B2=83=EC=9D=84=20=EB=B3=B8=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제 README는 참조 기능을 지울 수 있다고 적는다. 그러나 매뉴얼·입구 문서 10개가 참조 기능과 그 드릴 전용 파일의 경로를 백틱으로 적고, verify:documentation(FE-GATE-017)은 백틱 경로의 존재를 검사한다. 그래서 참조 기능을 지운 복사본에서 문서 게이트가 경로 24개로 실패한다. 제거 드릴(test:sample-removal)은 문서를 복사하지 않고 그 게이트와 lint· check:i18n·check:design-system을 돌리지 않아 이 충돌을 보지 못했다. 고른 방법 - 리뷰 5.2절 (b): 참조 기능이 가진 경로는 백틱 없이 "예제(참조 기능)"으로 적는다. 기능 공통 모양은 생성 경로 꼴(`src/features//domain`)로 적는다. 규칙은 docs/manual/reference/patterns.md 첫머리에 적었다. - 드릴은 REMOVAL_FIXTURE_DOCUMENT_TARGETS(README·CHANGELOG·docs)까지 복사하고, 지운 뒤와 생성 기능을 더한 뒤 두 번 모두 lint, verify:documentation, check:i18n, check:design-system을 돈다 (FOLLOW-UP 09-07). 문서 테스트 두 개도 fixture에서 다시 돈다. - 버린 대안: 검사기가 참조 기능 경로를 "없어도 되는 경로"로 보기(5.2 (c)). 매뉴얼이 없는 파일을 가리키는 상태를 허용한다. 참조 기능을 지울 수 없게 하기(5.2 (d)). README 약속과 드릴의 존재 이유가 바뀐다. 위험·한계 - 템플릿 자신에서도 참조 기능 경로의 존재를 문서 검사가 더는 보지 않는다. 참조 기능 파일 이름을 바꾸면 그 문장은 사람이 고쳐야 한다. - 드릴 시간이 lint·문서 검사 두 번만큼 는다. - 드릴 실제 실행 결과는 이 커밋 메시지에 적지 않았다(공유 잠금 대기). 검증 - 참조 기능·참조 context·SAMPLE_EXTRAS를 지운 복사본(scratchpad sim-sample-docs.sh)에서 수정 전 FAIL_UNVERIFIED(문서 10개), 수정 뒤 PASS_SCOPED. - 저장소에서 verify:documentation PASS_SCOPED, documentation-readiness 14건 통과, eslint 통과. Refs: docs/reviews/2026-11-03-maturity-review/14-template-product-docs.md 14-04 --- README.md | 2 +- docs/accessibility/manual-checklist.md | 2 +- docs/architecture/scale-architecture.md | 2 +- docs/architecture/starter-experience.md | 8 +++++--- docs/contracts/compatibility.md | 2 +- docs/manual/01-add-a-feature.md | 20 ++++++++++---------- docs/manual/02-decision-tables.md | 2 +- docs/manual/reference/create-feature.md | 2 +- docs/manual/reference/patterns.md | 6 +++--- docs/operations/performance-evidence.md | 2 +- scripts/test-sample-removal.ts | 18 +++++++++++++++++- 11 files changed, 42 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 43178c84..9d80e44b 100644 --- a/README.md +++ b/README.md @@ -174,7 +174,7 @@ See `docs/architecture/frontend-application-foundation.md`, `docs/architecture/overview.md`, `docs/architecture/layers.md`, and `docs/architecture/starter-experience.md`. The removable vertical slice is -under `src/features/reference-feature`; its domain, application input, HTTP +the reference sample, src/features/reference-feature; its domain, application input, HTTP binding, contracts, route runtime, and presentation own their contributions. The central installed catalogs only aggregate selected contributions. The generic starter routes continue to typecheck, test, and build after that diff --git a/docs/accessibility/manual-checklist.md b/docs/accessibility/manual-checklist.md index 8dad35c9..93cb5e97 100644 --- a/docs/accessibility/manual-checklist.md +++ b/docs/accessibility/manual-checklist.md @@ -72,5 +72,5 @@ What the automated run scans: calls answer an empty list there. - The reference sample's list in its success, empty and error states, its detail, its form with submit errors and its status page, each after that - state is on screen (`tests/e2e/reference-form.spec.ts`, removed with the + state is on screen (tests/e2e/reference-form.spec.ts, removed with the sample). diff --git a/docs/architecture/scale-architecture.md b/docs/architecture/scale-architecture.md index bba6bf92..aa4fad13 100644 --- a/docs/architecture/scale-architecture.md +++ b/docs/architecture/scale-architecture.md @@ -210,7 +210,7 @@ src/ The exact path layout may adapt to current repository conventions, but ownership boundaries are mandatory. -> 2026-11-03 현재: 위 그림의 최상위 `domain/` 폴더는 없다. domain 계층은 기능 안(`src/features/reference-feature/domain`)에만 있다. `src/platform`에는 `execution`·`release`·`routing`도 있다. +> 2026-11-03 현재: 위 그림의 최상위 `domain/` 폴더는 없다. domain 계층은 기능 안(`src/features//domain`)에만 있다. `src/platform`에는 `execution`·`release`·`routing`도 있다. > 색인은 생성기가 git이 무시하는 `src/.generated/`에 쓴다. 조립 코드는 `src/bootstrap/`에 있고 `compose-product.ts`라는 파일은 없다. 실제 폴더 목록의 정본은 [`layers.md`](layers.md)다. ## 5. Module Ownership diff --git a/docs/architecture/starter-experience.md b/docs/architecture/starter-experience.md index 0a4512dc..d7911b4a 100644 --- a/docs/architecture/starter-experience.md +++ b/docs/architecture/starter-experience.md @@ -131,7 +131,8 @@ selected app. Every build and check script runs it first; run it yourself with invalidation, topic versions and the external `contractPackages` the release manifest is checked against at boot), its message catalogs, and `loadRuntime`, which imports `feature-runtime.ts` dynamically. - `src/features/reference-feature/feature-module.ts` is the complete example. + The reference sample's feature-module.ts (src/features/reference-feature, + while it is installed) is the complete example. 2. Create `src/features//feature-runtime.ts` with `defineFeatureRuntime`: the API contract (operations, schema metadata, runtime schemas, mappers), the adapter contributions @@ -140,7 +141,8 @@ selected app. Every build and check script runs it first; run it yourself with it (`application.features.load`) when one of the feature's routes is entered. Do not import it statically from anywhere: each feature would add its whole executable code to the initial chunk again, about 3.9 KB gzip - (`tests/unit/feature-shape-growth.test.ts` bounds one feature at 1 KiB). + (tests/unit/feature-shape-growth.test.ts, which goes with the reference + sample, bounds one feature at 1 KiB). An HTTP API is written once, as its contract contribution descriptor: it executes, and `check:registries` governs the FE-REG-API row projected from it (`projectApiOperationRows` in `src/contracts/api-operations.ts`). @@ -151,7 +153,7 @@ selected app. Every build and check script runs it first; run it yourself with `FEATURE_CONTEXT_ROUTES`. Page components are imported lazily here, and each route handle carries the route's params/search `codecs`; the owning context loads this file only when its route root is visited - (`src/features/reference-feature/context-routes.ts`). Each handle's + (the reference sample's context-routes.ts shows one). Each handle's `routeId` must be a route of a feature contract in the same context; the context refuses the routes when they load, naming the route, context and features (`src/contexts/bounded-context-module.ts`). diff --git a/docs/contracts/compatibility.md b/docs/contracts/compatibility.md index 2d172d24..5d1337b2 100644 --- a/docs/contracts/compatibility.md +++ b/docs/contracts/compatibility.md @@ -25,7 +25,7 @@ reader that accepts it must ship before any writer sends it. | `FEATURE_OVERRIDES` | record; unknown feature id ignored | additive | `featureOverrideArtifactSchema` in `src/contracts/release-artifacts.ts` | | Release manifest V2 | strict object | breaking | `releaseManifestV2ArtifactSchema` in `src/contracts/release-artifacts.ts` | | HTTP success/failure envelope (V3 with `responseEnvelope: "ENVELOPE_V1"`) | strict object (`meta` strips) | breaking | `successEnvelopeSchema`, `failureEnvelopeSchema` in `src/adapters/http/backend-envelope.ts` | -| HTTP V3 response DTO (reference feature) | `.strip()` drops unknown fields | additive | `referenceResourceDtoSchema` in `src/features/reference-feature/contracts/reference-schemas.ts` | +| HTTP V3 response DTO (reference feature) | `.strip()` drops unknown fields | additive | `referenceResourceDtoSchema` in the reference sample's contracts/reference-schemas.ts | | Realtime envelope | exact key set; unknown `eventType` is `MALFORMED_EVENT` | breaking | `decodeUnsafe` in `src/adapters/realtime/event-codec.ts` | | Browser RPC transport error code | closed vocabulary; unknown code is a protocol violation | breaking | `decodeTransportFailure` in `src/adapters/browser-rpc/browser-rpc-runtime.ts` | | Persisted client storage | versioned key; incompatible value discarded | use a new key version | `defineStorageKey` in `src/contracts/storage-keys.ts` | diff --git a/docs/manual/01-add-a-feature.md b/docs/manual/01-add-a-feature.md index 8382286d..3e8cc92b 100644 --- a/docs/manual/01-add-a-feature.md +++ b/docs/manual/01-add-a-feature.md @@ -5,7 +5,7 @@ - 뼈대는 손으로 만들지 않는다. `corepack pnpm create:feature `로 만든다. - 뼈대를 실제 기능으로 바꾸는 순서가 아래 0~11단계다. -참조 기능(`src/features/reference-feature/`)을 복사해 이름을 바꾸는 방법은 쓰지 않는다. +참조 기능(src/features/reference-feature/)을 복사해 이름을 바꾸는 방법은 쓰지 않는다. 그 방법은 접두어 없는 전역 ID, 참조 전용 계약 출처, 기능 밖 테스트 의존 때문에 여러 번 막힌다. 생성 명령은 이 문제를 미리 피한 파일을 쓴다. @@ -117,7 +117,7 @@ corepack pnpm create:feature invoice-feature - 명령 자체가 거부한다. ID 형식, 기존 기능·context와 겹침, 라우트·경로·chunk·문구 키 충돌, topic 충돌, 패키지 신원 형식. - 생성기가 거부한다. 선언 헤더가 리터럴이 아님, 없는 context, 예산 초과. - 이때 명령은 만든 파일을 모두 지우고 `the feature index generator rejected the feature, nothing was kept:`로 끝난다. -- **못 잡음**: `--context reference-context`로 참조 context에 넣으면 참조 기능 테스트 `tests/features/reference-feature/installed-context-routing.test.ts`가 깨진다. 그 테스트는 참조 context의 라우트 수를 정확히 비교한다. 참조 context에는 넣지 않는다. +- **못 잡음**: `--context reference-context`로 참조 context에 넣으면 참조 기능 테스트 tests/features/reference-feature/installed-context-routing.test.ts가 깨진다. 그 테스트는 참조 context의 라우트 수를 정확히 비교한다. 참조 context에는 넣지 않는다. ④ **쓸 스킬**: `clean-architecture`, `codebase-design` @@ -137,7 +137,7 @@ corepack pnpm create:feature invoice-feature - 있으면 `domain/.ts`에 둔다. - 생성 함수에서 불변식을 검사하고 `Object.freeze`로 고정한다. - 이름은 와이어 필드가 아니라 업무 이름으로 짓는다(참조 기능은 `name`을 `displayName`으로 바꾼다). -- 예제: `src/features/reference-feature/domain/` +- 예제(참조 기능): src/features/reference-feature/domain/ - 길이 제한(예: 제목 100자)은 domain이 아니라 경계 검증에 둔다. - 경계 검증: 값이 앱에 들어오거나 나가는 자리(요청·응답 스키마, 폼 스키마)에서 하는 검사다. - 서버가 정한 제한이면 `contracts/-schemas.ts`에 상수로 두고 요청 스키마와 폼 스키마가 같은 상수를 쓴다. 숫자가 두 곳에서 갈라지지 않는다. @@ -216,7 +216,7 @@ DTO와 problem details(`type`·`title`·`status`)를 감싸지 않고 보내는 2. problem 스키마를 problem details 모양으로 바꾼다. 3. `classifyProblem`이 모든 판정을 정한다. 실행기가 먼저 정하는 판정은 없다. -참조 기능(`src/features/reference-feature/`)이 이 모양이다. 참조 기능의 MSW 본문도 DTO와 problem details다. +참조 기능(src/features/reference-feature/)이 이 모양이다. 참조 기능의 MSW 본문도 DTO와 problem details다. **입력과 스키마 메타데이터** @@ -341,7 +341,7 @@ projectRequest: (input) => Object.freeze({ - 참조 기능은 생성 operation에 목록 route(`REFERENCE_RESOURCE_LIST`)를 적었다. 실제로 보내는 화면은 폼 route다. 동작은 같고 기록의 이름표만 다르다. 새 기능은 위 기준을 따른다. - `needs`에는 실제로 쓰는 것만 적는다. - 템플릿이 만들지 않는 capability(예: `indexedDb`)는 `src/bootstrap/product-composition.ts`에서 만든다. [03 문서](03-outside-feature-folder.md)를 본다. -- 문제 응답 매핑 예제: `src/features/reference-feature/adapters/reference-http-gateway.ts` +- 문제 응답 매핑 예제(참조 기능): src/features/reference-feature/adapters/reference-http-gateway.ts ③ **잡는 검사 / 못 잡는 것** @@ -384,8 +384,8 @@ projectRequest: (input) => Object.freeze({ ② **기준** - 경로는 계약에만 적는다. 페이지와 링크는 route ID와 `buildRouteUrl`로 URL을 만든다. 경로 문자열을 페이지에 다시 적지 않는다. -- 파라미터나 검색값이 있는 라우트는 `context-routes.ts`의 handle에 `codecs`를 싣는다. 예제: `src/features/reference-feature/context-routes.ts`. - - 링크용 URL 함수도 같은 codec을 `buildRouteUrl`의 세 번째 인자로 넘긴다. 생성된 판은 파라미터가 없어서 넘기지 않는다. 안 넘기면 `Unregistered route codec: `로 throw한다. codec ID는 계약 `routeRuntimeContracts`의 `paramsCodec`·`searchCodec` 값이다. 예제: `src/features/reference-feature/presentation/reference-routes.ts`. +- 파라미터나 검색값이 있는 라우트는 `context-routes.ts`의 handle에 `codecs`를 싣는다. 예제(참조 기능): src/features/reference-feature/context-routes.ts. + - 링크용 URL 함수도 같은 codec을 `buildRouteUrl`의 세 번째 인자로 넘긴다. 생성된 판은 파라미터가 없어서 넘기지 않는다. 안 넘기면 `Unregistered route codec: `로 throw한다. codec ID는 계약 `routeRuntimeContracts`의 `paramsCodec`·`searchCodec` 값이다. 예제(참조 기능): src/features/reference-feature/presentation/reference-routes.ts. - 상세 경로는 목록 경로 뒤에 `/items/:`을 붙인다. 예: `/notice/items/:noticeId`. `/notice/:noticeId`로 두지 않는다. - 라우터(React Router)는 같은 자리에서 정적 경로를 먼저 고른다. 작성 폼 `/notice/new`가 있으면 id가 `new`인 공지는 `/notice/:noticeId`로 열 수 없다. - `items/`를 끼우면 정적 경로와 겹치지 않는다. 참조 기능도 이렇게 한다(`/examples/reference-resources/items/:resourceId`). @@ -443,7 +443,7 @@ projectRequest: (input) => Object.freeze({ - 형식: `qinv.` + 소문자·숫자 26자. `scripts/create-feature.ts`의 `randomTopicSuffix`가 쓰는 방식이다. - `measureResult`에서 `JSON.stringify`를 쓰지 않는다. 문자열 바이트와 항목당 고정 크기로 어림한다(생성된 `measureItems` 참고). - `KEYED` 쓰기는 `requiresIdempotencyKey: true`, `duplicatePolicy: "REJECT_WHILE_ACTIVE"`, `invalidate: [topic]`을 쓴다. - - 예제: `src/features/reference-feature/presentation/use-reference-feature.ts`의 생성 뮤테이션 정책. + - 예제(참조 기능): src/features/reference-feature/presentation/use-reference-feature.ts의 생성 뮤테이션 정책. ③ **잡는 검사 / 못 잡는 것** @@ -472,7 +472,7 @@ projectRequest: (input) => Object.freeze({ - 화면 문구는 모두 catalog에서 가져온다(`message(key)`). - 링크는 6단계의 URL 함수로 만든다. -- 결과 불명 화면 예제: `src/features/reference-feature/presentation/reference-resource-form-page.tsx` +- 결과 불명 화면 예제(참조 기능): src/features/reference-feature/presentation/reference-resource-form-page.tsx ③ **잡는 검사 / 못 잡는 것** @@ -564,7 +564,7 @@ projectRequest: (input) => Object.freeze({ expect(await posts[0]!.json()).toEqual({ title: "새 공지", body: "본문입니다." }); ``` - - 핸들러를 직접 써서 요청을 모으는 방법도 있다. 예제: `tests/features/reference-feature/reference-production-vertical.test.tsx`의 504 재전송 테스트. + - 핸들러를 직접 써서 요청을 모으는 방법도 있다. 예제(참조 기능): tests/features/reference-feature/reference-production-vertical.test.tsx의 504 재전송 테스트. - 빠르게 돌리기: `node scripts/run-vitest.ts run tests/features/` - CI에서는 `test:coverage`(FE-GATE-005)가 `tests/features`를 돈다. `test:unit`은 `tests/unit`만 돈다. diff --git a/docs/manual/02-decision-tables.md b/docs/manual/02-decision-tables.md index 96fe6213..be27717d 100644 --- a/docs/manual/02-decision-tables.md +++ b/docs/manual/02-decision-tables.md @@ -166,7 +166,7 @@ context는 URL 앞부분 하나(라우트 루트)를 가진다. 그 아래 기 **정본**: 어떤 status·code가 "적용 안 됨"인지는 `clean-architecture-backend-template/docs/web/http-contract.md` §2다. -**어디에 적나**: `contracts/-contract-contribution.ts`의 `commandEffect`(`classifyProblem`, `classifyStatus`). 예제: `src/features/reference-feature/contracts/reference-feature-contract-contribution.ts`의 `CREATE_EFFECT`. +**어디에 적나**: `contracts/-contract-contribution.ts`의 `commandEffect`(`classifyProblem`, `classifyStatus`). 예제(참조 기능): src/features/reference-feature/contracts/reference-feature-contract-contribution.ts의 `CREATE_EFFECT`. **틀리면** diff --git a/docs/manual/reference/create-feature.md b/docs/manual/reference/create-feature.md index 5e26a4bb..5321f33e 100644 --- a/docs/manual/reference/create-feature.md +++ b/docs/manual/reference/create-feature.md @@ -134,6 +134,6 @@ corepack pnpm generate:feature-index ## 알려진 한계 -- `--context reference-context`로 참조 context에 넣으면 `tests/features/reference-feature/installed-context-routing.test.ts`가 깨진다. 그 테스트는 참조 context의 라우트 수를 정확히 비교한다. +- `--context reference-context`로 참조 context에 넣으면 참조 기능 테스트 tests/features/reference-feature/installed-context-routing.test.ts가 깨진다. 그 테스트는 참조 context의 라우트 수를 정확히 비교한다. - 드릴은 `check:bundle`(FE-GATE-012), 브라우저 테스트(`test:a11y`, `test:e2e`)를 돌리지 않는다. - 새 context는 앱이 하나일 때만 만든다. 앱이 여럿이면 `--context`로 기존 context를 고른다. diff --git a/docs/manual/reference/patterns.md b/docs/manual/reference/patterns.md index c8e49e09..7bb3f1d1 100644 --- a/docs/manual/reference/patterns.md +++ b/docs/manual/reference/patterns.md @@ -3,7 +3,7 @@ 기능을 만들 때 쓰는 패턴과, 그 패턴의 정의와 예제가 어디 있는지 적는다. - **정의**: 플랫폼(기능 밖)에서 패턴을 제공하는 파일. -- **예제**: 복사해 볼 수 있는 기능 코드. `생성 뼈대`는 `create:feature`가 만드는 코드다. `참조 기능`은 `src/features/reference-feature/`다. +- **예제**: 복사해 볼 수 있는 기능 코드. `생성 뼈대`는 `create:feature`가 만드는 코드다. `참조 기능`은 src/features/reference-feature/다. 참조 기능은 지울 수 있으므로 그 경로는 백틱 없이 적는다. 백틱 경로는 문서 검사(`verify:documentation`)가 존재를 확인한다. - 예제가 없는 패턴은 **없음**이라고 적었다. 그 패턴은 정의를 읽고 직접 쓴다. 참조 기능은 예제일 뿐이다. 복사해 이름을 바꾸지 않는다. 모양을 보고 생성 뼈대에 옮긴다. @@ -13,12 +13,12 @@ | 패턴 | 정의 | 예제 | 검사 | |---|---|---|---| | 기능 모듈 등록 | `src/features/feature-module.ts` (`defineFeatureModule`, `defineFeatureRuntime`), 생성기 | 생성 뼈대 `feature-module.ts`, `feature-runtime.ts` | 생성기, 기능 ID와 계약 `featureId` 일치 | -| context 소속 선언 | `src/contexts/bounded-context-module.ts` | `src/contexts/reference-context/context-module.ts` | 생성기(없는 context, 예산), 앱 모듈(루트 밖 라우트) | +| context 소속 선언 | `src/contexts/bounded-context-module.ts` | 참조 기능의 src/contexts/reference-context/context-module.ts | 생성기(없는 context, 예산), 앱 모듈(루트 밖 라우트) | | context 전용 레이아웃 | `docs/architecture/starter-experience.md` "Product home and layouts" | `tests/helpers/fixture-layout-product.tsx` (테스트 fixture) | `tests/component/context-layouts.test.tsx` | | 앱 홈 대신하기 | `src/contracts/routes.ts`의 `FEATURE_REPLACEABLE_PLATFORM_ROUTE_IDS` | 없음 (기능 예제) | 조립 (두 기능이 `APP_HOME`을 선언하면 실패) | | 조립 기여(`needs`) | `src/features/feature-adapter-contribution.ts` | 생성 뼈대 `adapters/create--feature-input.ts` | 조립 (없는 capability, 다른 기능의 input) | | 제품 capability | `src/bootstrap/product-composition.ts`, `src/bootstrap/product-composition-contract.ts` | `recipes/frontend-capabilities/indexeddb-feature-capability.ts` | `check:types` | -| 기능 끄기 | `config/runtime/.json`의 `FEATURE_OVERRIDES` | `config/runtime/local.json` | `tests/component/product-feature-switch.test.tsx` | +| 기능 끄기 | `config/runtime/.json`의 `FEATURE_OVERRIDES` | `config/runtime/local.json` | 참조 기능의 tests/component/product-feature-switch.test.tsx | ## 라우트 diff --git a/docs/operations/performance-evidence.md b/docs/operations/performance-evidence.md index 6bf1c888..10371362 100644 --- a/docs/operations/performance-evidence.md +++ b/docs/operations/performance-evidence.md @@ -22,7 +22,7 @@ Performance evidence is deliberately split by measurement context: | 초기 JS 예산 | 204,800 gzip bytes(200 KiB) | | 템플릿 기준선(2026-11-01, 커밋 `298201f`) | 202,509~202,522 gzip bytes, 16개 파일. local 프로필, `VITE_BUILD_ID`가 `local-build`일 때와 CI 모양(`gitea--`)일 때다. 빌드 ID가 번들에 들어가므로 빌드마다 수십~수백 바이트 다르다 | | 여유 | 약 2,280 bytes(1.1%) | -| 기능 하나를 더할 때 | 참조 기능 모양 복사본 하나에 약 +650~750 bytes(`298201f` 측정, 상한은 `tests/unit/feature-shape-growth.test.ts`의 1 KiB). 기능 실행부(`feature-runtime.ts`)는 라우트에 들어갈 때 받는 lazy chunk다 | +| 기능 하나를 더할 때 | 참조 기능 모양 복사본 하나에 약 +650~750 bytes(`298201f` 측정, 상한은 참조 기능과 함께 지워지는 tests/unit/feature-shape-growth.test.ts의 1 KiB). 기능 실행부(`feature-runtime.ts`)는 라우트에 들어갈 때 받는 lazy chunk다 | | lazy chunk 예산 | 파일마다 122,880 gzip bytes(120 KiB). 기준선의 lazy JS는 17개, 합계 28,204 bytes이고 가장 큰 것은 `use-reference-feature` 8,386 bytes다 | 청크 이름으로 크기를 판단하지 않는다. rolldown은 공용 청크에 안에 든 모듈 diff --git a/scripts/test-sample-removal.ts b/scripts/test-sample-removal.ts index dab5ac93..f9b3e88c 100644 --- a/scripts/test-sample-removal.ts +++ b/scripts/test-sample-removal.ts @@ -18,6 +18,8 @@ import { pruneRemovalFixtureCiContract, pruneScriptOrchestration, regenerateRemovalFixtureWorkflow, + REMOVAL_FIXTURE_COPY_TARGETS, + REMOVAL_FIXTURE_DOCUMENT_TARGETS, renderRemovalJunit, requireRemovalFixtureEnvironment, runRemovalFixtureCheck, @@ -201,7 +203,14 @@ function outcome(name: string, findings: readonly string[], label: string): Remo } try { - await prepareRemovalFixture(fixtureRoot); + // 1103/14-04. The documents come too: removing a feature must leave them + // valid, and the fixture used to leave them out with the tests that read + // them, so a manual naming the sample's files passed here and then failed + // FE-GATE-017 in the product that removed it. + await prepareRemovalFixture(fixtureRoot, [ + ...REMOVAL_FIXTURE_COPY_TARGETS, + ...REMOVAL_FIXTURE_DOCUMENT_TARGETS, + ]); for (const excludedFixtureTest of [ "tests/unit/ci-workflow-generation.test.ts", "tests/unit/__snapshots__/ci-workflow-generation.test.ts.snap", @@ -395,6 +404,13 @@ try { } const gateChecks = (prefix: string): RemovalCheck[] => [ check(`${prefix}typecheck`, "check:types"), + // 1103/14-04 (FOLLOW-UP 09-07). Merge and documentation gates the drill + // did not run: the documents, lint, screen text and design tokens can + // name or use what the removal deleted. + check(`${prefix}lint`, "lint"), + check(`${prefix}documentation`, "verify:documentation"), + check(`${prefix}i18n`, "check:i18n"), + check(`${prefix}design-system`, "check:design-system"), check(`${prefix}architecture`, "check:architecture"), check(`${prefix}registries`, "check:registries"), check(`${prefix}unit-integration`, "test:all"), From 90440082f9f368b2c5d7dbd529db89506de21e2f Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Wed, 4 Nov 2026 21:03:59 +0900 Subject: [PATCH 09/22] =?UTF-8?q?test(system):=20provider=20=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=EB=AC=B6=EC=9D=8C=20=EC=A0=84=EC=B2=B4?= =?UTF-8?q?=EC=97=90=20provider=20=EC=8B=9C=EA=B0=84=20=EC=98=88=EC=82=B0?= =?UTF-8?q?=EC=9D=84=20=EC=93=B4=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제 tests/system/ci-runner/ci-artifact-contract.test.ts는 provider 묶음에 30초 예산(PROCESS_HEAVY_TIMEOUT_MS)을 두고 "10s default is sized for pure-JS unit tests"라고 적는다. 그런데 같은 describe의 테스트 선언 8개(케이스 10개)는 여전히 10초다. 그래서 바쁜 호스트에서 "kills descendants … timeout termination"이 10,116 ms로 시간 초과해 FE-GATE-013이 가끔 빨개진다. 또 기반 fixture(build:release-candidate)를 처음 createProviderFixture()를 부른 테스트 안에서 만들어서, -t로 하나만 골라 돌리면 그 테스트가 빌드를 떠안아 항상 실패한다. 고른 방법 - describe 옵션으로 묶음 전체에 PROCESS_HEAVY_TIMEOUT_MS를 주고, 테스트마다 적은 10_000·15_000·20_000·30_000을 지운다. 40_000을 준 tar 폭탄 테스트 하나는 그대로 둔다. - 기반 fixture는 describe의 beforeAll에서 만든다. 상한은 빌드의 spawn 상한(120초)에 복사·압축 여유를 더한 180초다. - 버린 대안: 전역 testTimeout 올리기. 파일 주석이 이미 버렸다(진짜 멈춘 테스트를 숨긴다). 테스트마다 상수로 바꾸기. 상수를 안 쓰는 테스트가 다시 생길 수 있다. 위험·한계 - 실제로 멈춘 provider 테스트는 실패까지 최대 30초 걸린다. - runProviderSupervisor의 spawn 상한(기본 8초)은 바꾸지 않았다. 부하에서 systemd user manager가 느리면 "provider unit remained loaded"로 따로 실패할 수 있다(이번 실행에서 load 24일 때 한 번 봄, 운영 코드의 상한). - loadavg 20 이상에서 test:system 전체 5회 반복은 하지 않았다. 검증 - -t "kills descendants|hides repository metadata"로 골라 돌렸을 때 두 kills descendants 테스트가 통과(3.0 s, 2.9 s). 기반 빌드는 beforeAll이 떠안았다. - eslint 통과. Refs: docs/reviews/2026-11-03-maturity-review/11-tests-browser-release-scale.md 11-03 --- .../ci-runner/ci-artifact-contract.test.ts | 41 ++++++++++++------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/tests/system/ci-runner/ci-artifact-contract.test.ts b/tests/system/ci-runner/ci-artifact-contract.test.ts index ec92a221..1eefff9a 100644 --- a/tests/system/ci-runner/ci-artifact-contract.test.ts +++ b/tests/system/ci-runner/ci-artifact-contract.test.ts @@ -6,7 +6,7 @@ import { tmpdir } from "node:os"; import path from "node:path"; import { setTimeout as delay } from "node:timers/promises"; -import { afterAll, afterEach, describe, expect, it } from "vitest"; +import { afterAll, afterEach, beforeAll, describe, expect, it } from "vitest"; import type { CiGateArtifact, @@ -62,6 +62,11 @@ import { * default instead would hide a genuinely hung test. */ const PROCESS_HEAVY_TIMEOUT_MS = 30_000; +/** + * The provider base fixture runs `build:release-candidate`, bounded at 120s + * (ensureProviderBaseFixture), and then copies and archives the result. + */ +const PROVIDER_BASE_FIXTURE_TIMEOUT_MS = 180_000; const temporaryRoots: string[] = []; let providerBaseRoot: string | undefined; @@ -448,7 +453,16 @@ describe("CI artifact validator", () => { }); }); -describe("candidate archive and provider upload boundaries", () => { +// 1103/11-03. Every test here spawns a provider launch chain or copies the +// release-candidate fixture, so the whole block runs on the provider budget; +// eight tests were still on the 10s unit default and timed out under load. +// The base fixture is built once in beforeAll, on its own ceiling, so a test +// selected alone with -t no longer pays for the build inside its own budget. +describe("candidate archive and provider upload boundaries", { timeout: PROCESS_HEAVY_TIMEOUT_MS }, () => { + beforeAll(async () => { + await ensureProviderBaseFixture(); + }, PROVIDER_BASE_FIXTURE_TIMEOUT_MS); + it("accepts only the manifest-bound candidate member set and bytes", async () => { const fixture = await createCandidateArchiveFixture(); await expect( @@ -601,7 +615,7 @@ describe("candidate archive and provider upload boundaries", () => { providerValidationInput(fixture, Buffer.from(`${JSON.stringify(report)}\n`)), ), ).rejects.toThrow(/candidate identity mismatch/i); - }, 30_000); + }); it("uses the reverified archive manifest when extracted candidate files are mutated", async () => { const fixture = await createProviderFixture(); @@ -686,7 +700,6 @@ describe("candidate archive and provider upload boundaries", () => { }); expect(retried.status, retried.stderr).toBe(0); }, - 20_000, ); it("drains and kills provider background processes before sealing evidence", async () => { @@ -728,7 +741,7 @@ describe("candidate archive and provider upload boundaries", () => { expect(JSON.parse(await readFile(sealedPath, "utf8"))).toEqual( expect.objectContaining({ provider: "fixture" }), ); - }, 10_000); + }); it("does not expose or mutate a host path outside the sandboxed workspace", async () => { const fixture = await createProviderFixture(); @@ -749,7 +762,7 @@ describe("candidate archive and provider upload boundaries", () => { }); expect(result.status, result.stderr).toBe(0); await expect(readFile(canary, "utf8")).resolves.toBe("host-secret\n"); - }, 10_000); + }); it("applies effective aggregate cgroup limits without exposing command or credentials", async () => { const fixture = await createProviderFixture(); @@ -851,7 +864,7 @@ describe("candidate archive and provider upload boundaries", () => { expect(trace.every((entry) => !processExists(entry.pid))).toBe(true); await expect(lstat(fixture.reportPath)).rejects.toMatchObject({ code: "ENOENT" }); await expect(findProviderRawReferences(fixture.reportPath, reportIdentity)).resolves.toEqual([]); - }, PROCESS_HEAVY_TIMEOUT_MS); + }); it("kills and collects an active provider when its guardian dies", async () => { const fixture = await createProviderFixture(); @@ -894,7 +907,7 @@ describe("candidate archive and provider upload boundaries", () => { sealedPath, }); expect(retried.status, retried.stderr).toBe(0); - }, 20_000); + }); it("collects the whole provider scope when its supervisor dies", async () => { const fixture = await createProviderFixture(); @@ -934,7 +947,7 @@ describe("candidate archive and provider upload boundaries", () => { await expect(lstat(cgroupRoot)).rejects.toMatchObject({ code: "ENOENT" }); expect(cgroupPids.every((pid) => !processExists(pid))).toBe(true); await expect(findProviderRawReferences(fixture.reportPath, reportIdentity)).resolves.toEqual([]); - }, 10_000); + }); it("fails closed when the guardian dies after scope collection and before commit", async () => { const fixture = await createProviderFixture(); @@ -979,7 +992,7 @@ describe("candidate archive and provider upload boundaries", () => { await execution.completion; } } - }, 10_000); + }); it("cleans published evidence when the supervisor dies and permits same-workspace retry", async () => { const fixture = await createProviderFixture(); @@ -1025,7 +1038,7 @@ describe("candidate archive and provider upload boundaries", () => { await execution.completion; } } - }, 15_000); + }); it("observes EMFILE at the provider FD limit and still emits valid evidence", async () => { const fixture = await createProviderFixture(); @@ -1046,7 +1059,7 @@ describe("candidate archive and provider upload boundaries", () => { }); expect(result.status, result.stderr).toBe(0); await expect(lstat(fixture.reportPath)).rejects.toMatchObject({ code: "ENOENT" }); - }, 10_000); + }); it("enforces CPU RLIMIT before the independent wall-clock timeout", async () => { const fixture = await createProviderFixture(); @@ -1063,7 +1076,7 @@ describe("candidate archive and provider upload boundaries", () => { expect(result.stderr).toMatch(/exit=(?:137|152)|signal=SIG(?:XCPU|KILL)/iu); expect(result.stderr).not.toMatch(/timed out/iu); await expect(lstat(fixture.reportPath)).rejects.toMatchObject({ code: "ENOENT" }); - }, 10_000); + }); it.each(["output", "timeout"] as const)( "kills descendants and collects the scope on provider %s termination", @@ -1107,7 +1120,6 @@ describe("candidate archive and provider upload boundaries", () => { expect(cgroupPids.every((pid) => !processExists(pid))).toBe(true); await expect(findProviderRawReferences(fixture.reportPath, reportIdentity)).resolves.toEqual([]); }, - 10_000, ); it.each(["vulnerability", "provenance"] as const)( @@ -1150,7 +1162,6 @@ describe("candidate archive and provider upload boundaries", () => { await waitForChildClose(canary.child); } }, - 10_000, ); }); From 0edc3fc90a948fbe2897ed019930a33139859976 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Wed, 4 Nov 2026 21:04:35 +0900 Subject: [PATCH 10/22] =?UTF-8?q?fix(provider):=20worktree=EC=9D=98=20.git?= =?UTF-8?q?=20=ED=8C=8C=EC=9D=BC=EC=9D=84=20=EC=83=8C=EB=93=9C=EB=B0=95?= =?UTF-8?q?=EC=8A=A4=EC=97=90=EC=84=9C=20=EA=B0=80=EB=A6=AC=EA=B3=A0=20?= =?UTF-8?q?=EB=8B=A4=EB=A5=B8=20checkout=EC=9D=80=20=EB=B3=B5=EC=82=AC?= =?UTF-8?q?=ED=95=98=EC=A7=80=20=EC=95=8A=EB=8A=94=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제 scripts/run-and-validate-provider.ts는 작업 폴더에 .git이 있으면 그 자리에 --tmpfs를 건다. git worktree나 서브모듈 checkout에서는 .git이 디렉터리가 아니라 "gitdir:" 한 줄짜리 파일이라 bubblewrap이 "Can't mkdir …/.git: Not a directory"로 끝난다. 그래서 worktree에서 test:system을 돌리면 사전 점검은 PASS인데 provider 테스트 16개가 샌드박스 회귀처럼 실패한다. 또 provider 기반 fixture는 현재 폴더를 통째로 복사해, checkout 안의 .claude/worktrees/*나 .tmp/* 같은 다른 checkout·드릴 fixture와 그 node_modules까지 /tmp/ci-provider-upload-*에 복사했다(시간 초과, ENOTEMPTY). 고른 방법 - .git이 디렉터리면 지금처럼 tmpfs로 가린다. 디렉터리가 아니면 /dev/null을 --ro-bind로 겹친다. bubblewrap은 bind를 nodev로 걸어서 provider는 그 줄을 읽지도 그 경로에 쓰지도 못한다. 파일이 가리키는 실제 git 디렉터리는 작업 폴더 밖이라 원래 샌드박스에 들어오지 않는다. - 리뷰 최소 개선 (1)(사전 점검이 worktree를 거부) 대신 (2)를 골랐다. 이 repo의 리뷰·수정 절차가 영역마다 worktree를 쓰므로, worktree에서 샌드박스 경계 테스트를 돌릴 수 있어야 한다. 비용도 몇 줄로 비슷하다. - 기반 fixture 복사에서 .claude, .worktrees, .tmp, graphify-out을 뺀다. 모두 추적하지 않는 폴더라 후보의 추적 파일 목록에는 영향이 없다. - 새 system 테스트 2건이 .git이 디렉터리일 때와 파일일 때 provider가 그 내용을 보지도 바꾸지도 못함을 확인한다. - 버린 대안: --dev-bind /dev/null. 읽으면 빈 내용이지만 쓰기를 받는다. --remount-ro를 더하면 nodev가 다시 걸려 --ro-bind와 같아진다. 빈 일반 파일을 호스트에 만들어 bind. 임시 파일의 수명·정리 경로가 하나 는다. 위험·한계 - .git 파일 자리에서 provider는 빈 파일이 아니라 열 수 없는 문자 장치를 본다(EACCES). 작업 폴더를 훑는 provider가 그 오류를 실패로 다루면 거기서 드러난다. - 마스크를 지우는 변이 확인은 부하(load 24) 때문에 systemd unit 수거가 늦어 결론을 내지 못했다(두 경우 모두 "provider unit remained loaded"). 검증 - RED: worktree에서 test:system 16 failed / 96 passed(모두 provider 묶음, 같은 bwrap 오류). 새 테스트는 수정 전 "file" 경우만 실패. - 수정 뒤 새 테스트 2건 통과(-t "hides repository metadata"). - eslint 통과. Refs: docs/reviews/2026-11-03-maturity-review/11-tests-browser-release-scale.md 11-04 --- scripts/run-and-validate-provider.ts | 27 ++++++-- .../ci-runner/ci-artifact-contract.test.ts | 61 ++++++++++++++++++- 2 files changed, 83 insertions(+), 5 deletions(-) diff --git a/scripts/run-and-validate-provider.ts b/scripts/run-and-validate-provider.ts index 597989d8..09511f4a 100644 --- a/scripts/run-and-validate-provider.ts +++ b/scripts/run-and-validate-provider.ts @@ -1,7 +1,7 @@ import { spawn } from "node:child_process"; import { randomBytes } from "node:crypto"; import { constants } from "node:fs"; -import { access, appendFile, lstat } from "node:fs/promises"; +import { access, appendFile, lstat, stat } from "node:fs/promises"; import path from "node:path"; import { @@ -274,12 +274,21 @@ async function runProviderInSandbox( bwrapArguments.push("--dir", directory); } bwrapArguments.push("--ro-bind", workspaceRoot, workspaceRoot); - if (await exists(path.join(workspaceRoot, ".git"))) { + const repositoryMetadata = path.join(workspaceRoot, ".git"); + const metadataKind = await entryKind(repositoryMetadata); + if (metadataKind === "directory") { bwrapArguments.push( "--size", String(PROVIDER_MASK_BYTES), - "--tmpfs", path.join(workspaceRoot, ".git"), - "--remount-ro", path.join(workspaceRoot, ".git"), + "--tmpfs", repositoryMetadata, + "--remount-ro", repositoryMetadata, ); + } else if (metadataKind === "other") { + // 1103/11-04. A linked worktree or a submodule checkout has a one-line + // `gitdir:` file here, and a tmpfs cannot be mounted on a file. /dev/null + // is bound over it instead. bubblewrap mounts binds nodev, so the provider + // can neither read the line nor write the path; the directory it names + // lies outside the workspace and is never bound into the sandbox. + bwrapArguments.push("--ro-bind", "/dev/null", repositoryMetadata); } bwrapArguments.push( "--ro-bind", candidateRoot, "/candidate", @@ -597,6 +606,16 @@ function missingDestinationAncestors(target: string): string[] { return ancestors.reverse(); } +/** What `target` is once symlinks are followed, as bubblewrap will see it. */ +async function entryKind(target: string): Promise<"directory" | "other" | null> { + try { + return (await stat(target)).isDirectory() ? "directory" : "other"; + } catch (error) { + if (hasErrorCode(error, "ENOENT")) return null; + throw error; + } +} + async function exists(target: string): Promise { try { await lstat(target); diff --git a/tests/system/ci-runner/ci-artifact-contract.test.ts b/tests/system/ci-runner/ci-artifact-contract.test.ts index 1eefff9a..3aa99b33 100644 --- a/tests/system/ci-runner/ci-artifact-contract.test.ts +++ b/tests/system/ci-runner/ci-artifact-contract.test.ts @@ -764,6 +764,44 @@ describe("candidate archive and provider upload boundaries", { timeout: PROCESS_ await expect(readFile(canary, "utf8")).resolves.toBe("host-secret\n"); }); + // 1103/11-04. In a linked worktree or a submodule checkout `.git` is a + // one-line `gitdir:` file. The sandbox hid `.git` with a tmpfs, which + // bubblewrap cannot mount on a file, so every provider run in a worktree + // ended with "Can't mkdir …/.git: Not a directory" before the provider ran. + it.each(["directory", "file"] as const)( + "hides repository metadata from the provider when .git is a %s", + async (shape) => { + const fixture = await createProviderFixture(); + await rm(fixture.reportPath); + const metadata = path.join(fixture.root, ".git"); + await rm(metadata, { recursive: true, force: true }); + if (shape === "directory") { + await mkdir(metadata); + await writeFile(path.join(metadata, "HEAD"), "ref: refs/heads/fixture\n"); + } else { + await writeFile(metadata, "gitdir: /repository/.git/worktrees/fixture\n"); + } + const providerScript = path.join(fixture.root, "provider-git-metadata.mjs"); + // Exit 9 when the provider can see what the metadata says, exit 8 when + // it can change it. + await writeFile(providerScript, [ + "import { appendFileSync, readFileSync, readdirSync, statSync, writeFileSync } from 'node:fs';", + `const metadata = ${JSON.stringify(metadata)};`, + "const directory = statSync(metadata).isDirectory();", + "let visible = false;", + "try { visible = directory ? readdirSync(metadata).length > 0 : readFileSync(metadata).length > 0; } catch {}", + "if (visible) process.exit(9);", + "try { appendFileSync(directory ? `${metadata}/HEAD` : metadata, 'mutated\\n'); process.exit(8); } catch {}", + providerV2WriterSource({ importFs: false }), + ].join("\n")); + const result = runProviderSupervisor(fixture, { + command: `node ${JSON.stringify(providerScript)}`, + sealedPath: path.join(fixture.root, "provider-evidence/vulnerability-report.json"), + }); + expect(result.status, result.stderr).toBe(0); + }, + ); + it("applies effective aggregate cgroup limits without exposing command or credentials", async () => { const fixture = await createProviderFixture(); await rm(fixture.reportPath); @@ -2184,6 +2222,27 @@ async function createProviderFixture() { }; } +/** + * Top-level entries the provider base fixture leaves behind: build output, + * installed modules (linked separately below), and other checkouts or scratch + * trees that can live inside a checkout. `.claude/worktrees/*` and + * `.worktrees/*` are other worktrees of this repository and `.tmp/*` holds + * removal-drill fixtures, each with its own node_modules; copying them filled + * every /tmp/ci-provider-upload-* root with those trees, and the suite failed + * with timeouts and ENOTEMPTY clean-ups (1103/11-04). None of them is tracked, + * so the candidate's tracked-file inventory does not miss them. + */ +const PROVIDER_BASE_FIXTURE_UNCOPIED_ENTRIES: readonly string[] = Object.freeze([ + ".release", + "artifacts", + "dist", + "node_modules", + ".claude", + ".worktrees", + ".tmp", + "graphify-out", +]); + async function ensureProviderBaseFixture(): Promise { if (providerBaseRoot) return providerBaseRoot; const sourceRoot = process.cwd(); @@ -2194,7 +2253,7 @@ async function ensureProviderBaseFixture(): Promise { const relative = path.relative(sourceRoot, source); if (!relative) return true; const first = relative.split(path.sep)[0]; - return ![".release", "artifacts", "dist", "node_modules"].includes(first ?? ""); + return !PROVIDER_BASE_FIXTURE_UNCOPIED_ENTRIES.includes(first ?? ""); }, }); // The release evidence, minus the trace and Storybook trees. Copying the From d1db7e7887f62bcd880123dc1f81729b0192d257 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Wed, 4 Nov 2026 21:10:19 +0900 Subject: [PATCH 11/22] =?UTF-8?q?fix(architecture):=20=EA=B8=88=EC=A7=80?= =?UTF-8?q?=20fixture=EB=A5=BC=20=EA=B7=B8=20=EA=B3=84=EC=B8=B5=EC=9D=98?= =?UTF-8?q?=20=EC=9A=B4=EC=98=81=20ESLint=20=EC=84=A4=EC=A0=95=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EA=B2=80=EC=82=AC=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제 tests/fixtures/architecture/forbidden/**에는 fixture 전용 ESLint 블록이 붙어 있었다. 모든 계층의 금지 import와 fetch·localStorage·sessionStorage 금지를 합친 것이다. check-architecture.ts는 fixture마다 ESLint 종료 코드가 0이 아니면 거부됐다고 셌다. 그래서 운영 src/presentation/** 블록에서 계층 import 금지와 fetch 금지를 지워도(변이 M2) check:architecture는 "9 forbidden rejected"로 통과했다. 전역 fetch·localStorage 금지는 이 ESLint 블록 말고 지키는 검사가 없다. 고른 방법 - 새 scripts/lib/architecture-lint-fixtures.ts가 fixture마다 그것이 대표하는 운영 경로(lintAs, 예: src/presentation/__architecture_fixture__/…)와 거부해야 하는 규칙(rejectedBy)을 적는다. ESLint API lintText(code, { filePath })로 그 경로의 운영 설정을 그대로 적용한다. 금지 fixture는 그 규칙이 보고해야 통과하고, 허용 fixture는 계층 규칙(no-restricted-imports·globals)이 아무것도 보고하지 않아야 통과한다. 목록에 없는 fixture 파일도 실패로 센다. - domain fixture는 domain 코드가 실제로 사는 src/features/*/domain 블록으로 검사한다(최상위 src/domain 폴더는 없다). - fixture 전용 ESLint 블록을 지운다. check-architecture.ts에서 쓰이지 않게 된 pnpm 하위 프로세스 실행과 npm_execpath 요구를 지운다. - 버린 대안: 금지 fixture 삭제. import 방향은 그래프가 지키지만 전역 금지의 검출이 0이 된다. 종료 코드만 보고 운영 경로로 옮기기. 다른 규칙(화면 문구 등)이 걸려도 거부로 센다. 위험·한계 - 계층 규칙 이름이 바뀌면 fixture 표의 rejectedBy도 같이 고쳐야 한다(고치지 않으면 실패로 드러난다). - 출력 문구가 "3 allowed PASS, 9 forbidden rejected by the production rule for their layer"로 바뀐다. 이 문구를 읽는 스크립트는 없다. 검증 - RED: 수정 전 변이 M2(운영 presentation 블록의 계층 import 금지와 fetch 금지 삭제)에서 check:architecture exit 0, "9 forbidden rejected". - 수정 뒤 같은 변이에서 check:architecture exit 1, presentation fixture 5개가 "was accepted"로 실패. 되돌린 뒤 exit 0. - 새 tests/unit/architecture-lint-fixtures.test.ts 3건(운영 설정 통과, overrideConfig로 규칙을 끄면 실패, 목록 밖 fixture 실패) 통과. architecture-report 3건 통과. check:types 통과, eslint 통과. Refs: docs/reviews/2026-11-03-maturity-review/12-guardrails-ci.md 12-04 --- eslint.config.ts | 24 --- scripts/check-architecture.ts | 86 ++------- scripts/lib/architecture-lint-fixtures.ts | 177 ++++++++++++++++++ tests/unit/architecture-lint-fixtures.test.ts | 67 +++++++ 4 files changed, 258 insertions(+), 96 deletions(-) create mode 100644 scripts/lib/architecture-lint-fixtures.ts create mode 100644 tests/unit/architecture-lint-fixtures.test.ts diff --git a/eslint.config.ts b/eslint.config.ts index 2e55d3c6..b5912fd1 100644 --- a/eslint.config.ts +++ b/eslint.config.ts @@ -934,30 +934,6 @@ export default [ "react-hooks/rules-of-hooks": "off", }, }, - { - files: [ - `tests/fixtures/architecture/forbidden/**/*.${sourceExtensions}`, - ], - rules: { - "no-restricted-imports": restrictedImports( - [ - "**/adapters/**", - "**/application/ports/out/**", - "@tanstack/**", - "react", - "react-dom", - "**/application/**", - ], - "forbidden architecture fixture: this import must be rejected.", - ), - "no-restricted-globals": [ - "error", - "fetch", - "localStorage", - "sessionStorage", - ], - }, - }, { files: [ `tests/fixtures/browser-file-storage-boundaries/forbidden/**/*.${sourceExtensions}`, diff --git a/scripts/check-architecture.ts b/scripts/check-architecture.ts index 2413162c..42405580 100644 --- a/scripts/check-architecture.ts +++ b/scripts/check-architecture.ts @@ -1,11 +1,13 @@ import { parseAsync } from "@babel/core"; -import { spawnSync } from "node:child_process"; import { mkdir, readFile, readdir } from "node:fs/promises"; import { dirname, extname, isAbsolute, relative, resolve, sep } from "node:path"; import { fileURLToPath, pathToFileURL } from "node:url"; import { createRequire } from "node:module"; +import { ESLint } from "eslint"; + import { architectureDependencyReportArtifactSchema } from "./contracts/release-artifacts.ts"; +import { checkArchitectureLintFixtures } from "./lib/architecture-lint-fixtures.ts"; import { formatArchitectureViolation } from "./lib/architecture-violation-message.ts"; import { writeValidatedJsonArtifact } from "./lib/validated-json-artifact.ts"; @@ -79,7 +81,6 @@ const architectureConfig = parseArchitectureConfig( const architectureRules = architectureConfig.forbidden; const sourceExtensionPattern = /\.(?:ts|tsx|mts|cts)$/u; const declarationExtensionPattern = /\.d\.(?:ts|mts|cts)$/u; -const lintFixtureExtensionPattern = sourceExtensionPattern; const forbiddenJavaScriptExtensionPattern = /\.(?:js|jsx|mjs|cjs)$/u; const forbiddenLocalJavaScriptSpecifierPattern = /\.(?:js|jsx|mjs|cjs)(?:[?#]|$)/u; @@ -89,13 +90,6 @@ const relativeSpecifierPattern = /^\.{1,2}(?:\/|$)/u; await mkdir(dirname(qualityArtifact), { recursive: true }); -const configuredPnpmCli = process.env.npm_execpath; - -if (!configuredPnpmCli) { - throw new Error("check:architecture must run through the pnpm script"); -} -const pnpmCli = configuredPnpmCli; - if ( (architectureConfig.allowed?.length ?? 0) > 0 || (architectureConfig.required?.length ?? 0) > 0 @@ -106,12 +100,6 @@ if ( } validateArchitectureRules(architectureRules); -function runPnpm(arguments_: string[]) { - return spawnSync(process.execPath, [pnpmCli, ...arguments_], { - encoding: "utf8", - }); -} - // 12-05 (D-11): this graph is the only architecture checker. dependency-cruiser // 18 cannot parse TypeScript 7, so it cruised zero modules and still passed. // .dependency-cruiser.json keeps its name and is read here as the rule file. @@ -211,68 +199,22 @@ process.stdout.write( `TypeScript-only source policy: PASS (${typeScriptOnlyPolicy.checkedRoots.join(", ")}; no fixture exceptions)\n`, ); -const allowed = runPnpm([ - "exec", - "eslint", - "tests/fixtures/architecture/allowed", - "--no-ignore", - "--max-warnings=0", -]); - -const forbidden = runPnpm([ - "exec", - "eslint", - "tests/fixtures/architecture/forbidden", - "--no-ignore", - "--max-warnings=0", -]); - -async function fixtureFiles(directory: string): Promise { - const entries = await readdir(directory, { withFileTypes: true }); - const files = await Promise.all( - entries.map((entry) => { - const target = `${directory}/${entry.name}`; - return entry.isDirectory() - ? fixtureFiles(target) - : lintFixtureExtensionPattern.test(entry.name) - ? [target] - : []; - }), - ); - return files.flat(); -} - -const forbiddenResults = await Promise.all( - (await fixtureFiles("tests/fixtures/architecture/forbidden")).map((file) => ({ - file, - result: runPnpm([ - "exec", - "eslint", - file, - "--no-ignore", - "--max-warnings=0", - ]), - })), -); -const acceptedForbidden = forbiddenResults.filter( - ({ result }) => result.status === 0, -); - -if ( - allowed.status !== 0 || - forbidden.status === 0 || - acceptedForbidden.length > 0 -) { - process.stderr.write(allowed.stderr || allowed.stdout); - process.stderr.write(forbidden.stderr || forbidden.stdout); - for (const { file } of acceptedForbidden) { - process.stderr.write(`Forbidden fixture was accepted: ${file}\n`); +// 1103/12-04. Each fixture is linted under the production configuration of +// the path it stands for, and a forbidden one must be reported by the rule it +// names (scripts/lib/architecture-lint-fixtures.ts). +const lintFixtures = await checkArchitectureLintFixtures({ + root: projectRoot, + linter: new ESLint({ cwd: projectRoot }), +}); +if (lintFixtures.failures.length > 0) { + for (const failure of lintFixtures.failures) { + process.stderr.write(`Architecture lint fixture: ${failure}\n`); } process.exit(1); } process.stdout.write( - `Architecture fixtures: allowed PASS, ${forbiddenResults.length} forbidden rejected\n`, + `Architecture fixtures: ${lintFixtures.allowed} allowed PASS, ${lintFixtures.forbidden} forbidden rejected by the production rule for their layer\n`, ); async function analyzeSourceGraph( diff --git a/scripts/lib/architecture-lint-fixtures.ts b/scripts/lib/architecture-lint-fixtures.ts new file mode 100644 index 00000000..f2570043 --- /dev/null +++ b/scripts/lib/architecture-lint-fixtures.ts @@ -0,0 +1,177 @@ +import { readdir, readFile } from "node:fs/promises"; +import path from "node:path"; + +/** + * 1103/12-04. The architecture lint fixtures are linted under the production + * configuration of the layer they stand for. + * + * They used to be linted where they live, under tests/, by an ESLint entry of + * their own that banned every layer's imports and globals at once, and a + * fixture counted as rejected whenever ESLint exited non-zero. Deleting the + * production rule for a layer therefore still left "9 forbidden rejected": + * presentation code could call `fetch` and the fixtures said it could not. + * + * Each fixture is now linted as if it were the file at `lintAs`, so exactly + * the production entries for that path apply, and a forbidden fixture passes + * only when the rule named in `rejectedBy` reports it. + */ +export type ArchitectureLintRule = "no-restricted-imports" | "no-restricted-globals"; + +export type ArchitectureLintFixture = Readonly<{ + /** Relative to tests/fixtures/architecture. */ + file: string; + /** The production path whose ESLint configuration the fixture is linted under. */ + lintAs: string; + /** For a forbidden fixture: the production rule that must reject it. */ + rejectedBy?: ArchitectureLintRule; +}>; + +export const ARCHITECTURE_LINT_FIXTURE_ROOT = "tests/fixtures/architecture"; + +const LAYER_RULES: ReadonlySet = new Set([ + "no-restricted-imports", + "no-restricted-globals", +]); + +const at = (layer: string, file: string) => + `${layer}/__architecture_fixture__/${path.posix.basename(file)}`; + +export const ARCHITECTURE_LINT_FIXTURES: readonly ArchitectureLintFixture[] = Object.freeze([ + ...[ + "allowed/bootstrap-composes-adapter.ts", + ].map((file) => ({ file, lintAs: at("src/bootstrap", file) })), + ...[ + "allowed/presentation-facade.ts", + "allowed/presentation-facade.tsx", + ].map((file) => ({ file, lintAs: at("src/presentation", file) })), + ...[ + "forbidden/application-imports-adapter.ts", + "forbidden/application-imports-tanstack.ts", + ].map((file) => ({ + file, + lintAs: at("src/application", file), + rejectedBy: "no-restricted-imports" as const, + })), + // Domain code lives inside features; src/features/*/domain is the entry + // that applies to it. + { + file: "forbidden/domain-imports-react.ts", + lintAs: "src/features/__architecture_fixture__/domain/domain-imports-react.ts", + rejectedBy: "no-restricted-imports", + }, + { + file: "forbidden/presentation-direct-fetch.tsx", + lintAs: at("src/presentation", "presentation-direct-fetch.tsx"), + rejectedBy: "no-restricted-globals", + }, + ...[ + "forbidden/presentation-imports-adapter.ts", + "forbidden/presentation-imports-adapter.tsx", + "forbidden/presentation-imports-output-port.tsx", + "forbidden/presentation-imports-tanstack.tsx", + ].map((file) => ({ + file, + lintAs: at("src/presentation", file), + rejectedBy: "no-restricted-imports" as const, + })), + { + file: "forbidden/template-imports-application.tsx", + lintAs: at("src/presentation/templates", "template-imports-application.tsx"), + rejectedBy: "no-restricted-imports", + }, +]); + +type LintMessage = Readonly<{ + ruleId: string | null; + message: string; + fatal?: boolean; + line?: number; +}>; + +export type ArchitectureLinter = Readonly<{ + lintText( + code: string, + options: Readonly<{ filePath: string; warnIgnored: boolean }>, + ): Promise[]>; +}>; + +export type ArchitectureLintFixtureResult = Readonly<{ + allowed: number; + forbidden: number; + failures: readonly string[]; +}>; + +const SOURCE_FILE = /\.(?:ts|tsx)$/u; + +async function filesBelow(root: string, directory: string): Promise { + const entries = await readdir(path.join(root, directory), { withFileTypes: true }); + const files = await Promise.all(entries.map((entry) => { + const relative = path.posix.join(directory, entry.name); + if (entry.isDirectory()) return filesBelow(root, relative); + return SOURCE_FILE.test(entry.name) ? [relative] : []; + })); + return files.flat(); +} + +export async function checkArchitectureLintFixtures(input: Readonly<{ + root: string; + linter: ArchitectureLinter; + fixtures?: readonly ArchitectureLintFixture[]; +}>): Promise { + const fixtures = input.fixtures ?? ARCHITECTURE_LINT_FIXTURES; + const failures: string[] = []; + const onDisk = new Set([ + ...await filesBelow(input.root, path.posix.join(ARCHITECTURE_LINT_FIXTURE_ROOT, "allowed")), + ...await filesBelow(input.root, path.posix.join(ARCHITECTURE_LINT_FIXTURE_ROOT, "forbidden")), + ].map((file) => path.posix.relative(ARCHITECTURE_LINT_FIXTURE_ROOT, file))); + const listed = new Set(fixtures.map(({ file }) => file)); + for (const file of [...onDisk].filter((candidate) => !listed.has(candidate)).sort()) { + failures.push(`${file}: not listed in ARCHITECTURE_LINT_FIXTURES, so nothing says what must reject it`); + } + for (const fixture of fixtures) { + const forbidden = fixture.file.startsWith("forbidden/"); + if (forbidden !== (fixture.rejectedBy !== undefined)) { + failures.push(`${fixture.file}: a forbidden fixture names its rule and an allowed one names none`); + continue; + } + if (!onDisk.has(fixture.file)) { + failures.push(`${fixture.file}: listed fixture does not exist`); + continue; + } + const code = await readFile( + path.join(input.root, ARCHITECTURE_LINT_FIXTURE_ROOT, fixture.file), + "utf8", + ); + const [result] = await input.linter.lintText(code, { + filePath: path.join(input.root, fixture.lintAs), + warnIgnored: true, + }); + const messages = result?.messages ?? []; + const unlinted = messages.filter((message) => message.fatal || message.ruleId === null); + if (unlinted.length > 0) { + failures.push( + `${fixture.file} (as ${fixture.lintAs}) was not linted: ${unlinted.map(({ message }) => message).join("; ")}`, + ); + continue; + } + const layerMessages = messages.filter(({ ruleId }) => ruleId !== null && LAYER_RULES.has(ruleId)); + if (fixture.rejectedBy !== undefined) { + if (!layerMessages.some(({ ruleId }) => ruleId === fixture.rejectedBy)) { + failures.push( + `${fixture.file} (as ${fixture.lintAs}) was accepted: the production ${fixture.rejectedBy} rule for that path no longer rejects it`, + ); + } + } else if (layerMessages.length > 0) { + failures.push( + `${fixture.file} (as ${fixture.lintAs}) was rejected: ${layerMessages + .map(({ ruleId, line, message }) => `${ruleId} at line ${line ?? "?"}: ${message}`) + .join("; ")}`, + ); + } + } + return Object.freeze({ + allowed: fixtures.filter(({ rejectedBy }) => rejectedBy === undefined).length, + forbidden: fixtures.filter(({ rejectedBy }) => rejectedBy !== undefined).length, + failures: Object.freeze(failures), + }); +} diff --git a/tests/unit/architecture-lint-fixtures.test.ts b/tests/unit/architecture-lint-fixtures.test.ts new file mode 100644 index 00000000..0c37b46d --- /dev/null +++ b/tests/unit/architecture-lint-fixtures.test.ts @@ -0,0 +1,67 @@ +import { cp, mkdtemp, rm, writeFile } from "node:fs/promises"; +import { tmpdir } from "node:os"; +import path from "node:path"; + +import { ESLint } from "eslint"; +import { afterEach, describe, expect, it } from "vitest"; + +import { + ARCHITECTURE_LINT_FIXTURE_ROOT, + checkArchitectureLintFixtures, +} from "../../scripts/lib/architecture-lint-fixtures.ts"; + +const roots: string[] = []; + +afterEach(async () => { + await Promise.all(roots.splice(0).map((root) => rm(root, { recursive: true, force: true }))); +}); + +// 1103/12-04. The fixtures used to be linted under an ESLint entry of their +// own, so deleting a production layer rule still left them "rejected". +describe("architecture lint fixtures", () => { + it("are rejected by the production rules for their layer, and only the forbidden ones", async () => { + const result = await checkArchitectureLintFixtures({ + root: process.cwd(), + linter: new ESLint({ cwd: process.cwd() }), + }); + expect(result).toEqual({ allowed: 3, forbidden: 9, failures: [] }); + }, 30_000); + + it("fail when the production presentation rules lose their layer bans", async () => { + const result = await checkArchitectureLintFixtures({ + root: process.cwd(), + linter: new ESLint({ + cwd: process.cwd(), + overrideConfig: [{ + files: ["src/presentation/**/*.{ts,tsx}"], + rules: { "no-restricted-globals": "off", "no-restricted-imports": "off" }, + }], + }), + }); + expect(result.failures).toEqual(expect.arrayContaining([ + expect.stringContaining("forbidden/presentation-direct-fetch.tsx (as src/presentation/"), + expect.stringContaining("forbidden/presentation-imports-adapter.ts (as src/presentation/"), + expect.stringContaining("forbidden/template-imports-application.tsx (as src/presentation/templates/"), + ])); + expect(result.failures.join("\n")).not.toMatch(/application-imports|domain-imports/u); + }, 30_000); + + it("fail for a fixture nobody says what must reject", async () => { + const root = await mkdtemp(path.join(tmpdir(), "architecture-lint-fixtures-")); + roots.push(root); + await cp(ARCHITECTURE_LINT_FIXTURE_ROOT, path.join(root, ARCHITECTURE_LINT_FIXTURE_ROOT), { + recursive: true, + }); + await writeFile( + path.join(root, ARCHITECTURE_LINT_FIXTURE_ROOT, "forbidden/unlisted.ts"), + "export const unlisted = true;\n", + ); + const result = await checkArchitectureLintFixtures({ + root, + linter: { lintText: async () => [{ messages: [{ ruleId: "no-restricted-imports", message: "x" }] }] }, + }); + expect(result.failures).toContain( + "forbidden/unlisted.ts: not listed in ARCHITECTURE_LINT_FIXTURES, so nothing says what must reject it", + ); + }); +}); From b4e4f98c03f1e94d191efb484b00138de9714eae Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Wed, 4 Nov 2026 21:15:03 +0900 Subject: [PATCH 12/22] =?UTF-8?q?fix(docs):=20=EB=AC=B8=EC=84=9C=20?= =?UTF-8?q?=EA=B2=80=EC=82=AC=EA=B0=80=20=EB=AA=85=EB=A0=B9=20=EC=95=88=20?= =?UTF-8?q?=EA=B2=BD=EB=A1=9C=EC=99=80=20=EC=A7=9D=20=EC=A0=80=EC=9E=A5?= =?UTF-8?q?=EC=86=8C=20=EC=B0=B8=EC=A1=B0=EB=A5=BC=20=EB=B3=B8=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제 verify:documentation(FE-GATE-017)은 공백 없는 backtick 경로만 본다. 그래서 `corepack pnpm exec vitest run tests/…` 같은 명령 안의 경로, 셸 코드 블록의 명령, 저장소 밖(`../`) 링크는 확인하지 않았다. 실제로 원장 docs/operations/adapter-remediation-ledger.md의 N-06~N-08 행이 V2와 함께 지운 테스트 세 개를 실행하라고 적고 있었다. 짝 백엔드 정본 링크가 깨져도 알 수 없었다. config/ci/ungated-scripts.json의 check:remediation-ledger 사유는 "It passes at this commit"이라는 시점 문장을 담았다. 고른 방법 - 인라인 코드와 셸 코드 블록(```bash/sh/shell/console/zsh, 언어 없음)에서 명령(corepack, pnpm, npx, node, vitest, playwright, tsc, eslint, bash, sh)의 인자를 같은 경로 규칙으로 본다. 앞의 NAME=value는 건너뛰고, --flag=value는 값만 본다. 자리표시자(, glob, $VAR)는 기존 규칙대로 경로로 보지 않는다. - 짝 백엔드 템플릿(clean-architecture-backend-template)을 가리키는 backtick 경로와 저장소 밖 링크는 문서를 읽는 checkout 옆에서 찾는다. 그 checkout이 있으면 없는 경로는 실패다. 없으면(CI, 중첩 worktree) 실패 대신 "not verified"로 출력하고 보고서 documentReferences[].unverifiedLinks에 남긴다. 보고서 schema에 그 칸을 더했다. - 원장 N-06~N-08 행의 명령을 LEG-01 행처럼 "V2와 함께 지움"으로 바꾸고, ungated 사유에서 시점 문장을 지웠다. docs/README.md 1절의 검사 범위 설명을 고쳤다. - 버린 대안: 지운 심볼 이름 검사. 지운 이름 목록을 따로 관리해야 하고 오탐이 많다(리뷰 5.2절). 1절 밖 문서로 대상 넓히기. 기록 문서가 일부러 옛 경로를 적어 예외가 늘어난다. 위험·한계 - 명령 머리 목록에 없는 명령(git, curl 등)의 인자는 여전히 보지 않는다. - 짝 저장소 참조는 CI에서 늘 "not verified"다. 실제 확인은 옆에 checkout이 있는 개발 환경에서만 된다. - 1절 밖 문서(testing strategy :765, VD-23)는 그대로 검사 밖이다. 검증 - RED: 새 테스트 4건(인라인 명령, 셸 블록, 짝 저장소 있음·깨짐, 짝 저장소 없음 보고) 실패. - 수정 뒤 documentation-readiness 19건 통과. 저장소에서 수정 전 원장 행 3개가 "names paths that do not exist"로 잡혔고, 행을 고친 뒤 verify:documentation PASS_SCOPED(worktree라 짝 저장소 참조 3건은 not verified). check:remediation-ledger PASS, check:ci PASS, check:types 통과, eslint 통과. Refs: docs/reviews/2026-11-03-maturity-review/12-guardrails-ci.md 12-05 --- config/ci/ungated-scripts.json | 2 +- docs/README.md | 5 +- docs/operations/adapter-remediation-ledger.md | 6 +- scripts/contracts/release-artifacts.ts | 3 + scripts/verify-documentation-readiness.ts | 87 +++++++++++++++++-- tests/unit/documentation-readiness.test.ts | 78 +++++++++++++++-- 6 files changed, 164 insertions(+), 17 deletions(-) diff --git a/config/ci/ungated-scripts.json b/config/ci/ungated-scripts.json index 5abf98f9..ba1fa878 100644 --- a/config/ci/ungated-scripts.json +++ b/config/ci/ungated-scripts.json @@ -15,7 +15,7 @@ }, { "script": "check:remediation-ledger", - "reason": "Checks the prose ledger of the 2026-08-14 adapter re-review (docs/operations/adapter-remediation-ledger.md) against test-file markers and the file-transfer bundle budget. It passes at this commit, but it is a history record run by hand, not a current contract: it fails when a product removes the optional file-transfer recipe or when a test split moves a marked test to another file, and neither should block a merge. Run it after moving those tests or changing that budget, and point the ledger rows at the new files." + "reason": "Checks the prose ledger of the 2026-08-14 adapter re-review (docs/operations/adapter-remediation-ledger.md) against test-file markers and the file-transfer bundle budget. It is a history record run by hand, not a current contract: it fails when a product removes the optional file-transfer recipe or when a test split moves a marked test to another file, and neither should block a merge. Run it after moving those tests or changing that budget, and point the ledger rows at the new files." }, { "script": "check:scale:baseline", diff --git a/docs/README.md b/docs/README.md index 507dd42c..0f4e7499 100644 --- a/docs/README.md +++ b/docs/README.md @@ -40,7 +40,10 @@ README와 입구 문서는 영어, recipe·ledger·스타일 문서는 한국어 - 버전별 변경: [`../CHANGELOG.md`](../CHANGELOG.md) `verify:documentation`은 이 파일과 이 절에서 링크한 문서(폴더 링크는 그 안의 `.md` 전부)에 -적힌 repo 경로·링크·package script·FE-GATE ID가 실제로 있는지 검사한다. `CHANGELOG.md`는 +적힌 repo 경로·링크·package script·FE-GATE ID가 실제로 있는지 검사한다. 명령(인라인 코드와 +셸 코드 블록) 안의 경로 인자도 본다. 짝 백엔드 템플릿(`clean-architecture-backend-template`)의 +경로와 링크는 그 checkout이 이 checkout 옆에 있을 때만 확인하고, 없으면 실패 대신 확인하지 +못한 것으로 출력과 `artifacts/quality/documentation-review.json`에 남긴다. `CHANGELOG.md`는 지난 상태를 적는 문서라 빼고, git이 무시하는 생성 산출물과 복사한 프로젝트가 지운 작업 이력은 없어도 된다. 설명·수치가 코드와 맞는지는 검사하지 않는다. 규칙과 예외의 정본은 `scripts/verify-documentation-readiness.ts`다. diff --git a/docs/operations/adapter-remediation-ledger.md b/docs/operations/adapter-remediation-ledger.md index 9f20bab4..28ebfd81 100644 --- a/docs/operations/adapter-remediation-ledger.md +++ b/docs/operations/adapter-remediation-ledger.md @@ -88,9 +88,9 @@ Rollout state starts at `NOT_STARTED`; documented-unimplemented items start at | N-03 | Live V3 path | `corepack pnpm exec vitest run tests/unit/http-execution-v3.test.ts -t "retry-time fence"` | `fix: preserve command effect certainty across retries` | `FIXED_NOT_RELEASED` | command effect verdict regression | Red reproduced `SCOPE_FENCED` with `NOT_STARTED` after one dispatched attempt → green `MAYBE_APPLIED`; lattice table 9/9; `check:types` PASS; `lint` PASS | | N-04 | Live composition teardown | `corepack pnpm exec vitest run tests/unit/telemetry.test.ts tests/unit/runtime-adapters.test.ts` | `fix: terminate telemetry work on disposal` | `FIXED_NOT_RELEASED` | telemetry delivery loss after teardown change | Red 10 failed (5 lifecycle + 5 capacity) → green 34/34; `check:diagnostics` PASS; `check:types` PASS; `check:architecture` PASS; `lint` PASS | | N-05 | Rollout blocker (sidecar not composed) | `corepack pnpm exec vitest run tests/unit/conditional-validator-store.test.ts` | `fix: harden bounded state sidecars` | `FIXED_NOT_RELEASED` | persisted validator key incompatibility | Red collision case (two valid bindings sharing one delimiter-joined key) → green; key is now a bounded validated tuple encoded with `JSON.stringify` | -| N-06 | Legacy V2 rollback seam | `corepack pnpm exec vitest run tests/integration/http-client.test.ts` | `fix: harden the legacy HTTP rollback path` | `FIXED_NOT_RELEASED` | legacy keyed command rejection spike | Red 4 invalid-key cases → green; rejection happens before credentials and fetch (0 credential calls, 0 fetches) | -| N-07 | Legacy V2 rollback seam | `corepack pnpm exec vitest run tests/integration/http-client.test.ts tests/integration/auth-recovery.test.ts` | `fix: harden the legacy HTTP rollback path` | `FIXED_NOT_RELEASED` | legacy credential timeout regression | Red never-settling owner → green; credential wait races the existing attempt controller so no extra timer is added; ownership maps to REQUEST_TIMEOUT / REQUEST_ABORTED / AUTH_INTEGRATION_FAILURE with zero fetches | -| N-08 | Legacy V2 rollback seam | `corepack pnpm exec vitest run tests/unit/bounded-json-compatibility.test.ts` | `fix: harden the legacy HTTP rollback path` | `FIXED_NOT_RELEASED` | legacy JSON failure-code drift | Green 7/7 including throwing cancel/releaseLock; `readBoundedJson` now delegates to `bounded-body-reader` with the legacy codes preserved | +| N-06 | Legacy V2 rollback seam | The V2 client test tests/integration/http-client.test.ts (deleted with the V2 client on 2026-11-03) | `fix: harden the legacy HTTP rollback path` | `FIXED_NOT_RELEASED` | legacy keyed command rejection spike | Red 4 invalid-key cases → green; rejection happens before credentials and fetch (0 credential calls, 0 fetches) | +| N-07 | Legacy V2 rollback seam | The V2 client tests tests/integration/http-client.test.ts and tests/integration/auth-recovery.test.ts (deleted with the V2 client on 2026-11-03) | `fix: harden the legacy HTTP rollback path` | `FIXED_NOT_RELEASED` | legacy credential timeout regression | Red never-settling owner → green; credential wait races the existing attempt controller so no extra timer is added; ownership maps to REQUEST_TIMEOUT / REQUEST_ABORTED / AUTH_INTEGRATION_FAILURE with zero fetches | +| N-08 | Legacy V2 rollback seam | The V2 bounded JSON test tests/unit/bounded-json-compatibility.test.ts (deleted with the V2 client on 2026-11-03) | `fix: harden the legacy HTTP rollback path` | `FIXED_NOT_RELEASED` | legacy JSON failure-code drift | Green 7/7 including throwing cancel/releaseLock; `readBoundedJson` now delegates to `bounded-body-reader` with the legacy codes preserved | | N-09 | Live cross-context host | `corepack pnpm exec vitest run tests/unit/cross-tab-invalidation.test.ts` | `fix: harden bounded state sidecars` | `FIXED_NOT_RELEASED` | cross-tab invalidation drop | Red foreign-area pulse accepted → green 13/13; localStorage captured once and `StorageEvent.storageArea` compared by object identity; pulse key registered as `CACHE_INVALIDATION_PULSE`; `check:registries` PASS | | N-10 | Cursor runtime `AVAILABLE_NOT_COMPOSED` | `corepack pnpm exec vitest run tests/unit/cursor-pagination-runtime.test.ts` | `fix: harden bounded state sidecars` | `FIXED_NOT_RELEASED` | pagination abort semantics change | Red never-settling loader → green `PAGINATION_ABORTED` with the late page ignored | | N-11 | Live composition | `corepack pnpm exec vitest run tests/unit/telemetry.test.ts -t capacity` | `fix: terminate telemetry work on disposal` | `FIXED_NOT_RELEASED` | capacity rejection on valid composition | Red 5/5 capacity cases → green; ceilings documented in VD-07 §7-4 | diff --git a/scripts/contracts/release-artifacts.ts b/scripts/contracts/release-artifacts.ts index d70ed79a..367140d3 100644 --- a/scripts/contracts/release-artifacts.ts +++ b/scripts/contracts/release-artifacts.ts @@ -1428,6 +1428,9 @@ export const documentationReviewArtifactSchema = z .object({ path: nonEmptyString, missingPaths: z.array(nonEmptyString), + // 1103/12-05. References into a paired repository that is not + // checked out beside this one. Reported, not failed. + unverifiedLinks: z.array(nonEmptyString), missingScripts: z.array(nonEmptyString), unknownGateIds: z.array(nonEmptyString), }) diff --git a/scripts/verify-documentation-readiness.ts b/scripts/verify-documentation-readiness.ts index 0165ec7e..18fbcd9a 100644 --- a/scripts/verify-documentation-readiness.ts +++ b/scripts/verify-documentation-readiness.ts @@ -1,6 +1,6 @@ import { existsSync } from "node:fs"; import { mkdir, readdir, readFile } from "node:fs/promises"; -import { dirname, join, matchesGlob, normalize } from "node:path/posix"; +import { dirname, join, matchesGlob, normalize, resolve } from "node:path/posix"; import { fileURLToPath } from "node:url"; import { RETIRED_GATE_IDS } from "./contracts/ci-gates.ts"; @@ -207,21 +207,62 @@ const deletedHistory = [ .flatMap(([, cell = ""]) => [...cell.matchAll(/`([^`]+)`/gu)].map(([, entry = ""]) => entry.replace(/\/$/u, ""))) .filter((entry) => !exists(entry)); -// A backtick span is a path when it starts at a top-level entry or at an -// entry beside the document; line numbers and anchors are dropped. +// 1103/12-05. The paired templates a document may name (`/docs/…`) or +// link (`../../..//…`). They are looked up beside the checkout the +// documents are read from; where none is checked out (CI, a nested worktree) +// the reference is reported as not verified instead of passing silently. +const SIBLING_REPOSITORIES = new Set(["clean-architecture-backend-template"]); +const siblingsRoot = resolve(process.cwd(), ".."); + +// A backtick span is a path when it starts at a top-level entry, at an entry +// beside the document or at a paired repository; line numbers and anchors are +// dropped. A path into a paired repository is returned relative to this one +// (`..//…`). function namedPath(token: string, document: string): string | null { const candidate = token.replace(/#.*$/u, "").replace(/:\d[\d,:-]*$/u, ""); if (!candidate.includes("/") || candidate.startsWith("/") || /[\s*<>{}$()|]|\.\.\./u.test(candidate)) return null; const first = candidate.split("/")[0] ?? ""; if (topLevelEntries.has(first)) return candidate; + if (SIBLING_REPOSITORIES.has(first)) return `../${candidate}`; return first !== "." && first !== ".." && exists(join(dirname(document), first)) ? join(dirname(document), candidate) : null; } +// A link that leaves the repository is kept (`../…`); the caller looks it up +// beside the checkout. function linkedPath(target: string, document: string): string | null { if (/^(?:[a-z][a-z+.-]*:|#)/iu.test(target)) return null; - const resolved = normalize(join(dirname(document), target.replace(/#.*$/u, ""))); - return resolved.startsWith("../") ? null : resolved; + return normalize(join(dirname(document), target.replace(/#.*$/u, ""))); +} +// 1103/12-05. A command span is not a path, so the paths it takes as +// arguments (`corepack pnpm exec vitest run tests/…`, `node scripts/…`) were +// never looked up. Leading `NAME=value` assignments are skipped, a +// `--flag=value` argument is read as its value, and placeholders (``, +// globs, `$VAR`) are left alone by namedPath. +const COMMAND_HEADS = new Set(["corepack", "pnpm", "npx", "node", "vitest", "playwright", "tsc", "eslint", "bash", "sh"]); +function commandPaths(command: string, document: string): (string | null)[] { + const words = command.trim().replace(/^\$\s+/u, "").split(/\s+/u); + let head = 0; + while (/^[A-Z_][A-Z0-9_]*=/u.test(words[head] ?? "")) head += 1; + if (!COMMAND_HEADS.has(words[head] ?? "")) return []; + return words + .slice(head + 1) + .map((word) => namedPath(word.replace(/^--?[\w.-]+=/u, "").replace(/^["']|["']$/gu, ""), document)); +} +// Lines of fenced shell blocks (```bash, ```sh, ```shell, ```console or no +// language), which is where most documented commands are. +function fencedCommands(text: string): string[] { + const commands: string[] = []; + let fence: string | null = null; + for (const line of text.split("\n")) { + const marker = /^\s*```(\w*)/u.exec(line); + if (marker) { + fence = fence === null ? (marker[1] ?? "") : null; + continue; + } + if (fence !== null && /^(?:bash|sh|shell|console|zsh)?$/u.test(fence)) commands.push(line); + } + return commands; } const index = await readFile(DOCUMENT_INDEX, "utf8").catch(() => ""); @@ -239,18 +280,42 @@ for (const document of contractDocuments) { if (text === null) { // A linked document that is gone is reported as the index's broken link. if (document === DOCUMENT_INDEX) { - documentReferences.push({ path: document, missingPaths: [document], missingScripts: [], unknownGateIds: [] }); + documentReferences.push({ + path: document, + missingPaths: [document], + unverifiedLinks: [], + missingScripts: [], + unknownGateIds: [], + }); } continue; } const named = [ - ...[...text.matchAll(/`([^`\n]+)`/gu)].map(([, token = ""]) => namedPath(token, document)), + ...[...text.matchAll(/`([^`\n]+)`/gu)].flatMap(([, token = ""]) => [ + namedPath(token, document), + ...commandPaths(token, document), + ]), + ...fencedCommands(text).flatMap((command) => commandPaths(command, document)), ...[...text.matchAll(/\]\(([^)\s]+)\)/gu)].map(([, target = ""]) => linkedPath(target, document)), ]; const missingPaths = new Set(); + const unverifiedLinks = new Set(); for (const file of named) { if (file === null) continue; const trimmed = file.replace(/\/$/u, ""); + if (trimmed.startsWith("../")) { + // Outside this repository: the first folder past the `..` steps is the + // paired checkout. Without it the reference cannot be checked here. + const segments = trimmed.split("/"); + const checkout = segments.slice(0, segments.findIndex((segment) => segment !== "..") + 1).join("/"); + const relativeToSiblings = trimmed.replace(/^\.\.\//u, ""); + if (!existsSync(resolve(siblingsRoot, checkout.replace(/^\.\.\//u, "")))) { + unverifiedLinks.add(trimmed); + } else if (!existsSync(resolve(siblingsRoot, relativeToSiblings))) { + missingPaths.add(trimmed); + } + continue; + } if ( !exists(trimmed) && !NOT_CREATED.has(trimmed) && @@ -270,6 +335,7 @@ for (const document of contractDocuments) { documentReferences.push({ path: document, missingPaths: [...missingPaths].sort(), + unverifiedLinks: [...unverifiedLinks].sort(), missingScripts: [...missingScripts].sort(), unknownGateIds: [...new Set([...text.matchAll(/\bFE-GATE-\d+\b/gu)].map(([id]) => id))] .filter((id) => !gateIds.has(id)) @@ -370,4 +436,11 @@ if (!passed) { ); process.exit(1); } +const unverified = documentReferences.flatMap((entry) => entry.unverifiedLinks); +if (unverified.length > 0) { + process.stdout.write( + `Documentation readiness: ${unverified.length} reference(s) into paired repositories not verified ` + + `(no checkout beside ${process.cwd()}): ${[...new Set(unverified)].join(", ")}\n`, + ); +} process.stdout.write("Documentation readiness: PASS_SCOPED\n"); diff --git a/tests/unit/documentation-readiness.test.ts b/tests/unit/documentation-readiness.test.ts index f639b9aa..d5962b37 100644 --- a/tests/unit/documentation-readiness.test.ts +++ b/tests/unit/documentation-readiness.test.ts @@ -1,5 +1,5 @@ import { spawnSync } from "node:child_process"; -import { cp, mkdtemp, readFile, rm, writeFile } from "node:fs/promises"; +import { cp, mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises"; import { tmpdir } from "node:os"; import path from "node:path"; @@ -10,26 +10,38 @@ const INPUTS = ["README.md", "docs", "artifacts/tests/a11y-manual"]; /** * Runs verify:documentation on a copy of its inputs, each `changes` entry * applied to its document and every `removed` file deleted. Code facts (src, - * package.json, gates.json) are read from this repository, not the copy. + * package.json, gates.json) are read from this repository, not the copy. The + * copy is a `frontend` folder; `siblings` are files written beside it, where a + * checkout of the paired repositories would be. */ async function verify( changes: Readonly string>>, removed: readonly string[] = [], + siblings: Readonly> = {}, ) { - const root = await mkdtemp(path.join(tmpdir(), "documentation-readiness-")); + const parent = await mkdtemp(path.join(tmpdir(), "documentation-readiness-")); + const root = path.join(parent, "frontend"); try { + for (const [file, content] of Object.entries(siblings)) { + await mkdir(path.dirname(path.join(parent, file)), { recursive: true }); + await writeFile(path.join(parent, file), content); + } for (const input of INPUTS) await cp(input, path.join(root, input), { recursive: true }); for (const [document, mutate] of Object.entries(changes)) { const target = path.join(root, document); await writeFile(target, mutate(await readFile(target, "utf8"))); } for (const file of removed) await rm(path.join(root, file)); - return spawnSync(process.execPath, [path.resolve("scripts/verify-documentation-readiness.ts")], { + const result = spawnSync(process.execPath, [path.resolve("scripts/verify-documentation-readiness.ts")], { cwd: root, encoding: "utf8", }); + const report = await readFile(path.join(root, "artifacts/quality/documentation-review.json"), "utf8") + .then((json) => JSON.parse(json) as { documentReferences: { path: string; unverifiedLinks?: string[] }[] }) + .catch(() => null); + return { ...result, report }; } finally { - await rm(root, { recursive: true, force: true }); + await rm(parent, { recursive: true, force: true }); } } @@ -128,6 +140,62 @@ describe("verify:documentation current contract documents (1101/14-05)", () => { }); }); +// 1103/12-05. Paths inside a command and links into the paired repositories +// were never looked up: a deleted V2 test stayed in a `vitest run` command, +// and a broken link to the backend template's contract passed. +describe("verify:documentation commands and sibling links (1103/12-05)", () => { + const CI_DOC = "docs/operations/ci-quality-gates.md"; + const BACKEND = "clean-architecture-backend-template/docs/web/http-contract.md"; + + it.each([ + ["an inline command", "`corepack pnpm exec vitest run tests/integration/no-such-client.test.ts`"], + ["a shell block", "```bash\nnode tests/integration/no-such-client.test.ts --flag\n```"], + ])("fails when %s names a path that does not exist", async (_shape, line) => { + const result = await verify({ [CI_DOC]: (text) => `${text}\n${line}\n` }); + expect(result.status).toBe(1); + expect(result.stderr).toContain(`${CI_DOC} names paths that do not exist: tests/integration/no-such-client.test.ts`); + }); + + it("looks up a command's existing arguments and leaves placeholders alone", async () => { + const result = await verify({ + [CI_DOC]: (text) => `${text}\n\`corepack pnpm exec vitest run tests/unit/documentation-readiness.test.ts -t "x"\`\n` + + "```bash\ncorepack pnpm drill:runbook -- FE-RB-005 --release-root \n```\n", + }); + expect(result.status, result.stderr).toBe(0); + }); + + it("checks a link or a path into a paired repository checked out beside this one", async () => { + const naming = (target: string) => (text: string) => + `${text}\n[contract](../../../${target}) and \`${target}\`\n`; + const present = await verify( + { [CI_DOC]: naming(BACKEND) }, + [], + { [BACKEND]: "# contract\n" }, + ); + expect(present.status, present.stderr).toBe(0); + + const broken = await verify( + { [CI_DOC]: naming("clean-architecture-backend-template/docs/web/no-such.md") }, + [], + { [BACKEND]: "# contract\n" }, + ); + expect(broken.status).toBe(1); + expect(broken.stderr).toContain( + `${CI_DOC} names paths that do not exist: ../clean-architecture-backend-template/docs/web/no-such.md`, + ); + }); + + it("reports a link into a paired repository that is not checked out as unverified", async () => { + const result = await verify({ + [CI_DOC]: (text) => `${text}\n[contract](../../../clean-architecture-backend-template/docs/web/no-such.md)\n`, + }); + expect(result.status, result.stderr).toBe(0); + expect(result.stdout).toContain("not verified"); + expect(result.report?.documentReferences.find((entry) => entry.path === CI_DOC)?.unverifiedLinks) + .toEqual(["../clean-architecture-backend-template/docs/web/no-such.md"]); + }); +}); + // 1101/14-03. The entry documents drew a top-level domain layer that does not // exist, left out three of the nine src folders, and layers.md named a // minority of the architecture rules while claiming it could not drift. From e1b4e2880d14bdc6ce82a1ac493567f1a39a34d3 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Wed, 4 Nov 2026 21:20:04 +0900 Subject: [PATCH 13/22] =?UTF-8?q?fix(scaffold):=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1=20=EB=93=9C=EB=A6=B4=EC=9D=B4=20merge=20?= =?UTF-8?q?=EB=8B=A8=EA=B3=84=20=EB=AA=85=EB=A0=B9=EC=9D=84=20gates.json?= =?UTF-8?q?=EC=97=90=EC=84=9C=20=EB=BD=91=EC=95=84=20=EB=8F=88=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제 create:feature는 "모든 merge 게이트를 통과하는 가장 작은 기능"을 만든다고 적고, test:feature-scaffold(FE-GATE-020)가 그 주장을 지키는 유일한 드릴이다. 그런데 드릴은 손으로 적은 15개 명령만 돌았고 merge 단계는 명령 참조가 88개다. 그 범위 밖(시각 회귀, a11y, 번들, 계약·스키마·시나리오 테스트 등)에서 생성 기능을 깨는 템플릿 변경이 생겨도 FE-GATE-020은 통과했다(12-01·12-03이 실제로 그렇게 생겼다). 또 제품 기능 제거 드릴 (test:sample-removal -- --feature=)은 어떤 게이트도 돌지 않아, 빈 사유 결함(16-02)이 드러나지 않았다. 고른 방법 - 새 scripts/lib/feature-scaffold-drill.ts가 fixture의 config/ci/gates.json merge 단계를 단계 순서대로, 명령마다 한 번 뽑는다. 음성 fixture 명령은 run-ci-gate.ts처럼 등록된 종료 코드와 진단 ID로 판정한다. - 돌지 않는 명령은 SCAFFOLD_DRILL_EXCLUDED_SCRIPTS에 이유와 함께 둔다: 브라우저 명령 7개(FE-GATE-020 job에 브라우저가 없다. merge_gate matrix browser: false), test:system(bubblewrap·systemd·cgroup 필요, 기능과 무관한 provider 샌드박스 검사), verify:lockfile(연결한 node_modules에 install한다), 제거 드릴 5개(저장소를 다시 복사한다. 이 드릴 자신 포함). merge 단계에 없는 스크립트를 제외 목록에 두면 실패한다. - 생성 기능을 merge 명령 뒤에 test:sample-removal -- --feature=scaffold-feature로 다시 지운다(16-02 둘째 절반). - 생성 명령의 주석·Next 출력과 매뉴얼 두 곳의 주장을 실제 범위로 고쳤다. - 버린 대안: 손 목록에 빠진 명령 더하기. 다음 merge 명령이 다시 빠진다. 복사본 에서 브라우저 게이트까지 전부(리뷰 5.1 (d)). 드릴 job에 브라우저가 없고 수십 분이 든다. 생성 경로만 도는 chromium a11y·시각 1회(5.1 (c)). 12-01·12-03을 고치는 다른 작업이 진행 중이라 지금 넣으면 그 수정 전까지 드릴이 실패한다. 그 둘이 들어오면 제외 목록에서 빼는 것을 다시 본다. 위험·한계 - 드릴 시간이 크게 는다(빌드·release candidate·coverage·제거 드릴 한 번). FE-GATE-020 job(45분)의 임계 경로를 넘으면 리뷰 5.1 재검토 조건대로 줄인다. tests/unit이 한 merge에서 도는 횟수(1101/10-06)도 는다. - 이 커밋 메시지에는 드릴 전체 실행 결과를 적지 않았다(공유 잠금 대기). 검증 - RED: 새 tests/unit/feature-scaffold-drill.test.ts의 "is what test:feature-scaffold runs"가 수정 전 실패. - 수정 뒤 feature-scaffold-drill 5건(merge 명령 전부가 실행 또는 제외, 음성 fixture 기대 유지, merge 단계에 명령을 더하면 드릴이 돈다, 낡은 제외 거부, 드릴이 이 목록을 씀), create-feature, removal-fixture 합계 43건 통과. verify:documentation PASS_SCOPED, check:types 통과, eslint 통과. Refs: docs/reviews/2026-11-03-maturity-review/12-guardrails-ci.md 12-02 Refs: docs/reviews/2026-11-03-maturity-review/16-structure-patterns.md 16-02 --- docs/manual/README.md | 2 +- docs/manual/reference/create-feature.md | 5 +- scripts/create-feature.ts | 9 +- scripts/lib/feature-scaffold-drill.ts | 139 ++++++++++++++++++++++ scripts/test-feature-scaffold.ts | 37 +++--- tests/unit/feature-scaffold-drill.test.ts | 65 ++++++++++ 6 files changed, 233 insertions(+), 24 deletions(-) create mode 100644 scripts/lib/feature-scaffold-drill.ts create mode 100644 tests/unit/feature-scaffold-drill.test.ts diff --git a/docs/manual/README.md b/docs/manual/README.md index 5c61e1be..f67ddd6c 100644 --- a/docs/manual/README.md +++ b/docs/manual/README.md @@ -3,7 +3,7 @@ 이 폴더는 이 템플릿으로 만든 프로젝트에 **새 기능 하나를 추가하는 절차**를 적는다. 기능 하나는 화면(라우트와 페이지)과 그 화면이 쓰는 API 호출을 함께 뜻한다. -시작은 `corepack pnpm create:feature `다. 이 명령이 모든 merge 게이트를 통과하는 가장 작은 기능을 만든다. +시작은 `corepack pnpm create:feature `다. 이 명령이 모든 merge 게이트를 통과하도록 만든 가장 작은 기능을 만든다(브라우저 게이트는 드릴 밖, `docs/manual/reference/create-feature.md`). 그 뒤 이 매뉴얼의 단계대로 뼈대를 실제 기능으로 바꾼다. ## 누가 읽는가 diff --git a/docs/manual/reference/create-feature.md b/docs/manual/reference/create-feature.md index 5321f33e..0824a0dd 100644 --- a/docs/manual/reference/create-feature.md +++ b/docs/manual/reference/create-feature.md @@ -1,6 +1,7 @@ # create:feature 참조 -모든 merge 게이트를 통과하는 가장 작은 기능을 만드는 명령이다. 정본은 `scripts/create-feature.ts`다. +모든 merge 게이트를 통과하도록 만든 가장 작은 기능을 만드는 명령이다. 정본은 `scripts/create-feature.ts`다. +`test:feature-scaffold`가 생성한 기능으로 `config/ci/gates.json`의 merge 단계 명령을 돌려 확인한다. 브라우저 게이트(FE-GATE-008·009의 브라우저 명령)와 `test:system`은 빼고 돈다. 뺀 명령과 이유는 `scripts/lib/feature-scaffold-drill.ts`에 있다. 템플릿 문자열이 그 파일 안에 있고, 참조 기능을 import하지 않는다. 그래서 참조 기능을 지운 프로젝트에서도 동작한다. ## 사용법 @@ -98,7 +99,7 @@ create:feature: in (new context), route at Next: 1. Before a release, have a person review and sign artifacts/tests/a11y-manual/.md (FE-GATE-028). ... - 2. Run the merge gates: corepack pnpm check:types, lint, ... + 2. Run the merge gates: corepack pnpm ci:gate -- FE-GATE- for each gate of the merge stage ... The feature's own tests: node scripts/run-vitest.ts run tests/features/ ... The registry baseline does not change: ... ``` diff --git a/scripts/create-feature.ts b/scripts/create-feature.ts index b035bbf1..e2f7a100 100644 --- a/scripts/create-feature.ts +++ b/scripts/create-feature.ts @@ -13,8 +13,11 @@ import { import { createFileSystemDeclarationSource } from "./generate-product-feature-index.ts"; /** - * U7. `pnpm create:feature ` writes the smallest feature that passes every - * merge gate: one list route without params, one GET (SAFE, EXTERNAL_BEARER), + * U7. `pnpm create:feature ` writes the smallest feature meant to pass + * every merge gate. test:feature-scaffold runs the merge stage on it except the + * commands SCAFFOLD_DRILL_EXCLUDED_SCRIPTS names (browser gates, test:system; + * scripts/lib/feature-scaffold-drill.ts). The feature has one list route + * without params, one GET (SAFE, EXTERNAL_BEARER), * one query, one invalidation topic, one CollectionPage with ko-KR and en-US * copy, and a router page test plus an input test. The templates live in this * file and import nothing from a sample feature, so the command keeps working @@ -1415,7 +1418,7 @@ function report(plan: FeaturePlan): string { "", "Next:", ` 1. Before a release, have a person review and sign artifacts/tests/a11y-manual/${plan.routeId}.md (FE-GATE-028). The merge gates check only its format.`, - " 2. Run the merge gates: corepack pnpm check:types, lint, check:architecture, check:registries, check:i18n, check:design-system, check:diagnostics, verify:documentation, test:unit, test:component, test:integration, test:coverage, check:ci, build.", + " 2. Run the merge gates: corepack pnpm ci:gate -- FE-GATE- for each gate of the merge stage in config/ci/gates.json (README lists the loop). test:feature-scaffold runs them on a generated feature except the browser gates FE-GATE-008/009 and test:system.", ` The feature's own tests: node scripts/run-vitest.ts run tests/features/${plan.id} (test:coverage runs them in CI)`, " The registry baseline does not change: new routes, operations, schemas and invalidation topics are additive.", ]; diff --git a/scripts/lib/feature-scaffold-drill.ts b/scripts/lib/feature-scaffold-drill.ts new file mode 100644 index 00000000..f125bdbf --- /dev/null +++ b/scripts/lib/feature-scaffold-drill.ts @@ -0,0 +1,139 @@ +import { spawnSync } from "node:child_process"; + +import type { CiGateContract } from "../contracts/ci-gates.ts"; +import { classifyGateStepResult, type GateStepExpectation } from "./ci-step-result.ts"; +import { FIXTURE_PNPM_ENVIRONMENT } from "./fixture-node-modules.ts"; +import type { RemovalCheck } from "./removal-fixture.ts"; + +/** + * 1103/12-02. test:feature-scaffold proves that a feature from + * `create:feature` passes the merge gates. It ran a hand-kept list of 15 + * commands while the merge stage has 88, so a template change that broke a + * generated feature in any other merge command passed FE-GATE-020. + * + * The drill now runs the merge stage of the copy's config/ci/gates.json, in + * stage order, each command once. A command added to the merge stage runs here + * 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_gate matrix browser: false). 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)."; + +export const SCAFFOLD_DRILL_EXCLUDED_SCRIPTS: Readonly> = Object.freeze({ + "verify:lockfile": + "runs pnpm install, which writes into the node_modules the copy links from " + + "the repository (scripts/lib/fixture-node-modules.ts).", + "test:e2e": BROWSER, + "test:browser-capabilities": BROWSER, + "verify:browser-capability-evidence": `reads the test:browser-capabilities results; ${BROWSER}`, + "test:storybook": BROWSER, + "test:visual": BROWSER, + "check:test-evidence:browser": `reads the browser gates' results; ${BROWSER}`, + "test:a11y": BROWSER, + "test:system": + "needs the CI runner's bubblewrap, systemd and cgroup v2 " + + "(scripts/check-system-test-prerequisites.ts). It tests the provider " + + "sandbox, which a feature does not reach.", + "test:sample-removal": DRILL, + "test:feature-scaffold": "is this drill.", + "test:optional-recipe-removal": DRILL, + "test:browser-file-storage-removal": DRILL, + "test:realtime-removal": DRILL, +}); + +export type ScaffoldDrillCommand = Readonly<{ + /** `:`, the check's name in the drill report. */ + name: string; + script: string; + args: readonly string[]; + expectation: GateStepExpectation; +}>; + +type ContractShape = Pick; + +export function scaffoldDrillCommands( + contract: ContractShape, + excluded: Readonly> = SCAFFOLD_DRILL_EXCLUDED_SCRIPTS, +): readonly ScaffoldDrillCommand[] { + const merge = contract.stages.find(({ id }) => id === "merge"); + if (!merge) throw new TypeError("the CI contract has no merge stage"); + const commands = new Map(contract.commands.map((command) => [command.id, command])); + const mergeScripts = new Set(); + const seen = new Set(); + const selected: ScaffoldDrillCommand[] = []; + for (const gateId of merge.gateIds) { + const gate = contract.gates.find(({ id }) => id === gateId); + if (!gate) throw new TypeError(`the merge stage names an undefined gate: ${gateId}`); + for (const commandId of gate.commandIds) { + const command = commands.get(commandId); + if (!command) throw new TypeError(`${gateId} names an undefined command: ${commandId}`); + mergeScripts.add(command.script); + if (seen.has(commandId) || Object.hasOwn(excluded, command.script)) continue; + seen.add(commandId); + selected.push(Object.freeze({ + name: `${gateId}:${commandId}`, + script: command.script, + args: Object.freeze([...(command.args ?? [])]), + expectation: command.expect === "pass" + ? Object.freeze({ kind: "pass" as const }) + : Object.freeze({ + kind: "fail" as const, + expectedExitCode: command.expectedExitCode ?? 1, + expectedDiagnosticId: command.expectedDiagnosticId ?? "", + }), + })); + } + } + // An exclusion the merge stage no longer runs would hide nothing today and + // silently drop the command if it came back under the same name. + const stale = Object.keys(excluded).filter((script) => !mergeScripts.has(script)); + if (stale.length > 0) { + throw new TypeError( + `the scaffold drill excludes scripts the merge stage does not run: ${stale.join(", ")}`, + ); + } + return Object.freeze(selected); +} + +/** + * Runs one merge command in the fixture. A negative fixture command passes + * only with its registered exit code and diagnostic, as in run-ci-gate.ts. + */ +export function runScaffoldDrillCommand( + command: ScaffoldDrillCommand, + root: string, + pnpmCli: string, +): RemovalCheck { + const capture = command.expectation.kind === "fail"; + const result = spawnSync(process.execPath, [pnpmCli, command.script, ...command.args], { + cwd: root, + encoding: "utf8", + stdio: capture ? "pipe" : "inherit", + maxBuffer: 64 * 1024 * 1024, + env: { ...process.env, ...FIXTURE_PNPM_ENVIRONMENT }, + }); + if (capture) { + process.stdout.write(result.stdout ?? ""); + process.stderr.write(result.stderr ?? ""); + } + const classification = classifyGateStepResult(command.expectation, { + status: result.status, + signal: result.signal, + stdout: result.stdout ?? "", + stderr: result.stderr ?? "", + ...(result.error ? { error: { code: (result.error as NodeJS.ErrnoException).code } } : {}), + }); + if (classification.expectationMet) return { name: command.name, passed: true }; + const invocation = `corepack pnpm ${[command.script, ...command.args].join(" ")}`; + return { + name: command.name, + passed: false, + failure: command.expectation.kind === "fail" + ? `${invocation}: ${classification.kind}, expected exit ${command.expectation.expectedExitCode} with ${JSON.stringify(command.expectation.expectedDiagnosticId)}, got exit ${result.status ?? result.signal}` + : `${invocation} exited ${result.status ?? result.signal ?? "on a spawn error"}`, + }; +} diff --git a/scripts/test-feature-scaffold.ts b/scripts/test-feature-scaffold.ts index 6348a516..59df1162 100644 --- a/scripts/test-feature-scaffold.ts +++ b/scripts/test-feature-scaffold.ts @@ -1,5 +1,10 @@ import { mkdir, rm, writeFile } from "node:fs/promises"; +import { loadCiGateContract } from "./contracts/ci-gates.ts"; +import { + runScaffoldDrillCommand, + scaffoldDrillCommands, +} from "./lib/feature-scaffold-drill.ts"; import { createRemovalFixtureRoot, prepareRemovalFixture, @@ -15,7 +20,16 @@ import { /** * U7. A feature from `create:feature` passes the merge gates without an edit * and breaks no other test. A copy of the repository, sample feature - * included, gets one generated feature and then runs the gates. + * included, gets one generated feature and then runs the merge stage of its + * config/ci/gates.json: every command except those + * SCAFFOLD_DRILL_EXCLUDED_SCRIPTS names with a reason (the browser gates, + * test:system, the install check and the removal drills). 1103/12-02: this + * used to be a hand-kept list of 15 commands. + * + * 1103/16-02. The generated feature is then removed again with + * `test:sample-removal -- --feature=`, the path the manual tells every + * product feature to take and that no gate ran. + * * test:sample-removal repeats the generation after deleting the sample * (decision 4), which proves the command needs nothing from it. */ @@ -41,23 +55,10 @@ try { // Commits the copy with the feature, as a project would: git-based // checks (git grep, git ls-files) then see the feature's files. sealRemovalFixtureRepository(fixtureRoot); - checks.push( - check("typecheck", "check:types"), - check("lint", "lint"), - check("architecture", "check:architecture"), - check("registries", "check:registries"), - check("i18n", "check:i18n"), - check("design-system", "check:design-system"), - check("diagnostics", "check:diagnostics"), - check("documentation", "verify:documentation"), - check("unit", "test:unit"), - check("component", "test:component"), - check("integration", "test:integration"), - check("features", "exec", ["node", "scripts/run-vitest.ts", "run", "tests/features"]), - check("coverage", "test:coverage"), - check("ci-contract", "check:ci"), - check("build", "build"), - ); + for (const command of scaffoldDrillCommands(await loadCiGateContract(fixtureRoot))) { + checks.push(runScaffoldDrillCommand(command, fixtureRoot, pnpmCli)); + } + checks.push(check("feature-removal", "test:sample-removal", ["--", `--feature=${FEATURE_ID}`])); } const failed = checks.filter((entry) => !entry.passed); await mkdir("artifacts/tests", { recursive: true }); diff --git a/tests/unit/feature-scaffold-drill.test.ts b/tests/unit/feature-scaffold-drill.test.ts new file mode 100644 index 00000000..414ae81a --- /dev/null +++ b/tests/unit/feature-scaffold-drill.test.ts @@ -0,0 +1,65 @@ +import { readFile } from "node:fs/promises"; + +import { describe, expect, it } from "vitest"; + +import { loadCiGateContract } from "../../scripts/contracts/ci-gates.ts"; +import { + SCAFFOLD_DRILL_EXCLUDED_SCRIPTS, + scaffoldDrillCommands, +} from "../../scripts/lib/feature-scaffold-drill.ts"; + +// 1103/12-02. The scaffold drill claimed "every merge gate" and ran 15 +// hand-picked commands of the 88 in the merge stage. +describe("feature scaffold drill commands", () => { + it("are the merge stage minus the named exclusions, each command once", async () => { + const contract = await loadCiGateContract(process.cwd()); + const merge = contract.stages.find(({ id }) => id === "merge")!; + const mergeCommandIds = new Set( + merge.gateIds.flatMap((gateId) => contract.gates.find(({ id }) => id === gateId)!.commandIds), + ); + const commands = scaffoldDrillCommands(contract); + const runCommandIds = commands.map(({ name }) => name.split(":").slice(1).join(":")); + expect(new Set(runCommandIds).size).toBe(runCommandIds.length); + for (const commandId of mergeCommandIds) { + const command = contract.commands.find(({ id }) => id === commandId)!; + expect( + runCommandIds.includes(commandId) || Object.hasOwn(SCAFFOLD_DRILL_EXCLUDED_SCRIPTS, command.script), + commandId, + ).toBe(true); + } + expect(commands.map(({ script }) => script)).toEqual(expect.arrayContaining([ + "check:types", "lint", "test:unit", "test:coverage", "build", "check:bundle", + "test:contract", "test:runtime-schema", "check:request-fanout", "build:release-candidate", + ])); + for (const reason of Object.values(SCAFFOLD_DRILL_EXCLUDED_SCRIPTS)) { + expect(reason.length).toBeGreaterThan(10); + } + }); + + it("keeps a negative fixture's registered exit and diagnostic", async () => { + const contract = await loadCiGateContract(process.cwd()); + expect(scaffoldDrillCommands(contract).find(({ script }) => script === "check:types:fixture")) + .toMatchObject({ expectation: { kind: "fail", expectedExitCode: 1, expectedDiagnosticId: "error TS2322:" } }); + }); + + it("runs a command added to the merge stage without an edit to the drill", async () => { + const contract = structuredClone(await loadCiGateContract(process.cwd())); + contract.commands.push({ id: "check-probe", script: "check:probe", expect: "pass" } as never); + contract.gates.find(({ id }) => id === "FE-GATE-010")!.commandIds.push("check-probe"); + expect(scaffoldDrillCommands(contract).map(({ name }) => name)).toContain("FE-GATE-010:check-probe"); + }); + + it("refuses an exclusion for a script the merge stage does not run", async () => { + const contract = await loadCiGateContract(process.cwd()); + expect(() => scaffoldDrillCommands(contract, { + ...SCAFFOLD_DRILL_EXCLUDED_SCRIPTS, + "check:gone": "no longer in the merge stage", + })).toThrow(/does not run: check:gone/u); + }); + + it("is what test:feature-scaffold runs", async () => { + const drill = await readFile("scripts/test-feature-scaffold.ts", "utf8"); + expect(drill).toContain("scaffoldDrillCommands("); + expect(drill).toContain("loadCiGateContract(fixtureRoot)"); + }); +}); From fb20699465299105611a2898199147378e2ae3bf Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Wed, 4 Nov 2026 21:23:25 +0900 Subject: [PATCH 14/22] =?UTF-8?q?test(routes):=20=EB=B3=B4=ED=98=B8=20?= =?UTF-8?q?=EB=9D=BC=EC=9A=B0=ED=8A=B8=EA=B0=80=20=EB=B3=B5=EA=B5=AC=20?= =?UTF-8?q?=EC=A4=91=EC=9D=B8=20=EC=84=B8=EC=85=98=EC=9D=84=20=EA=B8=B0?= =?UTF-8?q?=EB=8B=A4=EB=A6=AC=EB=8A=94=20=EB=B6=84=EA=B8=B0=EB=A5=BC=20?= =?UTF-8?q?=EA=B3=A0=EC=A0=95=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제 decideRouteAccess의 recovery-pending 분기(wait-for-session)를 어떤 테스트도 보지 않았다. 지난 리뷰 변이 L02(wait-for-session을 show-sign-in으로)가 18파일 105개 테스트를 통과했다. 그러면 세션을 복구하는 중인 사용자가 들어갈 수 있는 페이지에서 로그인 화면으로 튕긴다. 고른 방법 - tests/unit/navigation-policy.test.ts에 보호 라우트 하나로 recovery-pending은 wait-for-session, authenticated는 허용임을 단언한다. 위험·한계 - 화면(route-status-surfaces) 수준의 대기 표시는 따로 고정하지 않았다. 검증 - 새 테스트 통과. 변이 L02를 넣으면 새 테스트만 실패한다(되돌림). Refs: docs/reviews/2026-11-03-maturity-review/10-tests-fast-layers.md 1101/10-03 --- tests/unit/navigation-policy.test.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/unit/navigation-policy.test.ts b/tests/unit/navigation-policy.test.ts index 35f492da..02474224 100644 --- a/tests/unit/navigation-policy.test.ts +++ b/tests/unit/navigation-policy.test.ts @@ -46,6 +46,23 @@ describe("installed route registry", () => { } }); + // 1101/10-03. A session that is still being recovered waits; showing sign-in + // there would bounce a returning user out of a page they may enter. + it("waits for a recovering session on a protected route and admits an authenticated one", () => { + const protectedRoute = Object.values( + ROUTE_REGISTRY as Readonly>, + ).find((route) => route.access !== "public"); + expect(protectedRoute).toBeDefined(); + expect(decideRouteAccess(protectedRoute!.routeId, "recovery-pending")).toEqual({ + allowed: false, + action: "wait-for-session", + }); + expect(decideRouteAccess(protectedRoute!.routeId, "authenticated")).toEqual({ + allowed: true, + action: "none", + }); + }); + it("bounds automatic redirects by pair and maximum hops", () => { const guard = createRedirectLoopGuard(2); expect(guard.allow("/private", "/signin")).toBe(true); From 1b1d972acda3dd6614d7abab23ff5977eafd8ad1 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Wed, 4 Nov 2026 21:23:37 +0900 Subject: [PATCH 15/22] =?UTF-8?q?test(boot):=20=EC=98=88=EC=83=81=20?= =?UTF-8?q?=EB=B0=96=20=EB=B6=80=ED=8C=85=20=EC=8B=A4=ED=8C=A8=20=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=EA=B0=80=20=EB=B0=94=EA=BE=BC=20=EC=A0=84?= =?UTF-8?q?=EC=97=AD=20reportError=EB=A5=BC=20=EB=90=98=EB=8F=8C=EB=A6=B0?= =?UTF-8?q?=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제 tests/component/boot-unexpected-failure.test.tsx는 vi.stubGlobal로 reportError를 바꾸고 되돌리지 않는다. 설정에 unstubGlobals가 없어서 그 stub이 같은 파일의 다음 테스트에 남는다. 고른 방법 - 이 파일에 afterEach(vi.unstubAllGlobals)를 둔다. 전역 설정 (unstubGlobals: true)은 다른 파일의 동작까지 바꾸므로 고르지 않았다. 검증 - 파일 2건 통과, eslint 통과. Refs: docs/reviews/2026-11-03-maturity-review/10-tests-fast-layers.md (2절 boot-unexpected-failure stubGlobal) --- tests/component/boot-unexpected-failure.test.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/component/boot-unexpected-failure.test.tsx b/tests/component/boot-unexpected-failure.test.tsx index 9da395bb..f5800893 100644 --- a/tests/component/boot-unexpected-failure.test.tsx +++ b/tests/component/boot-unexpected-failure.test.tsx @@ -1,7 +1,7 @@ // @vitest-environment jsdom import { render, screen, within } from "@testing-library/react"; -import { describe, expect, it, vi } from "vitest"; +import { afterEach, describe, expect, it, vi } from "vitest"; import { BootErrorShell } from "../../src/presentation/boundaries/boot-error-shell.tsx"; @@ -16,6 +16,12 @@ vi.mock("../../src/bootstrap/create-runtime-composition.ts", () => ({ }, })); +// The reportError stub must not reach the next test in this file; the config +// does not set unstubGlobals. +afterEach(() => { + vi.unstubAllGlobals(); +}); + describe("unexpected boot failure (09-04)", () => { it("is shown as BOOT_UNEXPECTED_FAILURE and reports the error in development", async () => { document.body.innerHTML = From 8cd60bfbfe8af7a856e47f5dea8b5a191063d629 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Wed, 4 Nov 2026 21:23:52 +0900 Subject: [PATCH 16/22] =?UTF-8?q?test(runbook):=20drill=20=EC=83=81?= =?UTF-8?q?=EC=88=98=20=ED=8C=90=EC=A0=95=20=EA=B2=80=EC=82=AC=EA=B0=80=20?= =?UTF-8?q?=EC=A7=80=EA=B8=88=EC=9D=98=20=EB=AC=B8=EC=9E=90=EC=97=B4=20?= =?UTF-8?q?=ED=8C=90=EC=A0=95=20=EB=AA=A8=EC=96=91=EB=8F=84=20=EC=B0=BE?= =?UTF-8?q?=EB=8A=94=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제 tests/unit/runbook-drill.test.ts의 "상수 판정 금지" 검사는 옛 모양 (assertion(..., true), Asserted: true)만 찾는다. drill은 이제 verdict()로 "PASS"/"FAIL" 문자열을 쓴다. 지난 리뷰 변이(:238의 verdict(await builtAssetsPresent(...))를 상수 "PASS"로)가 이 검사를 통과했다. 고른 방법 - assertion(..., "PASS"), *Asserted / *AsExpected: "PASS", verdict(true) 모양을 더 찾는다. 옛 정규식 셋은 그대로 둔다. 위험·한계 - 문자열을 변수에 담아 넘기는 우회는 이 정적 검사가 못 본다. 그 경우는 동작 테스트(FE-RB-002 등)가 본다. 검증 - 검사 통과. 리뷰의 변이를 다시 넣으면 이 검사가 실패한다(되돌림). Refs: docs/reviews/2026-11-03-maturity-review/11-tests-browser-release-scale.md 0929/11-08 --- tests/unit/runbook-drill.test.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/unit/runbook-drill.test.ts b/tests/unit/runbook-drill.test.ts index 38d85701..8bd5bfab 100644 --- a/tests/unit/runbook-drill.test.ts +++ b/tests/unit/runbook-drill.test.ts @@ -125,5 +125,10 @@ describe("runbook drill verdicts", () => { expect(source).not.toMatch(/assertion\([^;]*,\s*true\s*\)/u); expect(source).not.toMatch(/Asserted:\s*true\b/u); expect(source).not.toMatch(/injectedMountFailure\s*=\s*true/u); + // 0929/11-08. The drill records string verdicts now; the patterns above + // only knew the old boolean shape, so a constant "PASS" went unnoticed. + expect(source).not.toMatch(/assertion\([^;]*,\s*["']PASS["']\s*,?\s*\)/u); + expect(source).not.toMatch(/(?:Asserted|AsExpected):\s*["']PASS["']/u); + expect(source).not.toMatch(/verdict\(\s*true\s*\)/u); }); }); From ed499736529e1b8733243175c90ea30bbd6090d9 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Wed, 4 Nov 2026 21:24:06 +0900 Subject: [PATCH 17/22] =?UTF-8?q?test(upload):=20resumable=20upload=20spec?= =?UTF-8?q?=EC=9D=B4=20=ED=8E=98=EC=9D=B4=EC=A7=80=20origin=EC=9D=84=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95=EC=9D=98=20baseURL=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EC=9D=BD=EB=8A=94=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제 tests/browser-capabilities/resumable-upload.spec.ts가 CORS 응답의 origin을 "http://127.0.0.1:4174"로 따로 적는다. playwright.capabilities.config.ts의 baseURL과 지금은 같아서 동작하지만, 설정의 포트를 바꾸면 이 spec만 CORS로 조용히 깨진다. 고른 방법 - 설정 파일을 import해 use.baseURL의 origin을 쓴다. test.info()는 route 처리기 안에서 부를 수 있는지가 Playwright 내부 맥락에 달려 고르지 않았다. 검증 - check:types(tsconfig.test.json) 통과, eslint 통과. 브라우저 실행 결과는 이 커밋 메시지에 적지 않았다(공유 잠금 대기). Refs: docs/reviews/2026-11-03-maturity-review/11-tests-browser-release-scale.md (2절 FOLLOW-UP resumable-upload 포트) --- tests/browser-capabilities/resumable-upload.spec.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/browser-capabilities/resumable-upload.spec.ts b/tests/browser-capabilities/resumable-upload.spec.ts index 3d84d0b0..a1c60946 100644 --- a/tests/browser-capabilities/resumable-upload.spec.ts +++ b/tests/browser-capabilities/resumable-upload.spec.ts @@ -2,9 +2,12 @@ import { createHash } from "node:crypto"; import type { Route } from "@playwright/test"; +import capabilitiesConfig from "../../playwright.capabilities.config.ts"; import { expect, test } from "../support/browser/strict-browser-test.ts"; -const PAGE_ORIGIN = "http://127.0.0.1:4174"; +// The page is served from the capability config's baseURL; a copy of its port +// here drifted silently whenever the config moved. +const PAGE_ORIGIN = new URL(capabilitiesConfig.use?.baseURL ?? "").origin; const API_ORIGIN = "https://upload-api.example.test"; const OBJECT_ORIGIN = "https://upload-objects.example.test"; const SESSION_ID = "session_browser_01"; From a28b8a41728b2cea40960424876b328f017d96a1 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Wed, 4 Nov 2026 21:31:16 +0900 Subject: [PATCH 18/22] =?UTF-8?q?fix(removal):=20=EC=83=88=20=EB=93=9C?= =?UTF-8?q?=EB=A6=B4=20=EA=B0=80=EB=93=9C=20=ED=85=8C=EC=8A=A4=ED=8A=B8?= =?UTF-8?q?=EA=B0=80=20=EC=A0=9C=EA=B1=B0=20fixture=20=EC=95=88=EC=97=90?= =?UTF-8?q?=EC=84=9C=EB=8F=84=20=EC=84=B1=EB=A6=BD=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제 capability 제거 드릴의 fixture도 test:unit을 돈다. 앞 커밋들이 더한 가드 테스트 두 개가 그 안에서 실패했다. - removal-fixture.test.ts: 문서 테스트 파일과 드릴 스크립트를 이름으로 읽는데, fixture는 문서 테스트를 지우고(02-06) 드릴은 자기 스크립트를 지운다. browser-file-storage·realtime 드릴이 이 두 건으로 `test` 검사에서 실패했다. - feature-scaffold-drill: 제거 드릴이 자기 capability 명령을 계약에서 빼면, scaffold 드릴 제외 목록의 그 스크립트가 "merge 단계에 없음"으로 실패한다. 고른 방법 - 문서 테스트는 "문서가 있는 곳에만 있다"를 단언한다(저장소: 둘 다 있음, capability fixture: 둘 다 없음). - 드릴 목록은 scripts/test-*.ts 중 removal-fixture.ts를 import하는 파일로 찾고, sample·scaffold 드릴이 그 안에 있는지 확인한다. - 제외 목록이 낡았다는 판정은 계약에 있으나 merge 단계 밖인 명령에만 한다. 계약에서 아예 빠진 명령(제거 드릴이 정리한 capability)은 낡은 것이 아니다. 위험·한계 - 계약에서 지운 스크립트의 제외 항목이 저장소에 남아도 이 검사는 알리지 않는다. 남아도 아무 명령을 숨기지 않는다. 검증 - 수정 전 snapshot(0edc3fc)에서 test:browser-file-storage-removal, test:realtime-removal 모두 이 두 테스트로 exit 1(ENOENT). - 수정 뒤 removal-fixture·feature-scaffold-drill 18건 통과, eslint·tsc 통과. Refs: docs/reviews/2026-11-03-maturity-review/02-adapters-browser-files-cache.md 02-06 Refs: docs/reviews/2026-11-03-maturity-review/12-guardrails-ci.md 12-02 --- scripts/lib/feature-scaffold-drill.ts | 12 ++++++--- tests/unit/feature-scaffold-drill.test.ts | 28 +++++++++++++++++--- tests/unit/removal-fixture.test.ts | 32 ++++++++++++++--------- 3 files changed, 52 insertions(+), 20 deletions(-) diff --git a/scripts/lib/feature-scaffold-drill.ts b/scripts/lib/feature-scaffold-drill.ts index f125bdbf..bbbd06f7 100644 --- a/scripts/lib/feature-scaffold-drill.ts +++ b/scripts/lib/feature-scaffold-drill.ts @@ -88,12 +88,16 @@ export function scaffoldDrillCommands( })); } } - // An exclusion the merge stage no longer runs would hide nothing today and - // silently drop the command if it came back under the same name. - const stale = Object.keys(excluded).filter((script) => !mergeScripts.has(script)); + // 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. + const contractScripts = new Set(contract.commands.map(({ script }) => script)); + const stale = Object.keys(excluded).filter( + (script) => contractScripts.has(script) && !mergeScripts.has(script), + ); if (stale.length > 0) { throw new TypeError( - `the scaffold drill excludes scripts the merge stage does not run: ${stale.join(", ")}`, + `the scaffold drill excludes scripts the contract runs outside the merge stage: ${stale.join(", ")}`, ); } return Object.freeze(selected); diff --git a/tests/unit/feature-scaffold-drill.test.ts b/tests/unit/feature-scaffold-drill.test.ts index 414ae81a..603118db 100644 --- a/tests/unit/feature-scaffold-drill.test.ts +++ b/tests/unit/feature-scaffold-drill.test.ts @@ -49,12 +49,34 @@ describe("feature scaffold drill commands", () => { expect(scaffoldDrillCommands(contract).map(({ name }) => name)).toContain("FE-GATE-010:check-probe"); }); - it("refuses an exclusion for a script the merge stage does not run", async () => { + it("refuses an exclusion for a command the contract runs outside the merge stage", async () => { const contract = await loadCiGateContract(process.cwd()); + const merge = new Set(contract.stages.find(({ id }) => id === "merge")!.gateIds); + const mergeCommandIds = new Set( + contract.gates.filter(({ id }) => merge.has(id)).flatMap(({ commandIds }) => commandIds), + ); + const mergeScripts = new Set( + contract.commands.filter(({ id }) => mergeCommandIds.has(id)).map(({ script }) => script), + ); + const outside = contract.commands.find(({ script }) => !mergeScripts.has(script))!; expect(() => scaffoldDrillCommands(contract, { ...SCAFFOLD_DRILL_EXCLUDED_SCRIPTS, - "check:gone": "no longer in the merge stage", - })).toThrow(/does not run: check:gone/u); + [outside.script]: "not in the merge stage", + })).toThrow(`outside the merge stage: ${outside.script}`); + }); + + // 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 () => { + const contract = structuredClone(await loadCiGateContract(process.cwd())); + const removed = contract.commands.find(({ script }) => + Object.hasOwn(SCAFFOLD_DRILL_EXCLUDED_SCRIPTS, script) + )!; + contract.commands = contract.commands.filter(({ id }) => id !== removed.id); + for (const gate of contract.gates) { + gate.commandIds = gate.commandIds.filter((id) => id !== removed.id); + } + expect(() => scaffoldDrillCommands(contract)).not.toThrow(); }); it("is what test:feature-scaffold runs", async () => { diff --git a/tests/unit/removal-fixture.test.ts b/tests/unit/removal-fixture.test.ts index b34457c0..e48b8283 100644 --- a/tests/unit/removal-fixture.test.ts +++ b/tests/unit/removal-fixture.test.ts @@ -1,4 +1,5 @@ -import { mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises"; +import { existsSync } from "node:fs"; +import { mkdir, mkdtemp, readdir, readFile, rm, writeFile } from "node:fs/promises"; import { tmpdir } from "node:os"; import path from "node:path"; @@ -149,26 +150,31 @@ describe("document tests in a removal fixture", () => { ])).toEqual([]); }); - it("names tests that exist and read the documents", async () => { + // This file also runs inside the capability fixtures, which hold neither + // the documents nor these tests; the two go together. + it("names tests that read the documents, present exactly where the documents are", async () => { + const documentsPresent = REMOVAL_FIXTURE_DOCUMENT_TARGETS.every((target) => existsSync(target)); for (const test of REMOVAL_FIXTURE_DOCUMENT_TESTS) { - await expect(readFile(test, "utf8")).resolves.toMatch(/README\.md|CHANGELOG\.md/u); + expect(existsSync(test), test).toBe(documentsPresent); + if (documentsPresent) { + await expect(readFile(test, "utf8")).resolves.toMatch(/README\.md|CHANGELOG\.md/u); + } } }); it("is the only exclusion list: every drill prepares its fixture through it", async () => { - for (const drill of [ - "scripts/test-sample-removal.ts", - "scripts/test-feature-scaffold.ts", - "scripts/test-browser-file-storage-runtime-removal.ts", - "scripts/test-realtime-runtime-removal.ts", - "scripts/test-optional-recipe-removal.ts", - ]) { - const source = await readFile(drill, "utf8"); - expect(source, drill).toContain("prepareRemovalFixture("); + const drills: string[] = []; + for (const name of await readdir("scripts")) { + if (!/^test-.*\.ts$/u.test(name)) continue; + const source = await readFile(path.join("scripts", name), "utf8"); + if (!source.includes("./lib/removal-fixture.ts")) continue; + drills.push(name); + expect(source, name).toContain("prepareRemovalFixture("); for (const test of REMOVAL_FIXTURE_DOCUMENT_TESTS) { - expect(source, drill).not.toContain(test); + expect(source, name).not.toContain(test); } } + expect(drills).toEqual(expect.arrayContaining(["test-sample-removal.ts", "test-feature-scaffold.ts"])); }); }); From b6bfc9b7d9b0e0a6b5a1c82e3dd2c3be57699907 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Wed, 4 Nov 2026 21:39:41 +0900 Subject: [PATCH 19/22] =?UTF-8?q?fix(removal):=20sample=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0=20fixture=EC=9D=98=20=EB=AC=B8=EC=84=9C=20=EA=B2=80?= =?UTF-8?q?=EC=82=AC=EB=A5=BC=20fixture=20=EC=A0=84=EC=9A=A9=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C=EC=99=80=20=EB=A7=9E=EC=B6=98=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제 c4d5870 뒤 test:sample-removal이 문서를 복사하고 verify:documentation과 문서 테스트를 돌린다. 실제 드릴 실행(snapshot 0edc3fc)에서 두 가지로 실패했다. - 드릴은 fixture에서만 tests/unit/ci-workflow-generation.test.ts와 tests/unit/removal-fixture.test.ts를 지운다(전체 저장소를 고정하는 테스트라). docs/operations/adapter-remediation-ledger.md가 그 두 파일을 백틱 경로로 적어, fixture의 문서 검사와 문서 테스트 7건이 실패했다. 샘플을 지운 실제 프로젝트는 그 테스트를 지우지 않으므로 이 실패는 fixture에만 있다. - 잔여 검사가 tests/unit/documentation-readiness.test.ts의 정규식 REFERENCE_RESOURCE_[A-Z]+를 샘플 흔적으로 잡았다. 그 파일은 예전에는 fixture 에서 지워져 검사되지 않았다. 고른 방법 - 원장(기록 문서)의 그 세 곳을 백틱 없는 경로로 바꾼다. 드릴의 fixture 전용 삭제 목록 옆에 "현재 계약 문서는 이 파일들을 백틱 경로로 적지 않는다"를 적었다. - 정규식을 [A-Z]+_RESOURCE_[A-Z]+로 쓴다. 라우트 ID를 지우는 용도는 같다. - 버린 대안: 문서 검사에 fixture 전용 예외 경로를 넘기는 환경 변수. 운영 스크립트에 테스트용 입력이 생긴다. fixture 전용 삭제를 그만두기. ci-workflow-generation 스냅샷은 줄어든 CI 계약과 맞지 않는다. 위험·한계 - 앞으로 현재 계약 문서가 그 두 테스트를 백틱으로 적으면 sample 드릴이 다시 문서 검사에서 실패한다. 실패 메시지가 파일과 경로를 적는다. 검증 - 수정 전 snapshot 0edc3fc의 test:sample-removal exit 1: documentation, unit-integration, coverage, fixture-id-residue와 scaffold- 세 검사가 이 두 원인으로 실패. lint·check:i18n·check:design-system 등 나머지는 통과. - 샘플·SAMPLE_EXTRAS·fixture 전용 테스트를 지운 복사본(sim-sample-docs.sh)에서 verify:documentation PASS_SCOPED. 저장소에서 documentation-readiness 19건 통과, verify:documentation PASS_SCOPED. Refs: docs/reviews/2026-11-03-maturity-review/14-template-product-docs.md 14-04 --- docs/operations/adapter-remediation-ledger.md | 6 +++--- scripts/test-sample-removal.ts | 3 +++ tests/unit/documentation-readiness.test.ts | 4 +++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/operations/adapter-remediation-ledger.md b/docs/operations/adapter-remediation-ledger.md index 28ebfd81..5e48aab7 100644 --- a/docs/operations/adapter-remediation-ledger.md +++ b/docs/operations/adapter-remediation-ledger.md @@ -346,7 +346,7 @@ Run on the landed tree. Only what actually passed is claimed as passing. | Gate | Status | Attribution | | --- | --- | --- | -| `tests/unit/ci-workflow-generation.test.ts` | 82 failed / 325 passed | Identical on the pre-change baseline (`git stash` comparison). The subprocess gates it spawns cannot run in this sandbox. | +| tests/unit/ci-workflow-generation.test.ts | 82 failed / 325 passed | Identical on the pre-change baseline (`git stash` comparison). The subprocess gates it spawns cannot run in this sandbox. | | `tests/system/ci-runner/ci-artifact-contract.test.ts` | fails | Unchanged pre-existing sandbox, cgroup and `/tmp` permission behaviour. | | `tests/unit/security-followup.test.ts`, `tests/integration/provider-guardian-transaction.test.ts`, `tests/unit/risk-coverage.test.ts` | flaky under full-suite load | Historical baseline result. All three passed in a fresh process (78 passed together). | @@ -390,12 +390,12 @@ files above plus the two flaky-under-load ones: | File | Failed | Attribution | | --- | ---: | --- | -| `tests/unit/ci-workflow-generation.test.ts` | 82 | Identical on the pre-change baseline (`git stash` comparison). Its subprocess gates cannot run in this sandbox. | +| tests/unit/ci-workflow-generation.test.ts | 82 | Identical on the pre-change baseline (`git stash` comparison). Its subprocess gates cannot run in this sandbox. | | `tests/system/ci-runner/ci-artifact-contract.test.ts` | 19 | Unchanged pre-existing sandbox, cgroup and `/tmp` permission behaviour. | | `tests/unit/security-followup.test.ts` | 2 | Passes in isolation. | | `tests/integration/provider-guardian-transaction.test.ts` | 1 | Historical baseline: passed in isolation; current suite is classified as process integration. | -1619 passed / 1723 total, and `tests/unit/removal-fixture.test.ts`, +1619 passed / 1723 total, and tests/unit/removal-fixture.test.ts, `tests/unit/supply-chain.test.ts` and `tests/integration/security-followup-archive.test.ts` — the three that had to be excluded before — now pass in the full run. diff --git a/scripts/test-sample-removal.ts b/scripts/test-sample-removal.ts index f9b3e88c..1c97d0c0 100644 --- a/scripts/test-sample-removal.ts +++ b/scripts/test-sample-removal.ts @@ -211,6 +211,9 @@ try { ...REMOVAL_FIXTURE_COPY_TARGETS, ...REMOVAL_FIXTURE_DOCUMENT_TARGETS, ]); + // Fixture-only deletions: a project that removes the sample keeps these. + // verify:documentation runs in this fixture, so a current contract document + // must not name them as backtick paths (docs/manual/reference/patterns.md). for (const excludedFixtureTest of [ "tests/unit/ci-workflow-generation.test.ts", "tests/unit/__snapshots__/ci-workflow-generation.test.ts.snap", diff --git a/tests/unit/documentation-readiness.test.ts b/tests/unit/documentation-readiness.test.ts index d5962b37..0dcd9f13 100644 --- a/tests/unit/documentation-readiness.test.ts +++ b/tests/unit/documentation-readiness.test.ts @@ -81,7 +81,9 @@ describe("verify:documentation failure output (1101/14-06)", () => { // files now, and the current contract documents (docs/README.md §1) may only // name paths, package scripts and gate IDs that exist. describe("verify:documentation current contract documents (1101/14-05)", () => { - const ROUTE_IDS = /`(?:APP_HOME|EXAMPLES_[A-Z]+|NOT_FOUND|REFERENCE_RESOURCE_[A-Z]+)`/gu; + // Written without the sample's route prefix: the sample removal drill runs + // this file and refuses any file that still names the removed sample. + const ROUTE_IDS = /`(?:APP_HOME|EXAMPLES_[A-Z]+|NOT_FOUND|[A-Z]+_RESOURCE_[A-Z]+)`/gu; it("does not need README or the checklist to list route IDs", async () => { const result = await verify({ From fd11d08a89c23fd5eac21f4fd63de0a2cc01b603 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Wed, 4 Nov 2026 22:08:25 +0900 Subject: [PATCH 20/22] =?UTF-8?q?fix(docs):=20=EC=B0=B8=EC=A1=B0=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EC=A0=84=EC=9A=A9=20script=EB=A5=BC=20?= =?UTF-8?q?=EB=AC=B8=EC=84=9C=20=EA=B2=80=EC=82=AC=EA=B0=80=20=EC=9A=94?= =?UTF-8?q?=EA=B5=AC=ED=95=98=EC=A7=80=20=EC=95=8A=EA=B2=8C=20=EC=A0=81?= =?UTF-8?q?=EB=8A=94=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제 test:sample-removal은 참조 기능을 지울 때 그 전용 script test:reference-feature도 package.json에서 지운다. 샘플을 지운 프로젝트도 같다. 그런데 docs/testing/taxonomy.md와 원장 두 행이 그 script를 백틱·명령 형태로 적어, 문서 검사가 "names package scripts that do not exist: test:reference-feature"로 실패했다(b6bfc9b snapshot의 드릴 실행). 고른 방법 - 참조 기능 경로와 같은 규칙(patterns.md 첫머리): 참조 기능이 가진 script는 백틱이나 `corepack pnpm` 없이 적고 "참조 기능과 함께 지워진다"를 붙인다. 위험·한계 - 템플릿에서도 문서 검사가 이 script 이름의 존재를 보지 않는다. 검증 - 샘플·SAMPLE_EXTRAS·fixture 전용 테스트를 지우고 test:reference-feature를 package.json에서 뺀 복사본(sim-sample-docs.sh)에서 verify:documentation PASS_SCOPED. 저장소에서도 PASS_SCOPED. Refs: docs/reviews/2026-11-03-maturity-review/14-template-product-docs.md 14-04 --- docs/operations/adapter-remediation-ledger.md | 4 ++-- docs/testing/taxonomy.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/operations/adapter-remediation-ledger.md b/docs/operations/adapter-remediation-ledger.md index 5e48aab7..78819d06 100644 --- a/docs/operations/adapter-remediation-ledger.md +++ b/docs/operations/adapter-remediation-ledger.md @@ -194,7 +194,7 @@ Captured after every correctness task landed. | `git diff --check` | 0 | clean | | `corepack pnpm test:component` | 0 | 126 passed | | `corepack pnpm test:integration` | 0 | 52 passed | -| `corepack pnpm test:reference-feature` | 0 | 26 passed | +| test:reference-feature (the reference sample's script) | 0 | 26 passed | | `corepack pnpm test:recipes` | 0 | 17 passed | | `corepack pnpm test:unit` | 1 | 1585 passed / 19 failed tests; the 19 are the unchanged pre-existing `ci-artifact-contract` sandbox failures | | `corepack pnpm check:registries` | 0 | 11 registries PASS | @@ -340,7 +340,7 @@ Run on the landed tree. Only what actually passed is claimed as passing. | `tests/unit` + `tests/integration`, no exclusions | — | 1643 passed / 1747; the 104 failures are the four environmental files below | | `corepack pnpm test:component` | 0 | 126 passed | | `corepack pnpm test:recipes` | 0 | 17 passed | -| `corepack pnpm test:reference-feature` | 0 | 26 passed | +| test:reference-feature (the reference sample's script) | 0 | 26 passed | ### Environmental failures, not claimed as green diff --git a/docs/testing/taxonomy.md b/docs/testing/taxonomy.md index 46e5d172..f3a199e9 100644 --- a/docs/testing/taxonomy.md +++ b/docs/testing/taxonomy.md @@ -18,7 +18,7 @@ Each gate is blocking in its declared scope. Failures are not downgraded with `test:all` is the normal product-development loop. It runs, in order, `test:runtime-schema`, `test:unit`, `test:contract`, `test:component`, -`test:integration`, `test:reference-feature`, `test:platform` (`tests/platform` +`test:integration`, test:reference-feature (removed with the reference sample), `test:platform` (`tests/platform` and `tests/architecture`), `check:release-coherence` and `test:recipes` (`package.json` `test:all`). It does not include `test:system`. CI-runner and supply-chain assurance has different host prerequisites and is invoked From b433286eb0ea1ac15864f4aa05a713bdecdd8c85 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Wed, 4 Nov 2026 22:23:13 +0900 Subject: [PATCH 21/22] =?UTF-8?q?fix(scaffold):=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1=20=EB=93=9C=EB=A6=B4=EC=9D=B4=20=EB=A1=9C?= =?UTF-8?q?=EC=BB=AC=EC=97=90=EC=84=9C=EB=8F=84=20release=20candidate?= =?UTF-8?q?=EB=A5=BC=20=EB=A7=8C=EB=93=A0=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제 e1b4e28 뒤 test:feature-scaffold는 merge 단계 명령을 모두 돈다. 실제 실행 (snapshot b6bfc9b, CI env 없음)에서 검사 75개 중 FE-GATE-013의 두 개만 실패했다. build:release-candidate가 build의 commitSha를 source.revision으로 기록하는데, VITE_COMMIT_SHA가 없으면 commitSha가 "local"이라 schema(40·64자리 16진수)가 거부한다. verify:local-evidence는 그 결과를 읽어 따라 실패했다. CI workflow는 VITE_COMMIT_SHA를 전체 env로 주므로 CI에서는 나지 않는다. 고른 방법 - VITE_COMMIT_SHA가 비었을 때만 드릴이 fixture의 봉인 commit(git rev-parse HEAD)을 넣는다. CI 값은 그대로 둔다. test:system의 provider fixture도 같은 방법으로 commit을 준다. - 버린 대안: build:release-candidate·verify:local-evidence를 제외 목록에 넣기. 생성 기능 파일이 후보의 추적 파일 목록과 공급망 증거에 들어가는지를 보지 못한다. 위험·한계 - 로컬 실행에서 빌드 산출물의 commitSha가 "local" 대신 fixture commit이 된다. fixture 안에서만이다. 검증 - 수정 전 드릴 실행: create-feature, merge 명령 73개(음성 fixture 포함), feature-removal 통과. 실패는 위 두 개뿐(866초, load 10~25). - 수정 뒤 eslint·tsc 통과, feature-scaffold-drill 6건 통과. 드릴 재실행 결과는 이 커밋 메시지에 적지 않았다(공유 잠금). Refs: docs/reviews/2026-11-03-maturity-review/12-guardrails-ci.md 12-02 --- scripts/test-feature-scaffold.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/test-feature-scaffold.ts b/scripts/test-feature-scaffold.ts index 59df1162..92f4a267 100644 --- a/scripts/test-feature-scaffold.ts +++ b/scripts/test-feature-scaffold.ts @@ -1,3 +1,4 @@ +import { spawnSync } from "node:child_process"; import { mkdir, rm, writeFile } from "node:fs/promises"; import { loadCiGateContract } from "./contracts/ci-gates.ts"; @@ -39,6 +40,12 @@ const REPORT = "artifacts/tests/feature-scaffold.xml"; const pnpmCli = requireRemovalFixtureEnvironment("npm_execpath"); const fixtureRoot = await createRemovalFixtureRoot("feature-scaffold"); +function fixtureCommit(root: string): string { + const head = spawnSync("git", ["rev-parse", "HEAD"], { cwd: root, encoding: "utf8" }); + if (head.status !== 0) throw new Error(`feature scaffold fixture has no commit: ${head.stderr}`); + return head.stdout.trim(); +} + function check(name: string, script: string, extra: readonly string[] = []): RemovalCheck { return runRemovalFixtureCheck(name, fixtureRoot, pnpmCli, script, extra); } @@ -55,6 +62,12 @@ try { // Commits the copy with the feature, as a project would: git-based // checks (git grep, git ls-files) then see the feature's files. sealRemovalFixtureRepository(fixtureRoot); + // build:release-candidate records the build's commit and refuses one that + // is not a commit ID. CI sets VITE_COMMIT_SHA for the whole workflow; a + // local run gets the copy's own sealed commit instead of "local". + if (!process.env["VITE_COMMIT_SHA"]?.trim()) { + process.env["VITE_COMMIT_SHA"] = fixtureCommit(fixtureRoot); + } for (const command of scaffoldDrillCommands(await loadCiGateContract(fixtureRoot))) { checks.push(runScaffoldDrillCommand(command, fixtureRoot, pnpmCli)); } From 6407904c97a6e13b1fd259eb1da0eacf9558c26b Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Wed, 4 Nov 2026 22:34:58 +0900 Subject: [PATCH 22/22] =?UTF-8?q?test(routes):=20=EC=84=B8=EC=85=98=20?= =?UTF-8?q?=EB=B3=B5=EA=B5=AC=20=EB=B6=84=EA=B8=B0=20=EB=8B=A8=EC=96=B8?= =?UTF-8?q?=EC=9D=84=20=EB=B3=B4=ED=98=B8=20=EB=9D=BC=EC=9A=B0=ED=8A=B8=20?= =?UTF-8?q?=EC=A0=84=EC=B2=B4=20=EB=B0=98=EB=B3=B5=20=EC=95=88=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EC=98=AE=EA=B8=B4=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제 fb20699의 새 테스트는 보호 라우트 하나를 찾아 단언하고, 없으면 실패한다. 참조 기능을 지운 제거 fixture에는 보호 라우트가 없어서, test:sample-removal (snapshot fd11d08)의 test:all과 test:coverage가 이 테스트 하나로 실패했다. 고른 방법 - 같은 파일의 "every non-public route" 반복 안에서 recovery-pending과 authenticated를 함께 단언한다. 라우트가 있는 템플릿에서는 같은 변이를 잡고, 보호 라우트가 없는 구성에서는 다른 단언처럼 대상이 없다. 검증 - 파일 4건 통과. 변이 L02(wait-for-session → show-sign-in)를 넣으면 그 반복 테스트가 실패한다(되돌림). eslint 통과. - snapshot fd11d08의 test:sample-removal: 이 테스트 말고 실패한 검사가 없었다(documentation·lint·i18n·design-system 포함). Refs: docs/reviews/2026-11-03-maturity-review/10-tests-fast-layers.md 1101/10-03 --- tests/unit/navigation-policy.test.ts | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/tests/unit/navigation-policy.test.ts b/tests/unit/navigation-policy.test.ts index 02474224..c4903c86 100644 --- a/tests/unit/navigation-policy.test.ts +++ b/tests/unit/navigation-policy.test.ts @@ -43,26 +43,19 @@ describe("installed route registry", () => { allowed: false, action: "show-sign-in", }); + // 1101/10-03. A session still being recovered waits; showing sign-in + // there would bounce a returning user out of a page they may enter. + expect(decideRouteAccess(route.routeId, "recovery-pending")).toEqual({ + allowed: false, + action: "wait-for-session", + }); + expect(decideRouteAccess(route.routeId, "authenticated")).toEqual({ + allowed: true, + action: "none", + }); } }); - // 1101/10-03. A session that is still being recovered waits; showing sign-in - // there would bounce a returning user out of a page they may enter. - it("waits for a recovering session on a protected route and admits an authenticated one", () => { - const protectedRoute = Object.values( - ROUTE_REGISTRY as Readonly>, - ).find((route) => route.access !== "public"); - expect(protectedRoute).toBeDefined(); - expect(decideRouteAccess(protectedRoute!.routeId, "recovery-pending")).toEqual({ - allowed: false, - action: "wait-for-session", - }); - expect(decideRouteAccess(protectedRoute!.routeId, "authenticated")).toEqual({ - allowed: true, - action: "none", - }); - }); - it("bounds automatic redirects by pair and maximum hops", () => { const guard = createRedirectLoopGuard(2); expect(guard.allow("/private", "/signin")).toBe(true);