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 at8210d48. 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 at8210d48first 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:
@@ -106,6 +106,25 @@ function manualScheduler(): Readonly<{
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 06-01. WebIDL shape of a real `Notification`: `data` is a getter and
|
||||
* `close` a method on the prototype, so the instance has no own keys
|
||||
* (checked in Chromium, Firefox and WebKit).
|
||||
*/
|
||||
class WebIdlNotification {
|
||||
readonly #data: unknown;
|
||||
closed = 0;
|
||||
constructor(data: unknown) {
|
||||
this.#data = data;
|
||||
}
|
||||
get data(): unknown {
|
||||
return this.#data;
|
||||
}
|
||||
close(): void {
|
||||
this.closed += 1;
|
||||
}
|
||||
}
|
||||
|
||||
describe("Web Push worker runtime", () => {
|
||||
it("waits for strict hint handling and shows only registry-owned safe copy", async () => {
|
||||
const store = await activeFence();
|
||||
@@ -346,6 +365,167 @@ describe("Web Push worker runtime", () => {
|
||||
expect(focus).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
describe("a rejected click opens the app root (Q-6.6-11, D-14)", () => {
|
||||
async function rejectedClick(
|
||||
options: Readonly<{ at?: number; data?: unknown }>,
|
||||
) {
|
||||
const store = await activeFence();
|
||||
const postMessage = vi.fn();
|
||||
const focus = vi.fn(async () => {});
|
||||
const openWindow = vi.fn(async (url: string) => ({
|
||||
url,
|
||||
focus: async () => {},
|
||||
postMessage() {},
|
||||
}));
|
||||
const observations: unknown[] = [];
|
||||
const adapter = createNotificationClickAdapter({
|
||||
fenceStore: store,
|
||||
registry,
|
||||
origin: "https://app.example.test",
|
||||
now: () => options.at ?? now,
|
||||
observer: {
|
||||
record(observation) {
|
||||
observations.push(observation);
|
||||
},
|
||||
},
|
||||
clients: {
|
||||
async matchControlledWindowClients() {
|
||||
return [
|
||||
{ url: "https://app.example.test/current", focus, postMessage },
|
||||
];
|
||||
},
|
||||
openWindow,
|
||||
},
|
||||
});
|
||||
let waited: Promise<void> | null = null;
|
||||
const result = await adapter.handle({
|
||||
notification: { data: options.data ?? clickData(), close() {} },
|
||||
waitUntil(task) {
|
||||
waited = task;
|
||||
},
|
||||
});
|
||||
await waited;
|
||||
return { result, openWindow, focus, postMessage, observations };
|
||||
}
|
||||
|
||||
it("opens the root without handoff data for an expired click", async () => {
|
||||
const click = await rejectedClick({
|
||||
at: Date.parse("2026-07-28T02:00:00.000Z"),
|
||||
});
|
||||
|
||||
expect(click.result).toMatchObject({
|
||||
ok: false,
|
||||
error: { code: "EXPIRED" },
|
||||
});
|
||||
expect(click.openWindow.mock.calls).toEqual([
|
||||
["https://app.example.test/"],
|
||||
]);
|
||||
expect(click.postMessage).not.toHaveBeenCalled();
|
||||
expect(click.focus).not.toHaveBeenCalled();
|
||||
expect(click.observations).toContainEqual({
|
||||
event: "web_push_click_dispatched",
|
||||
outcome: "FAILED",
|
||||
reason: "EXPIRED",
|
||||
nativeEffect: "CONFIRMED",
|
||||
});
|
||||
});
|
||||
|
||||
it("opens the root for a click from another release", async () => {
|
||||
const click = await rejectedClick({
|
||||
data: { ...clickData(), releaseEpoch: "release_02" },
|
||||
});
|
||||
|
||||
expect(click.result).toMatchObject({
|
||||
ok: false,
|
||||
error: { code: "RELEASE_MISMATCH" },
|
||||
});
|
||||
expect(click.openWindow.mock.calls).toEqual([
|
||||
["https://app.example.test/"],
|
||||
]);
|
||||
expect(click.postMessage).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
// 06-09. Under a router base path the app root is the registration
|
||||
// scope, not the origin root.
|
||||
it("opens the registration scope under a base path", async () => {
|
||||
const store = await activeFence();
|
||||
const listeners = new Map<string, (event: unknown) => void>();
|
||||
const openWindow = vi.fn(async () => null);
|
||||
const runtime = createWebPushServiceWorkerRuntime({
|
||||
fenceStore: store,
|
||||
registry,
|
||||
now: () => Date.parse("2026-07-28T02:00:00.000Z"),
|
||||
host: {
|
||||
origin: "https://app.example.test",
|
||||
scope: "https://app.example.test/app/",
|
||||
registration: { async showNotification() {} },
|
||||
clients: { matchAll: async () => [], openWindow },
|
||||
addEventListener(type, listener) {
|
||||
listeners.set(type, listener);
|
||||
},
|
||||
removeEventListener() {},
|
||||
},
|
||||
});
|
||||
let waited: Promise<void> | null = null;
|
||||
listeners.get("notificationclick")?.({
|
||||
notification: new WebIdlNotification(clickData()),
|
||||
waitUntil(task: Promise<void>) {
|
||||
waited = task;
|
||||
},
|
||||
});
|
||||
await waited;
|
||||
|
||||
expect(openWindow.mock.calls).toEqual([
|
||||
["https://app.example.test/app/"],
|
||||
]);
|
||||
runtime.dispose();
|
||||
});
|
||||
|
||||
it("refuses an app root outside the origin", async () => {
|
||||
expect(() =>
|
||||
createNotificationClickAdapter({
|
||||
fenceStore: createPushAssociationFenceStore(
|
||||
createFakePushControlStoreDependencies(),
|
||||
),
|
||||
registry,
|
||||
origin: "https://app.example.test",
|
||||
appRootUrl: "https://other.example.test/app/",
|
||||
clients: {
|
||||
matchControlledWindowClients: async () => [],
|
||||
openWindow: async () => null,
|
||||
},
|
||||
}),
|
||||
).toThrow(TypeError);
|
||||
});
|
||||
|
||||
it("does not retry the root after the browser refused the target window", async () => {
|
||||
const store = await activeFence();
|
||||
const openWindow = vi.fn(async () => null);
|
||||
const adapter = createNotificationClickAdapter({
|
||||
fenceStore: store,
|
||||
registry,
|
||||
origin: "https://app.example.test",
|
||||
now: () => now,
|
||||
clients: {
|
||||
matchControlledWindowClients: async () => [],
|
||||
openWindow,
|
||||
},
|
||||
});
|
||||
|
||||
const result = await adapter.handle({
|
||||
notification: { data: clickData(), close() {} },
|
||||
waitUntil() {},
|
||||
});
|
||||
expect(result).toMatchObject({
|
||||
ok: false,
|
||||
error: { code: "NATIVE_FAILURE" },
|
||||
});
|
||||
expect(openWindow.mock.calls).toEqual([
|
||||
["https://app.example.test/inbox"],
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
it("aborts in-flight push work when the worker runtime is disposed", async () => {
|
||||
const store = await activeFence();
|
||||
const listeners = new Map<string, (event: unknown) => void>();
|
||||
@@ -595,13 +775,18 @@ describe("Web Push worker runtime", () => {
|
||||
"pushsubscriptionchange",
|
||||
]);
|
||||
let clickWait: Promise<void> | null = null;
|
||||
const notification = new WebIdlNotification(clickData());
|
||||
expect(Object.keys(notification)).toEqual(["closed"]);
|
||||
expect(Object.hasOwn(notification, "data")).toBe(false);
|
||||
listeners.get("notificationclick")?.({
|
||||
notification: { data: clickData(), close() {} },
|
||||
notification,
|
||||
waitUntil(task: Promise<void>) {
|
||||
clickWait = task;
|
||||
},
|
||||
});
|
||||
expect(clickWait).not.toBeNull();
|
||||
await clickWait;
|
||||
expect(notification.closed).toBe(1);
|
||||
let subscriptionWait: Promise<void> | null = null;
|
||||
listeners.get("pushsubscriptionchange")?.({
|
||||
waitUntil(task: Promise<void>) {
|
||||
|
||||
Reference in New Issue
Block a user