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
+163
View File
@@ -18,6 +18,13 @@ import {
createWebPushRegistrationGateway,
type WebPushRegistrationExecutor,
} from "../../src/adapters/web-push/push-registration-gateway.ts";
import { createPushAssociationFenceStore } from "../../src/adapters/web-push/push-association-fence-store.ts";
import { createWebPushSubscriptionAdapter } from "../../src/adapters/web-push/push-subscription-adapter.ts";
import { createFakePushControlStoreDependencies } from "../helpers/fake-push-control-repository.ts";
import {
base64UrlDecode,
base64UrlEncode,
} from "../../src/adapters/web-push/codec-primitives.ts";
const now = Date.parse("2026-07-28T00:00:00.000Z");
@@ -130,6 +137,29 @@ describe("Web Push contracts", () => {
});
});
it("rejects duplicate keys at any depth without a nesting budget", () => {
const deepDeclarative = {
web_push: 8030,
notification: { title: "t", data: { a: [[[[{ b: 1 }]]]] } },
};
expect(
decodeWebPushHint(encoded(deepDeclarative), now),
).toMatchObject({
ok: false,
error: { code: "DECLARATIVE_PUSH_FORBIDDEN" },
});
const nestedDuplicate = JSON.stringify(deepDeclarative).replace(
'"title":"t"',
'"title":"t","title":"u"',
);
expect(
decodeWebPushHint(new TextEncoder().encode(nestedDuplicate), now),
).toMatchObject({
ok: false,
error: { code: "CONTRACT_REJECTED" },
});
});
it("uses an injected closed notification and route registry", async () => {
const registry = createWebPushNotificationRegistry([
{
@@ -253,3 +283,136 @@ describe("Web Push contracts", () => {
});
});
});
/**
* Q-6.6-12. The web-push files each carried their own base64url decoder,
* opaque-id pattern, authority check and exact-record check. These pin what
* every caller observes, so merging them into one module cannot loosen any.
*/
describe("web-push codec primitives as seen by their callers (Q-6.6-12)", () => {
const authority = {
fenceGeneration: "fence_01",
sessionBindingEpoch: "session_01",
releaseEpoch: "release_01",
};
const p256dhBytes = new Uint8Array(65);
p256dhBytes[0] = 4;
const material = {
endpoint: "https://push.example.test/subscription/opaque",
p256dh: Buffer.from(p256dhBytes).toString("base64url"),
auth: Buffer.from(new Uint8Array(16)).toString("base64url"),
expirationTime: null,
};
/** 87 chars carry 2 spare bits and 22 chars carry 4; they must be zero. */
const withSpareBitSet = (encoded: string) =>
`${encoded.slice(0, -1)}${encoded.endsWith("A") ? "B" : "A"}`;
const registered: WebPushRegistrationExecutor = {
async execute() {
return webPushSuccess({
protocol: WEB_PUSH_PROTOCOLS.registration,
associationEpoch: "association_01",
sessionBindingEpoch: "session_01",
});
},
};
it("rejects subscription keys whose spare base64url bits are set", async () => {
const gateway = createWebPushRegistrationGateway(registered);
for (const broken of [
{ ...material, p256dh: withSpareBitSet(material.p256dh) },
{ ...material, auth: withSpareBitSet(material.auth) },
]) {
expect(
await gateway.register({
material: broken,
authority,
idempotencyKey: "idempotency_01",
}),
).toMatchObject({ ok: false, error: { code: "INVALID_INPUT" } });
}
});
it("rejects a VAPID key whose spare base64url bits are set", () => {
const key = new Uint8Array(65);
key[0] = 4;
const valid = Buffer.from(key).toString("base64url");
expect(() =>
createWebPushSubscriptionAdapter({
vapidPublicKey: withSpareBitSet(valid),
} as never),
).toThrow(TypeError);
});
it("rejects a null authority as invalid input in the fence store", async () => {
const store = createPushAssociationFenceStore(
createFakePushControlStoreDependencies(),
);
expect(
await store.prepare({
authority: null as never,
updatedAt: "2026-07-28T00:00:00.000Z",
}),
).toMatchObject({ ok: false, error: { code: "INVALID_INPUT" } });
});
it("rejects a null authority as invalid input in the gateway", async () => {
const gateway = createWebPushRegistrationGateway(registered);
await expect(
gateway.register({
material,
authority: null as never,
idempotencyKey: "idempotency_01",
}),
).resolves.toMatchObject({ ok: false, error: { code: "INVALID_INPUT" } });
await expect(
gateway.reconcile({ material, authority: null as never }),
).resolves.toMatchObject({ ok: false, error: { code: "INVALID_INPUT" } });
});
it("rejects backend answers that are arrays or carry extra keys", async () => {
for (const answer of [
[WEB_PUSH_PROTOCOLS.revoke, "REVOKED"],
{ protocol: WEB_PUSH_PROTOCOLS.revoke, state: "REVOKED", extra: 1 },
]) {
const gateway = createWebPushRegistrationGateway({
execute: async () => webPushSuccess(answer),
});
expect(
await gateway.revoke({ associationEpoch: "association_01" }),
).toMatchObject({ ok: false, error: { code: "CONTRACT_REJECTED" } });
}
});
it("gives every accepted base64url string exactly one decoding", () => {
expect([...base64UrlDecode("AQID")!]).toEqual([1, 2, 3]);
expect([...base64UrlDecode("AQ")!]).toEqual([1]);
expect(base64UrlDecode("")?.byteLength).toBe(0);
// "AQIDA": a lone trailing character cannot finish a byte. The window
// adapter's old copy accepted it because its spare bits were zero.
for (const invalid of ["A", "AQIDA", "AR", "AQ==", "AQ+/", null, 7]) {
expect(base64UrlDecode(invalid), String(invalid)).toBeNull();
}
});
it("encodes base64url exactly like Node and round-trips through the decoder", () => {
for (let length = 0; length <= 66; length += 1) {
const bytes = Uint8Array.from({ length }, (_, index) => (index * 37 + 11) & 255);
const encoded = base64UrlEncode(bytes);
expect(encoded).toBe(Buffer.from(bytes).toString("base64url"));
expect([...base64UrlDecode(encoded)!]).toEqual([...bytes]);
}
});
it("rejects opaque ids outside the shared pattern", async () => {
const gateway = createWebPushRegistrationGateway(registered);
for (const associationEpoch of ["", "-leading", "a b", "a".repeat(129)]) {
expect(await gateway.revoke({ associationEpoch })).toMatchObject({
ok: false,
error: { code: "INVALID_INPUT" },
});
}
expect(
decodeWebPushHint(encoded(hint({ notificationId: "a b" })), now),
).toMatchObject({ ok: false });
});
});