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
@@ -0,0 +1,21 @@
import { describe, expect, it } from "vitest";
import { createExternalAuthSessionAdapter } from "../../../src/adapters/auth/external-session-adapter.ts";
import { createBffSessionOwner } from "../../../src/features/tech-log/adapters/http/bff-session-owner.ts";
// Template sync (af3d8e6). The runtime closes an external owner without
// `readSubject` as `integration-failed`; the HTTP Studio's only owner is this one.
describe("BFF session owner", () => {
it("is a complete external owner and names no subject", async () => {
const owner = createBffSessionOwner(
"https://api.example.test/",
async () => new Response(null, { status: 401 }),
);
// Compiles only while the owner has every method the adapter requires.
const session = createExternalAuthSessionAdapter(owner);
await owner.recoverSession();
expect(session.getState()).toBe("unauthenticated");
expect(session.getSubject()).toBeNull();
});
});
@@ -10,7 +10,6 @@ import {
parseCaseContent,
} from "../../../src/features/tech-log/domain/content-format/parse-case-content.ts";
import {
evidenceCatalogEntryFor,
projectWorkingCopy,
} from "../../../src/features/tech-log/domain/content-format/project-public-render-model.ts";
import { serializeCaseContent } from "../../../src/features/tech-log/domain/content-format/serialize-case-content.ts";
@@ -13,14 +13,16 @@ type Equal<Left, Right> =
: false;
type Assert<Condition extends true> = Condition;
type TechLogFeatureInputExposesNoMissingOrAdditionalKeys = Assert<
// Exported so noUnusedLocals keeps these compile-time checks rather than
// flagging them; the `Assert` constraint is what fails the typecheck.
export type TechLogFeatureInputExposesNoMissingOrAdditionalKeys = Assert<
Equal<
keyof ApplicationFeatureInputs["tech-log"],
| "publicContent"
| "createStudioApplication"
>
>;
type TechLogFeatureInputRegistryValueMatchesFeatureContract = Assert<
export type TechLogFeatureInputRegistryValueMatchesFeatureContract = Assert<
Equal<ApplicationFeatureInputs["tech-log"], TechLogFeatureInput>
>;
@@ -16,7 +16,6 @@ import { MOCK_STUDIO_INSTALL_CONTEXT } from "../../helpers/studio-install-contex
import {
TECH_LOG_ROUTE_REGISTRY,
TECH_LOG_ROUTE_RUNTIME_CONTRACT,
type TechLogRouteId,
} from "../../../src/features/tech-log/contracts/tech-log-route-contract.ts";
import { PublicShell } from "../../../src/features/tech-log/presentation/public/public-shell.tsx";
import { ExploreKindPage } from "../../../src/features/tech-log/presentation/public/pages/explore-kind-page.tsx";
@@ -105,8 +104,15 @@ async function renderDiscoveryRoute<RouteId extends DiscoveryRouteId>(
// 단언하도록 여기서 한 번 기다린다 — 각 테스트에 흩어 놓으면 빠뜨린 곳이 생긴다.
// `main` 을 기다리지 않는다 — 이 파일에는 의도적으로 렌더에 실패하는 라우트도 있고,
// 그때는 main 이 아예 없다. 로딩 표면이 사라지는 것이 두 경우 모두에 맞는 기준이다.
// Template sync (af3d8e6): the route's own loading surface is now the shared
// LoadingSurface too, so only a page's data loading is waited out here; a
// route chunk a test holds pending stays on screen.
await waitFor(() =>
expect(document.querySelector(".state-surface--loading")).toBeNull(),
expect(
[...document.querySelectorAll(".state-surface--loading")].filter(
(surface) => !surface.closest(".route-loading"),
),
).toEqual([]),
);
return { ...view, router } satisfies ReturnType<typeof render> & {
router: RouterProviderProps["router"];
@@ -391,7 +397,7 @@ describe("TechLog explore discovery", () => {
);
expect(
screen.getByText("화면을 준비하고 있습니다.").closest("section"),
screen.getByText("화면을 준비하고 있습니다.").closest(".route-loading"),
).toHaveAttribute("data-surface", "none");
await waitFor(() => expect(rejectNotFound).toBeTypeOf("function"));
await act(async () => {
@@ -423,9 +429,19 @@ describe("TechLog explore discovery", () => {
}),
}),
]);
// Template sync (af3d8e6, 08-07). An unrecovered chunk failure is now
// recorded once, by the chunk boundary, under the not-found route's own
// id and with the incident id its support reference shows. The route
// render boundary still catches nothing.
expect(
record.mock.calls.some(([entry]) => entry.eventId === "ui.render.failed"),
).toBe(false);
record.mock.calls
.map(([entry]) => entry)
.filter((entry) => entry.eventId === "ui.render.failed"),
).toEqual([
expect.objectContaining({
context: expect.objectContaining({ route_id: "NOT_FOUND" }),
}),
]);
});
});
@@ -65,8 +65,7 @@ function installedInputs(
studioSource,
publicSource,
// Template sync (ebea300). The platform capability the manifest-governed
// contributions declare in `needs`. Composition builds the reference
// feature's gateway from it and never calls it here.
// contributions declare in `needs`. Composition never calls it here.
http: {
async execute() {
throw new Error("platform executor is not used by composition tests");
@@ -82,10 +81,13 @@ function installedInputs(
});
}
test("installs TechLog beside the retained reference feature through application-facing inputs", async () => {
test("installs TechLog through application-facing inputs", async () => {
const installed = installedInputs();
assert.deepEqual(Object.keys(installed), ["reference-feature", "tech-log"]);
// Template sync (af3d8e6). The reference sample is no longer installed
// (src/features/reference-feature/NOT_INSTALLED), so TechLog is the only
// input; it is composed directly and cannot be narrowed out.
assert.deepEqual(Object.keys(installed), ["tech-log"]);
assert.deepEqual(Object.keys(installed["tech-log"]).sort(), [
"createStudioApplication",
"publicContent",
@@ -77,7 +77,9 @@ type RequiredStudioGatewayOperation =
| "getPublicationSnapshot"
| "getCatalog";
type StudioGatewayExposesNoMissingOrAdditionalOperations = Assert<
// Exported so noUnusedLocals keeps this compile-time check rather than
// flagging it; the `Assert` constraint is what fails the typecheck.
export type StudioGatewayExposesNoMissingOrAdditionalOperations = Assert<
Equal<keyof StudioGateway, RequiredStudioGatewayOperation>
>;
@@ -2,7 +2,6 @@
import { fireEvent, render as testingRender, screen, waitFor, within } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import type { ReactNode } from "react";
import { MemoryRouter } from "react-router-dom";
import { afterEach, describe, expect, it, vi } from "vitest";
@@ -1,6 +1,6 @@
// @vitest-environment jsdom
import { fireEvent, render as testingRender, screen, waitFor } from "@testing-library/react";
import { render as testingRender, screen, waitFor } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { MemoryRouter } from "react-router-dom";
import {
@@ -188,7 +188,7 @@ describe("TechLog Studio publication flow", () => {
});
});
it("keeps the publish pending state, preserves gateway command order, and retries with a new key", async () => {
it("keeps the publish pending state, preserves gateway command order, and retries with the original key", async () => {
const user = userEvent.setup();
const base = studioGatewayFromApplication(createTechLogFeatureInstalledInput(MOCK_STUDIO_INSTALL_CONTEXT).input.createStudioApplication());
const document = await warningReadyDocument(base);
@@ -243,7 +243,9 @@ describe("TechLog Studio publication flow", () => {
);
await user.click(screen.getByRole("button", { name: "게시" }));
await waitFor(() => expect(publishDocument).toHaveBeenCalledTimes(2));
expect(keys[1]).not.toBe(keys[0]);
// Template sync (af3d8e6, 03-01): a write whose outcome is unknown is sent
// again with its original idempotency key, so the backend applies it once.
expect(keys[1]).toBe(keys[0]);
});
it("filters publication events and recovers a failed history read", async () => {
@@ -1,6 +1,6 @@
// @vitest-environment jsdom
import { fireEvent, render as testingRender, screen, waitFor } from "@testing-library/react";
import { render as testingRender, screen, waitFor } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { useEffect } from "react";
import { MemoryRouter } from "react-router-dom";
@@ -176,7 +176,7 @@ describe("TechLog Studio save workflow", () => {
expect(screen.getByRole("button", { name: "저장" })).toBeDisabled();
});
it("surfaces a save error and retries with a new user-command key without losing input", async () => {
it("surfaces a save error and retries with the original user-command key without losing input", async () => {
const user = userEvent.setup();
const base = studioGatewayFromApplication(createTechLogFeatureInstalledInput(MOCK_STUDIO_INSTALL_CONTEXT).input.createStudioApplication());
const keys: string[] = [];
@@ -213,7 +213,9 @@ describe("TechLog Studio save workflow", () => {
await user.click(screen.getByRole("button", { name: "저장" }));
await waitFor(() => expect(screen.getByRole("status", { name: "편집 상태" })).toHaveTextContent("저장됨"));
expect(saveDocument).toHaveBeenCalledTimes(2);
expect(keys[1]).not.toBe(keys[0]);
// Template sync (af3d8e6, 03-01): a write whose outcome is unknown is sent
// again with its original idempotency key, so the backend applies it once.
expect(keys[1]).toBe(keys[0]);
});
});
@@ -58,6 +58,7 @@ async function renderStudio(
attachCredential: async () => ({ headers: {} }),
recoverSession: async () => "restored" as const,
notifyUnauthenticated: () => {},
readSubject: () => "studio-shell-subject",
}),
featureInputs: {
"tech-log": {