chore: sync the frontend template from ebea300 to af3d8e6

Carries 359 template commits, tag v0.2.0 plus one documentation commit: the
generator-built feature index with its app, bounded-context and feature
declarations, the src/platform kernel and scale tooling, the 2026-09-24 src
review fixes, and the 2026-09-25 maturity review round with its CHANGELOG
[보안]/[계약] rows. 691 of the 824 template paths are applied, 85 of them
merged with product changes; 127 are not carried.

Product identity is unchanged: name, version 0.1.0, routes, design and the
TechLog domain.

Three decisions worth naming. TechLog stays composed directly, as the last
two syncs recorded; its directory carries a NOT_INSTALLED marker that says so,
and every installed-* composer takes the template's projection with TechLog
added on top. The reference sample is no longer installed: the template now
installs a feature only through feature-module.ts and context-routes.ts,
which load the screens this product deleted, so its three operations, six
schemas and one topic leave the registries, recorded as registry change
evidence. And AppRouter mounts the platform and TechLog routes only; the
template's bounded-context route gateway waits for a generator-installed
feature.

Required fixes: readSubject on the BFF session owner (without it every HTTP
Studio session would close as integration-failed), zod through the facade in
nine TechLog files, noUnusedLocals, and public/config.json written out to
match the local profile. Derived baselines were recomputed after reproducing
both sides' values: CI contract 101 commands / 106 references / 141
artifacts, gate shape c9adcf85; registry approval 2dc6c3a3; the runtime
config schema baseline equals the schema at 8210d48.

Verified here: types, lint, architecture, adapter inventory, CI contract,
i18n, design system, diagnostics, browser security, dev release manifest,
TechLog contract and build pass; 220 component, 155 integration, 15
contract, 418 TechLog, 43 reference-feature, 18 recipe and 46
release-coherence tests pass, and 2381 of 2383 unit tests. Reproduced at
8210d48 first and unchanged: check:registries (byte-identical),
test:runtime-schema, verify:documentation. Brought by the template and
escalated rather than suppressed: check:request-fanout on TechLog's cursor
pagination, check:remediation-ledger (fails upstream too), the shared-chunk
hash test, and the registry-dependent sample removal and second-feature
tests. Playwright suites were not run.

Full record, the five open questions and the follow-ups in
docs/operations/template-sync-2026-09-29.md.

(cherry picked from commit b2170cf265dea45dc9cc05d3c61e627e97f31cdb)
This commit is contained in:
DongHyeonka
2026-11-12 08:28:54 +09:00
parent 585c62431a
commit c80320dfc7
738 changed files with 55027 additions and 13567 deletions
+179 -26
View File
@@ -20,6 +20,7 @@ import {
createCiWorkflowGenerator,
generateCiWorkflow,
renderCiWorkflow,
workflowGateExecutionFailures,
type CiWorkflowFileSystem,
} from "../../scripts/generate-ci-workflow.ts";
import {
@@ -135,6 +136,10 @@ async function createUnsafeCiGateFixture(
Object.assign(packageDocument.scripts, additionalScripts);
await writeFile(path.join(root, "config/ci/gates.json"), `${JSON.stringify(contract)}\n`);
await writeFile(path.join(root, "package.json"), `${JSON.stringify(packageDocument)}\n`);
await writeFile(
path.join(root, "config/ci/contract-baseline.json"),
await readFile("config/ci/contract-baseline.json"),
);
return root;
}
@@ -184,29 +189,21 @@ describe("CI gate contract", () => {
const index = indexCiGateContract(contract);
expect(contract.schemaVersion).toBe(2);
expect(contract.gates.map(({ id }) => id)).toEqual(
Array.from({ length: 27 }, (_, index) =>
Array.from({ length: 28 }, (_, index) =>
`FE-GATE-${String(index + 1).padStart(3, "0")}`,
),
).filter((gateId) => gateId !== "FE-GATE-016"),
);
expect(contract.jobs).toHaveLength(9);
// Final fix wave item 1: FE-GATE-010 gained `check-tech-log-contract`.
// Alignment follow-up item 2: FE-GATE-007 gained `test-tech-log`.
// Dev release manifest drift fix item 2: FE-GATE-010 gained
// `check-dev-release-manifest`.
// Task 11 added TECH_LOG_STUDIO_ASSETS's manual accessibility evidence.
// Alignment follow-up item 2 added the TechLog junit report.
// 주제 화면 셋(`/topics`, `/topics/:slug/:variant`, `/studio/topics/:id`)이 라우트마다
// 하나씩인 수동 접근성 증거를 셋 더했다.
// 환경 구성(SETUP)이 `/setups/:slug` 로 하나를 더 더했다.
// Template sync (ebea300). Every count below is recounted from the merged
// config/ci/gates.json rather than taken from either side: this product
// pinned 85/97/23/118/139 and the template pinned 91/103/30/88/109, and
// neither set describes the merged file. The method was checked by first
// reproducing this product's numbers from the pre-merge gates.json.
expect(contract.commands).toHaveLength(94);
// Template sync (af3d8e6). Recounted from the merged config/ci/gates.json,
// not taken from either side: this product pinned 94/106/30/120/141 and
// the template 98/103/30/87/109. The method was checked by reproducing
// both sides' numbers from their own gates.json first. The template's four
// new commands and this product's three TechLog commands are all present;
// FE-GATE-028 now carries this product's per-route manual review evidence.
expect(contract.commands).toHaveLength(101);
expect(contract.gates.reduce((total, gate) => total + gate.commandIds.length, 0)).toBe(106);
expect(contract.commands.filter(({ expect }) => expect === "fail")).toHaveLength(30);
expect(contract.gates.reduce((total, gate) => total + gate.evidenceArtifactIds.length, 0)).toBe(120);
expect(contract.gates.reduce((total, gate) => total + gate.evidenceArtifactIds.length, 0)).toBe(119);
expect(contract.artifacts).toHaveLength(141);
expect(contract.stages).toHaveLength(5);
expect(contract.retention.classes).toHaveLength(5);
@@ -219,7 +216,7 @@ describe("CI gate contract", () => {
JSON.stringify(await loadCiGateContract(process.cwd())),
) as Record<string, any>;
const gate = candidate.gates.find(
(entry: Record<string, any>) => entry.id === "FE-GATE-009",
(entry: Record<string, any>) => entry.id === "FE-GATE-028",
);
const artifactId =
"artifact-artifacts-tests-a11y-manual-TECH-LOG-HOME-md";
@@ -231,8 +228,121 @@ describe("CI gate contract", () => {
);
expect(() =>
parseCiGateContract(candidate, { mode: "removal-fixture" }),
).toThrow(/FE-GATE-009 manual accessibility evidence.*installed route scope/i);
parseCiGateContract(candidate),
).toThrow(/FE-GATE-028 manual accessibility evidence.*installed route scope/i);
});
it("runs the signed manual accessibility review at release, not merge (08-06)", async () => {
const contract = await loadCiGateContract(process.cwd());
const index = indexCiGateContract(contract);
const scriptsOf = (gateId: string) =>
(index.gates.get(gateId)?.commandIds ?? []).map((id) => {
const command = index.commands.get(id);
return [command?.script, ...(command?.args ?? [])].join(" ");
});
const stageOf = (gateId: string) =>
contract.stages.find(({ gateIds }) => gateIds.includes(gateId))?.id;
expect(scriptsOf("FE-GATE-009")).toEqual(["test:a11y", "review:a11y-manual -- --format-only"]);
expect(scriptsOf("FE-GATE-028")).toEqual(["review:a11y-manual"]);
expect(stageOf("FE-GATE-009")).toBe("merge");
expect(stageOf("FE-GATE-028")).toBe("release");
});
it("runs the CPU-independent scale PR tier in a merge gate (11-03)", async () => {
const contract = await loadCiGateContract(process.cwd());
const index = indexCiGateContract(contract);
const scripts = index.gates.get("FE-GATE-005")?.commandIds.map((id) => index.commands.get(id)?.script);
expect(scripts).toContain("check:scale:pr");
expect(contract.stages.find(({ id }) => id === "merge")?.gateIds).toContain("FE-GATE-005");
});
it("probes live hosting headers after promotion, not before the release is built (13-05)", async () => {
const contract = await loadCiGateContract(process.cwd());
expect(contract.stages.find(({ id }) => id === "production")?.gateIds).toContain("FE-GATE-019");
expect(contract.stages.find(({ id }) => id === "release")?.gateIds).not.toContain("FE-GATE-019");
const productionGate = contract.jobs.find(({ id }) => id === "production_gate");
expect(productionGate?.gateIds).toContain("FE-GATE-019");
expect(productionGate?.environment).toContainEqual({
name: "HOSTING_BASE_URL",
value: "${{ vars.HOSTING_BASE_URL }}",
});
});
it("drills the downloaded promoted archive in the production stage without rebuilding (13-03)", async () => {
const contract = await loadCiGateContract(process.cwd());
const index = indexCiGateContract(contract);
const productionGate = contract.jobs.find(({ id }) => id === "production_gate");
const kinds = productionGate?.steps.map(({ kind }) => kind) ?? [];
const download = productionGate?.steps.find((step) => step.kind === "download");
const extract = productionGate?.steps.find((step) => step.kind === "extract");
expect(download).toEqual({
kind: "download",
transferId: "promoted-release",
path: ".release/promoted",
});
expect(extract).toEqual({
kind: "extract",
archivePath: ".release/promoted/release-candidate.tar.gz",
targetRoot: ".release/promoted-release",
});
expect(kinds.indexOf("download")).toBeLessThan(kinds.indexOf("extract"));
expect(kinds.indexOf("extract")).toBeLessThan(kinds.indexOf("run-gate"));
// The extract step checks the archive against the digest immutable_build
// recorded, so the drilled bytes are the promoted candidate.
expect(productionGate?.needs).toContain("immutable_build");
expect(productionGate?.environment).toContainEqual({
name: "CANDIDATE_ARCHIVE_SHA256",
value: "${{ needs.immutable_build.outputs.archive_sha256 }}",
});
for (const gateId of ["FE-GATE-021", "FE-GATE-022", "FE-GATE-023", "FE-GATE-024", "FE-GATE-025"]) {
const commands = index.gates.get(gateId)?.commandIds.map((id) => index.commands.get(id)!) ?? [];
expect(commands.map(({ script }) => script), gateId).toEqual(["drill:runbook"]);
const args = commands[0]?.args ?? [];
expect(args[args.indexOf("--release-root") + 1], gateId).toBe(".release/promoted-release");
}
const workflow = renderCiWorkflow(contract);
const productionJob = workflow.slice(
workflow.indexOf(" production_gate:\n"),
workflow.indexOf(" field_gate:\n"),
);
const downloadAt = productionJob.indexOf("- name: Download promoted release");
const extractAt = productionJob.indexOf(
'--archive ".release/promoted/release-candidate.tar.gz" --extract-to ".release/promoted-release"',
);
expect(downloadAt).toBeGreaterThan(0);
expect(extractAt).toBeGreaterThan(downloadAt);
expect(productionJob.indexOf("Run blocking gate")).toBeGreaterThan(extractAt);
});
it.each([
[
"a drill without --release-root",
(contract: Record<string, any>) => {
const drill = contract.commands.find((command: Record<string, any>) => command.id === "drill-runbook");
drill.args = ["--", "FE-RB-005"];
},
],
[
"a drill gate that rebuilds from source",
(contract: Record<string, any>) => {
const gate = contract.gates.find((candidate: Record<string, any>) => candidate.id === "FE-GATE-025");
gate.commandIds = ["build", ...gate.commandIds];
},
],
[
"a production stage without the promoted archive",
(contract: Record<string, any>) => {
const job = contract.jobs.find((candidate: Record<string, any>) => candidate.id === "production_gate");
job.steps = job.steps.filter((step: Record<string, any>) => !["download", "extract"].includes(step.kind));
},
],
])("rejects %s in the production stage (13-03)", async (_name, mutate) => {
const contract = JSON.parse(
JSON.stringify(await loadCiGateContract(process.cwd())),
) as Record<string, any>;
mutate(contract);
expect(() => parseCiGateContract(contract)).toThrow(/promoted/iu);
});
it("keeps the action registry recursively immutable and resolves only known actions", () => {
@@ -358,10 +468,12 @@ describe("CI gate contract", () => {
gate.name = `${gate.name}-renamed`;
await writeFile(path.join(root, "config/ci/gates.json"), `${JSON.stringify(contract)}\n`);
await writeFile(path.join(root, "package.json"), await readFile("package.json"));
await expect(loadCiGateContract(root)).rejects.toThrow(
/canonical gate semantic shape/i,
await writeFile(
path.join(root, "config/ci/contract-baseline.json"),
await readFile("config/ci/contract-baseline.json"),
);
await expect(loadCiGateContract(root)).rejects.toThrow(/gateShapeSha256: baseline/i);
});
it.each(["check:artifact-schemas", "check:ci-workflow"])(
@@ -1353,6 +1465,10 @@ describe("CI gate contract", () => {
await writeFile(path.join(root, "config/ci/gates.json"), `${JSON.stringify(contract)}\n`);
await writeFile(path.join(root, "package.json"), await readFile("package.json"));
await writeFile(path.join(root, ".nvmrc"), await readFile(".nvmrc"));
await writeFile(
path.join(root, "config/ci/contract-baseline.json"),
await readFile("config/ci/contract-baseline.json"),
);
const drift = Buffer.from("drifted workflow\n", "utf8");
await writeFile(path.join(root, ".gitea/workflows/quality-gates.yml"), drift);
const result = spawnSync(process.execPath, [path.resolve("scripts/check-ci-contract.ts")], {
@@ -1394,7 +1510,10 @@ describe("CI workflow generation", () => {
).toHaveLength(9);
expect(first).not.toMatch(/corepack pnpm install --frozen-lockfile$/mu);
expect(first).toContain("verify-ci-candidate-archive.ts --archive");
expect(first).not.toContain("--extract-to");
// Providers and promotion read the archive without extracting it; only the
// production drills extract the promoted archive (13-03).
expect(first.match(/--extract-to/gu)).toHaveLength(1);
expect(first.indexOf("--extract-to")).toBeGreaterThan(first.indexOf(" production_gate:\n"));
expect(first).not.toMatch(/\btar\s+[^\n]*--extract/u);
expect(first).toContain("node scripts/stage-verified-promotion.ts");
expect(first).toContain("outputs:\n invocation_nonce: ${{ steps.supervise_vulnerability.outputs.invocation_nonce }}");
@@ -1424,7 +1543,7 @@ describe("CI workflow generation", () => {
'if [ -n "$PROMOTION_STAGING_ROOT" ] && [ -n "$PROMOTION_CLEANUP_TOKEN" ] && [ -n "$PROMOTION_RUNNER_TEMP_DEV" ] && [ -n "$PROMOTION_RUNNER_TEMP_INO" ] && [ -n "$PROMOTION_STAGING_DEV" ] && [ -n "$PROMOTION_STAGING_INO" ]; then',
);
const actionUses = [...first.matchAll(/^\s+-?\s*uses: (.+)$/gmu)].map((match) => match[1]);
expect(actionUses).toHaveLength(32);
expect(actionUses).toHaveLength(33);
expect(new Set(actionUses)).toEqual(
new Set([
"https://github.com/actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5",
@@ -1436,6 +1555,40 @@ describe("CI workflow generation", () => {
expect(actionUses.every((uses) => /^https:\/\/github\.com\/[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+@[0-9a-f]{40}$/u.test(uses!))).toBe(true);
});
// 12-01: main is the integration branch; a push there must run the gates.
it("runs on pushes to main", async () => {
const workflow = renderCiWorkflow(await loadCiGateContract(process.cwd()));
// This product integrates on `main` only; the template also lists `develop`.
expect(workflow).toMatch(/^on:\n {2}push:\n {4}branches: \[main\]$/mu);
});
// 12-02 / 13-01: immutable_build owns FE-GATE-015 and FE-GATE-027, but only
// the first gate of a non-matrix job was ever rendered, so release admission
// never ran in CI.
it("runs every gate a job owns, in order", async () => {
const contract = await loadCiGateContract(process.cwd());
const workflow = renderCiWorkflow(contract);
const immutable = workflow.slice(
workflow.indexOf(" immutable_build:\n"),
workflow.indexOf(" vulnerability_provider:\n"),
);
expect([...immutable.matchAll(/ci:gate -- (FE-GATE-\d{3})$/gmu)].map((match) => match[1]))
.toEqual(["FE-GATE-015", "FE-GATE-027"]);
expect(workflowGateExecutionFailures(contract, workflow)).toEqual([]);
});
it.each([
["a non-matrix gate step", " run: corepack pnpm ci:gate -- FE-GATE-027\n", "FE-GATE-027"],
["a matrix entry", " - { gate: FE-GATE-020, name: removability, browser: false }\n", "FE-GATE-020"],
])("rejects a workflow that drops %s", async (_name, line, gateId) => {
const contract = await loadCiGateContract(process.cwd());
const workflow = renderCiWorkflow(contract);
expect(workflow).toContain(line);
expect(workflowGateExecutionFailures(contract, workflow.replace(line, ""))).toEqual([
`gate is not executed by any workflow run step: ${gateId}`,
]);
});
it("derives download artifact names from the typed upload producer", async () => {
const contract = await loadCiGateContract(process.cwd());
const candidate = JSON.parse(JSON.stringify(contract)) as Record<string, any>;