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
+131
View File
@@ -5,6 +5,9 @@ import {
createRuntimeHttpClient,
} from "../../src/bootstrap/runtime-adapters.ts";
import { createBrowserMutationIntentFactory } from "../../src/adapters/platform/browser-mutation-intent-factory.ts";
import { createApplication } from "../../src/application/create-application.ts";
import type { ApplicationFeatureId } from "../../src/application/ports/in/application-api.ts";
import { INSTALLED_PRODUCT_FEATURE_IDS } from "../../src/features/installed-product-manifest.ts";
import { TEST_HTTP_CONTRACT } from "../helpers/http-contract-fixture.ts";
type Runtime = Parameters<typeof createRuntimeAdapters>[0]["runtime"];
@@ -173,6 +176,44 @@ describe("runtime adapter composition", () => {
expect(fetcher).not.toHaveBeenCalled();
});
it("sends telemetry stamped with the release identity (13-11)", async () => {
const bodies: { events: Record<string, unknown>[] }[] = [];
const fetcher = vi.fn(async (_url: RequestInfo | URL, init?: RequestInit) => {
if (String(_url) === "https://telemetry.test/events") {
bodies.push(JSON.parse(String(init?.body)));
}
return new Response(null, { status: 204 });
});
const adapters = await createRuntimeAdapters({
runtime: {
...runtime,
config: {
...runtime.config,
TELEMETRY_ENABLED: true,
TELEMETRY_ENDPOINT: "https://telemetry.test/events",
},
} as Runtime,
release,
host: {},
fetcher: fetcher as unknown as typeof fetch,
});
adapters.outputPorts.telemetry.emit("api.request.failed", {
error_kind: "SERVER_FAILURE",
http_status_group: "5xx",
attempt_count_bucket: "1",
route_id: "TEST_ROUTE",
});
await adapters.outputPorts.telemetry.flush();
expect(bodies[0]?.events[0]).toMatchObject({
eventName: "api.request.failed",
build_id: "build-a",
release_id: "release-a",
});
adapters.infrastructure.dispose();
});
it("replaces the QueryClient and coordinator for each session generation", async () => {
const adapters = await createRuntimeAdapters({ runtime, release, host: {} });
const previousClient = adapters.infrastructure.queryClient;
@@ -241,6 +282,51 @@ describe("runtime adapter composition", () => {
expect(adapters.outputPorts.session.getState()).toBe("integration-failed");
});
describe("installed external auth owner shape", () => {
const externalRuntime: Runtime = {
...runtime,
config: { ...runtime.config, AUTH_MODE: "external" },
};
const completeOwner = () => ({
readState: () => "authenticated",
readSubject: () => "user-a",
subscribe: () => () => {},
beginSignIn: async () => {},
signOut: async () => {},
attachCredential: async () => ({ headers: {} }),
recoverSession: async () => "no-session",
notifyUnauthenticated: () => {},
});
it("uses an owner that implements every method", async () => {
const adapters = await createRuntimeAdapters({
runtime: externalRuntime,
release,
host: { __CA_FRONTEND_AUTH_OWNER__: completeOwner() },
});
expect(adapters.outputPorts.session.getState()).toBe("authenticated");
expect(adapters.outputPorts.session.getSubject()).toBe("user-a");
adapters.infrastructure.dispose();
});
it.each(["readSubject", "readState"])(
"fails closed when the owner lacks %s",
async (method) => {
const owner: Record<string, unknown> = completeOwner();
delete owner[method];
const adapters = await createRuntimeAdapters({
runtime: externalRuntime,
release,
host: { __CA_FRONTEND_AUTH_OWNER__: owner },
});
expect(adapters.outputPorts.session.getState()).toBe(
"integration-failed",
);
adapters.infrastructure.dispose();
},
);
});
it("reports the static selection when no capability override disables it", async () => {
const adapters = await createRuntimeAdapters({ runtime, release, host: {} });
@@ -280,6 +366,51 @@ describe("runtime adapter composition", () => {
expect(serviceWorker?.active).toBe(0);
});
it("gives a feature switched off by FEATURE_OVERRIDES no application API (Q-6.9-5)", async () => {
const [disabledId, ...activeIds] = INSTALLED_PRODUCT_FEATURE_IDS;
const adapters = await createRuntimeAdapters({
runtime: {
...runtime,
config: {
...runtime.config,
FEATURE_OVERRIDES: { [disabledId!]: "DISABLED" },
},
},
release,
host: {},
});
const application = createApplication(
adapters.outputPorts,
adapters.featureInputs,
);
expect(adapters.outputPorts.productFeatures.isActive(disabledId!)).toBe(false);
expect(application.features.has(disabledId!)).toBe(false);
expect(() =>
application.features.get(disabledId as ApplicationFeatureId),
).toThrow(/not installed/u);
for (const featureId of activeIds) {
expect(application.features.has(featureId)).toBe(true);
}
adapters.infrastructure.dispose();
});
it("still resolves every installed feature API when nothing is switched off", async () => {
const adapters = await createRuntimeAdapters({ runtime, release, host: {} });
const application = createApplication(
adapters.outputPorts,
adapters.featureInputs,
);
for (const featureId of INSTALLED_PRODUCT_FEATURE_IDS) {
expect(application.features.has(featureId)).toBe(true);
expect(
application.features.get(featureId as ApplicationFeatureId),
).toBeDefined();
}
adapters.infrastructure.dispose();
});
it("states contract identity as a digest for a V2 release manifest", async () => {
const adapters = await createRuntimeAdapters({ runtime, release, host: {} });