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
@@ -1,4 +1,17 @@
import { formatMessage } from "../i18n/index.ts";
import { BOOT_MESSAGES } from "../i18n/boot-messages.ts";
// 09-03. Read from the boot messages alone, not the i18n catalog: the shell
// has to render when the installed feature graph failed to evaluate.
const MESSAGES = BOOT_MESSAGES["ko-KR"];
// 09-10. Failures a fresh load can fix: the config or manifest request did
// not complete. Retrying stays a user action; nothing reloads on its own.
const RETRYABLE_CODES: ReadonlySet<string> = new Set([
"CONFIG_FETCH_FAILED",
"CONFIG_TIMEOUT",
"MANIFEST_FETCH_FAILED",
"MANIFEST_TIMEOUT",
]);
export type BootErrorShellProps = Readonly<{
kind?: string;
@@ -6,48 +19,69 @@ export type BootErrorShellProps = Readonly<{
buildId?: string;
configSchemaVersion?: string;
releaseId?: string;
invalidKeys?: readonly string[];
supportReference: string;
onRetry?: () => void;
}>;
export function BootErrorShell({
kind = "BOOT_CONFIG_FAILURE",
// 09-04. A failure nobody classified is not a configuration failure.
kind = "BOOT_UNEXPECTED_FAILURE",
code = "BOOT_FAILED",
buildId,
configSchemaVersion,
releaseId,
invalidKeys,
supportReference,
onRetry,
}: BootErrorShellProps) {
const retry = onRetry !== undefined && RETRYABLE_CODES.has(code);
return (
<main role="alert">
<h1>{formatMessage("ko-KR", "boot.failure.title")}</h1>
<h1>{MESSAGES["boot.failure.title"]}</h1>
<dl>
<dt>{formatMessage("ko-KR", "boot.field.error")}</dt>
<dt>{MESSAGES["boot.field.error"]}</dt>
<dd>{kind}</dd>
<dt>{formatMessage("ko-KR", "boot.field.code")}</dt>
<dt>{MESSAGES["boot.field.code"]}</dt>
<dd>{code}</dd>
{buildId && (
<>
<dt>{formatMessage("ko-KR", "boot.field.build")}</dt>
<dt>{MESSAGES["boot.field.build"]}</dt>
<dd>{buildId}</dd>
</>
)}
{configSchemaVersion && (
<>
<dt>{formatMessage("ko-KR", "boot.field.configSchema")}</dt>
<dt>{MESSAGES["boot.field.configSchema"]}</dt>
<dd>{configSchemaVersion}</dd>
</>
)}
{releaseId && (
<>
<dt>{formatMessage("ko-KR", "boot.field.release")}</dt>
<dt>{MESSAGES["boot.field.release"]}</dt>
<dd>{releaseId}</dd>
</>
)}
{invalidKeys && invalidKeys.length > 0 && (
<>
<dt>{MESSAGES["boot.field.invalidKeys"]}</dt>
<dd>{invalidKeys.join(", ")}</dd>
</>
)}
</dl>
{retry && (
<>
<p>{MESSAGES["boot.retry.hint"]}</p>
<button type="button" onClick={onRetry}>
{MESSAGES["boot.retry.action"]}
</button>
</>
)}
<p>
{formatMessage("ko-KR", "boot.supportReference", {
reference: supportReference,
})}
{MESSAGES["boot.supportReference"].replace(
"{reference}",
() => supportReference,
)}
</p>
</main>
);
@@ -3,7 +3,9 @@ import {
type ErrorInfo,
type ReactNode,
} from "react";
import { Button, LoadingSurface } from "../design-system/index.ts";
import { useLocale } from "../i18n/index.ts";
import { newIncidentId } from "./render-error-boundary.tsx";
type RecoveryResult =
| Readonly<{ action: "reload-once"; releasePair: string }>
@@ -16,12 +18,17 @@ type Props = Readonly<{
chunkId: string;
failureKind: "CHUNK_LOAD_FAILURE";
}>): Promise<RecoveryResult>;
/** 08-07. Shown with the incident id as the support reference. */
buildId?: string;
/** 08-07. Records the incident id the support surface shows. */
onUnrecovered?: (incidentId: string) => void;
}>;
type State = Readonly<{
error: unknown | null;
recovery: "idle" | "checking" | "reload-requested" | "support";
reason?: string;
incidentId?: string;
}>;
export function isChunkLoadFailure(error: unknown): boolean {
@@ -31,7 +38,11 @@ export function isChunkLoadFailure(error: unknown): boolean {
value.includes("chunkloaderror") ||
value.includes("loading chunk") ||
value.includes("dynamically imported module") ||
value.includes("failed to fetch module script")
value.includes("failed to fetch module script") ||
// WebKit's wording for the same failed dynamic import.
value.includes("importing a module script failed") ||
// Vite rethrows a `vite:preloadError` into the import unless prevented.
value.includes("unable to preload css")
);
}
@@ -50,26 +61,29 @@ export class ChunkRecoveryBoundary extends Component<Props, State> {
failureKind: "CHUNK_LOAD_FAILURE",
})
.then((result) => {
this.setState({
error,
recovery:
result.action === "reload-once"
? "reload-requested"
: "support",
...(result.action === "support" ? { reason: result.reason } : {}),
});
if (result.action === "support") {
this.showSupport(error, result.reason);
} else {
this.setState({ error, recovery: "reload-requested" });
}
})
.catch(() => {
this.setState({
error,
recovery: "support",
reason: "recovery-controller-failed",
});
this.showSupport(error, "recovery-controller-failed");
});
}
private showSupport(error: unknown, reason: string) {
const incidentId = newIncidentId();
this.setState({ error, recovery: "support", reason, incidentId });
try {
this.props.onUnrecovered?.(incidentId);
} catch {
// Diagnostics must never hide the recovery surface.
}
}
render() {
const { error, recovery, reason } = this.state;
const { error, recovery, reason, incidentId } = this.state;
if (error && !isChunkLoadFailure(error)) throw error;
if (error && recovery === "checking") {
return <ChunkRecoverySurface recovery="checking" />;
@@ -78,7 +92,15 @@ export class ChunkRecoveryBoundary extends Component<Props, State> {
return <ChunkRecoverySurface recovery="reload-requested" />;
}
if (error && recovery === "support") {
return <ChunkRecoverySurface recovery="support" reason={reason} />;
return (
<ChunkRecoverySurface
recovery="support"
reason={reason}
supportReference={[this.props.buildId, incidentId]
.filter(Boolean)
.join(":")}
/>
);
}
return this.props.children;
}
@@ -87,16 +109,18 @@ export class ChunkRecoveryBoundary extends Component<Props, State> {
function ChunkRecoverySurface({
recovery,
reason,
supportReference,
}: Readonly<{
recovery: Exclude<State["recovery"], "idle">;
reason?: string;
supportReference?: string;
}>) {
const { message } = useLocale();
if (recovery === "checking") {
return (
<section className="ui-page" aria-live="polite" aria-busy="true">
{message("chunk.checking")}
</section>
<div className="ui-page">
<LoadingSurface description={message("chunk.checking")} />
</div>
);
}
if (recovery === "reload-requested") {
@@ -110,6 +134,17 @@ function ChunkRecoverySurface({
<section className="ui-page" role="alert" data-recovery-reason={reason}>
<h1>{message("chunk.failure.title")}</h1>
<p>{message("chunk.failure.description")}</p>
{/* The automatic reload-once already declined; this one is the user's. */}
<Button onClick={() => window.location.reload()}>
{message("action.reloadOnce")}
</Button>
{supportReference ? (
<p>
{message("template.supportReference", {
reference: supportReference,
})}
</p>
) : null}
</section>
);
}
@@ -1,7 +1,7 @@
import { Component, type ReactNode } from "react";
import type { RenderFailureReport } from "../../application/ports/in/application-api.ts";
import { formatMessage } from "../i18n/index.ts";
import { useLocale } from "../i18n/index.ts";
export type RenderBoundaryProps = Readonly<{
children: ReactNode;
@@ -10,10 +10,24 @@ export type RenderBoundaryProps = Readonly<{
buildId: string;
resetKey?: string;
onRenderFailure?: (report: RenderFailureReport) => void;
fallback?: ReactNode;
/** A function receives the incident id the failure was reported with. */
fallback?: ReactNode | ((incidentId: string) => ReactNode);
}>;
type RenderBoundaryState = Readonly<{ hasError: boolean }>;
type RenderBoundaryState = Readonly<{
hasError: boolean;
incidentId?: string;
}>;
/**
* 08-07. A short id a failure page shows as its support reference and the
* render diagnostic records, so a user's report finds the event.
* `getRandomValues` also works outside secure contexts, unlike `randomUUID`.
*/
export function newIncidentId(): string {
const [value = 0] = crypto.getRandomValues(new Uint32Array(1));
return value.toString(16).padStart(8, "0");
}
export class RenderErrorBoundary extends Component<
RenderBoundaryProps,
@@ -22,7 +36,7 @@ export class RenderErrorBoundary extends Component<
state: RenderBoundaryState = { hasError: false };
static getDerivedStateFromError(): RenderBoundaryState {
return { hasError: true };
return { hasError: true, incidentId: newIncidentId() };
}
componentDidCatch(): void {
@@ -31,6 +45,9 @@ export class RenderErrorBoundary extends Component<
routeId: this.props.routeId,
buildId: this.props.buildId,
boundaryName: this.props.boundaryName,
...(this.state.incidentId === undefined
? {}
: { incidentId: this.state.incidentId }),
});
} catch {
// Diagnostics must never recurse into another render failure.
@@ -49,21 +66,29 @@ export class RenderErrorBoundary extends Component<
render(): ReactNode {
if (this.state.hasError) {
return (
this.props.fallback ?? (
<section role="alert">
<p>{formatMessage("ko-KR", "error.render_failure")}</p>
<button type="button" onClick={this.reset}>
{formatMessage("ko-KR", "action.retry")}
</button>
</section>
)
);
const { fallback } = this.props;
if (typeof fallback === "function") {
return fallback(this.state.incidentId ?? newIncidentId());
}
return fallback ?? <DefaultRenderFailure onRetry={this.reset} />;
}
return this.props.children;
}
}
/** The default fallback, in the current locale. */
function DefaultRenderFailure({ onRetry }: Readonly<{ onRetry(): void }>) {
const { message } = useLocale();
return (
<section role="alert">
<p>{message("error.render_failure")}</p>
<button type="button" onClick={onRetry}>
{message("action.retry")}
</button>
</section>
);
}
export function RouteBoundary(
props: Omit<RenderBoundaryProps, "boundaryName">,
) {