Files
tech-log-frontend/tests/features/reference-feature/reference-installed-executor.test.ts
T
DongHyeonkaandClaude Opus 5 afde2b1da1 chore: sync the frontend template from 5434760 to ebea300
Carries 21 template commits: the shared IndexedDB connection/transaction
kernel and the four runtimes moved onto it, the adapter barrel boundary and
the architecture rule that enforces it, the feature adapter contribution
model, `feature-http-binding`, the split of several oversized test files,
and the release identity now derived from the package name.

Product identity is unchanged. The three hard-coded `tech-log-frontend/…`
verifier ids are gone because the template derives them from the package
name and this package is `tech-log-frontend`.

Two decisions worth naming. The platform HTTP executor is the template's
verbatim — it now takes the installed contract so a feature's types flow
through the binding — and TechLog's four gateways, which address operations
by id, reach it through one adapter at the composition root instead of being
rewritten here. And the three derived CI baselines were recomputed from the
merged `config/ci/gates.json` rather than taken from either side: 94 command
definitions, 106 references, 141 artifacts, gate shape `629e5898…`. The
method was checked by first reproducing the pre-merge values from the
pre-merge file.

Verified here: types, lint, architecture, adapter inventory, CI contract,
design system, diagnostics, remediation ledger, browser security and build
all pass; 1789 unit, 152 component, 415 TechLog, 102 integration, 19
reference-feature, 17 recipe and 7 contract tests pass. Five gates stay
red and every one was reproduced at b297d65 first: `check:i18n`,
`check:registries`, `test:runtime-schema`, `verify:documentation` and
`test:sample-removal`.

Full decision record, including what was deliberately not carried and the
five open follow-ups, in `docs/operations/template-sync-2026-09-21.md`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-21 16:31:05 +09:00

56 lines
2.1 KiB
TypeScript

import { describe, expect, it } from "vitest";
import {
type InstalledHttpOperationExecutor,
} from "../../../src/adapters/http/index.ts";
import { createReferenceFeatureInstalledInput } from "../../../src/features/reference-feature/adapters/create-reference-feature-input.ts";
/**
* This assertion is about the reference feature, not about HTTP observability:
* it names the feature's own route ids. It used to live in
* `tests/integration/http-execution-v3-observability.test.ts`, which meant a
* platform integration file imported the removable feature's installed input.
* Removing the feature then left that file importing a deleted module, and the
* removability fixture failed on typecheck, the unit/integration run, coverage
* and residue at once — four symptoms of one misplaced test.
*/
describe("reference feature installed operation executor", () => {
it("preserves the feature route id through the installed operation executor", async () => {
const seen: Array<Readonly<Record<string, unknown>>> = [];
const implementation = async (
contract: Readonly<{ contract: Readonly<{ operationId: string }> }>,
_input: unknown,
context: Readonly<Record<string, unknown>>,
) => {
seen.push(Object.freeze({ ...context }));
const value =
contract.contract.operationId === "LIST_REFERENCE_RESOURCES"
? []
: {
id: "resource-1",
name: "Resource",
};
return Object.freeze({
kind: "SUCCESS" as const,
value,
metadata: Object.freeze({ status: 200 }),
effect: "NOT_APPLICABLE" as const,
});
};
const execute = implementation as unknown as
InstalledHttpOperationExecutor["execute"];
const installed = createReferenceFeatureInstalledInput({
http: Object.freeze({ execute }),
});
await installed.input.listResources({ limit: 20 });
await installed.input.getResource("resource-1");
expect(seen.map((context) => context.routeId)).toEqual([
"REFERENCE_RESOURCE_LIST",
"REFERENCE_RESOURCE_DETAIL",
]);
});
});