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>
This commit is contained in:
DongHyeonka
2026-09-21 16:31:05 +09:00
co-authored by Claude Opus 5
parent b297d659f5
commit afde2b1da1
196 changed files with 21854 additions and 9992 deletions
+47 -1
View File
@@ -130,6 +130,12 @@ async function main(): Promise<void> {
// let an unrelated production import satisfy the gate while Image and
// Resumable kept their own diverging copies of the same mechanics — which is
// exactly how the four hand-written versions drifted apart in the first place.
//
// 이 목록은 재검토가 이름으로 지목한 네 파일만 덮는다. 같은 두 그룹의
// `image-cdn-runtime.ts`와 `resumable-upload-runtime.ts`는 여기 없고 지금도
// 자기 abort 사본을 들고 있다. 어댑터 전체로는 23개 파일이 그렇다. 그 전수
// 이행은 abort 의미론을 바꾸는 별도 작업이라 이 목록으로 강제하지 않고,
// 아래 래칫이 개수가 늘어나는 것만 막는다.
const REQUIRED_ABORT_CONSUMERS: readonly string[] = [
"src/adapters/browser-transfer/presigned/presigned-capability-http-provider.ts",
"src/adapters/browser-transfer/presigned/presigned-transfer-executor.ts",
@@ -164,6 +170,7 @@ async function main(): Promise<void> {
const PRIMITIVE_PATH = path.resolve(
"src/adapters/platform/abortable-operation.ts",
);
const PRIMITIVE_SPECIFIER = "platform/abortable-operation.ts";
for (const consumer of REQUIRED_ABORT_CONSUMERS) {
if (!importerSet.has(consumer)) continue;
const source = readFileSync(consumer, "utf8");
@@ -181,6 +188,43 @@ async function main(): Promise<void> {
}
}
// 손수 짠 abort 배선은 줄어들기만 해야 한다.
//
// 커널 `platform/abortable-operation.ts`가 있는데도 어댑터 23개 파일이
// `addEventListener("abort")`로 같은 race/cleanup을 각자 짠다. 그 전수 이행은
// 동작이 바뀌는 큰 작업이라 한 번에 하지 않는다. 대신 개수를 여기 고정해
// 되돌아가지 못하게 한다. 이행으로 숫자가 내려가면 이 상수도 같이 내린다.
// `platform/`은 커널 자신이므로 세지 않는다.
//
// 24 → 23: `browser-transfer/resumable-upload/indexeddb-checkpoint-store.ts`가
// IndexedDB 커널로 옮겨가면서 자기 abort 리스너를 지웠다.
// 23 → 22: `storage/indexeddb/indexeddb-maintenance.ts`가 같은 이유로 지웠다.
// 22 → 21: `storage/indexeddb/indexeddb-runtime.ts`가 같은 이유로 지웠다.
// 이것으로 IndexedDB 어댑터 4벌이 모두 커널을 쓴다.
const HAND_ROLLED_ABORT_CEILING = 21;
const handRolledScan = spawnSync(
"git",
["grep", "-l", 'addEventListener("abort"', "--", "src/adapters"],
{ encoding: "utf8" },
);
const handRolledFiles = (
handRolledScan.status === 0 ? handRolledScan.stdout : ""
)
.split("\n")
.filter(Boolean)
.filter((file) => !file.startsWith("src/adapters/platform/"))
.filter((file) => !readFileSync(file, "utf8").includes(PRIMITIVE_SPECIFIER))
.sort();
if (handRolledFiles.length > HAND_ROLLED_ABORT_CEILING) {
problems.push(
`abortable-operation: hand-rolled abort wiring grew to ` +
`${handRolledFiles.length} files (ceiling ${HAND_ROLLED_ABORT_CEILING}). ` +
`Use platform/abortable-operation.ts instead of a new listener pair. ` +
`Current offenders (the new one is whichever this change added): ` +
`${handRolledFiles.join(", ")}`,
);
}
if (problems.length > 0) {
for (const problem of problems) console.error(problem);
process.exitCode = 1;
@@ -195,7 +239,9 @@ async function main(): Promise<void> {
} shared extensions PASS; ` +
`fixture node_modules linking PASS; ` +
`shared abort primitive: ${importers.length} importers ` +
`(${importers.join(", ")}) PASS`,
`(${importers.join(", ")}) PASS; ` +
`hand-rolled abort wiring: ${handRolledFiles.length}/` +
`${HAND_ROLLED_ABORT_CEILING} files (ratchet) PASS`,
);
}
+17 -1
View File
@@ -824,12 +824,13 @@ async function runGraphFixtureChecks(): Promise<GraphFixtureResult> {
"tests/fixtures/architecture/dependency-graph",
);
const allowedRoot = resolve(fixtureRoot, "allowed");
const [allowedGraph, unresolvedGraph, layerGraph, cycleGraph] =
const [allowedGraph, unresolvedGraph, layerGraph, cycleGraph, barrelGraph] =
await Promise.all([
analyzeSourceGraph(allowedRoot, "src"),
analyzeSourceGraph(resolve(fixtureRoot, "unresolved"), "src"),
analyzeSourceGraph(resolve(fixtureRoot, "layer"), "src"),
analyzeSourceGraph(resolve(fixtureRoot, "cycle"), "src"),
analyzeSourceGraph(resolve(fixtureRoot, "barrel"), "src"),
]);
const allowedFiles = new Set(await listFiles(allowedRoot));
const allowedSourceFile = resolve(
@@ -850,6 +851,21 @@ async function runGraphFixtureChecks(): Promise<GraphFixtureResult> {
),
);
const assertions = [
{
name: "deep adapter import from outside the group is rejected",
passed: blockingViolations(barrelGraph).some(
({ rule, source, target }) =>
rule === "adapter-groups-are-reached-through-their-barrel" &&
source === "src/bootstrap/compose-deep.ts" &&
target === "src/adapters/http/client.ts",
),
},
{
name: "barrel import from outside the group is accepted",
passed: !blockingViolations(barrelGraph).some(
({ source }) => source === "src/bootstrap/compose-barrel.ts",
),
},
{
name: "explicit TS specifier resolves to a TS module",
passed: allowedGraph.dependencies.some(
+1 -1
View File
@@ -1,6 +1,6 @@
import { mkdir, readFile } from "node:fs/promises";
import { classifyObjectSchemaChange } from "../src/application/policies/compatibility.ts";
import { classifyObjectSchemaChange } from "../src/contracts/compatibility.ts";
import { compatibilityFixturesArtifactSchema } from "./contracts/release-artifacts.ts";
import { writeValidatedJsonArtifact } from "./lib/validated-json-artifact.ts";
@@ -0,0 +1,55 @@
import { constants } from "node:fs";
import { access, readFile } from "node:fs/promises";
import { spawnSync } from "node:child_process";
const failures: string[] = [];
async function requireExecutable(path: string, label: string): Promise<void> {
try {
await access(path, constants.X_OK);
} catch {
failures.push(`${label} is required at ${path}`);
}
}
await Promise.all([
requireExecutable("/usr/bin/bwrap", "bubblewrap"),
requireExecutable("/usr/bin/systemctl", "systemctl"),
requireExecutable("/usr/bin/tar", "tar"),
]);
try {
const controllers = await readFile("/sys/fs/cgroup/cgroup.controllers", "utf8");
if (controllers.trim().length === 0) {
failures.push("cgroup v2 controllers are unavailable");
}
} catch {
failures.push("cgroup v2 is required at /sys/fs/cgroup/cgroup.controllers");
}
if (!failures.some((failure) => failure.includes("systemctl"))) {
const probe = spawnSync("/usr/bin/systemctl", ["show-environment"], {
encoding: "utf8",
timeout: 3_000,
});
if (probe.error || probe.status !== 0) {
failures.push("a reachable systemd manager bus is required");
}
}
if (failures.length > 0) {
process.stderr.write(
[
"System/CI-runner test prerequisites are unavailable:",
...failures.map((failure) => ` - ${failure}`),
"",
"Run test:unit/test:contract/test:component/test:integration for the",
"developer loop. test:system is intentionally reserved for a compatible",
"Linux CI-runner host.",
"",
].join("\n"),
);
process.exit(1);
}
process.stdout.write("System test prerequisites: PASS\n");
+15 -5
View File
@@ -482,7 +482,13 @@ const CANONICAL_GATE_SHAPE_SHA256 =
// 주제 화면 셋(`/topics`, `/topics/:slug/:variant`, `/studio/topics/:id`): FE-GATE-009 가 각
// 라우트의 수동 접근성 증거를 얻어 다시 계산했다. 같은 방법이다 — 87a22f68… 을 이전
// gates.json 에서 먼저 재현해 계산이 맞는지 확인한 뒤 새 파일을 해싱했다.
"8a1a5479041cbce479b59d669c97921a5ba83dd7cac309131723acc221903528";
// Template sync (ebea300). Both sides again carried a digest of their own
// gate set — 8a1a5479… here, 43dc4ed1… upstream — and neither describes the
// merged config/ci/gates.json. Recomputed from the merged file by the same
// method: 8a1a5479… was first reproduced from the pre-merge gates.json, so
// the computation that produced this value is the one the constant is
// pinned under.
"629e5898f6a38d5056fc6a4bee834c47f363669ce9925a2c0dabeddd64d11879";
function canonicalGateShapeSha256(gates: CiGateContract["gates"]): string {
const normalized = gates.map(
@@ -527,9 +533,11 @@ function canonicalAuthorityBaselineFailures(contract: CiGateContract): string[]
// `check-dev-release-manifest`. No gate read `public/*.json` at all, so a
// fixture that did not declare the compiled contract set broke `pnpm dev`
// outright while every static gate stayed green.
if (contract.commands.length !== 85 || commandReferenceCount !== 97) {
// Template sync (ebea300). The template's own baseline was 91/103; this
// product's was 85/97. Recomputed from the merged config/ci/gates.json.
if (contract.commands.length !== 94 || commandReferenceCount !== 106) {
failures.push(
`command authority baseline must contain exactly 85 definitions and 97 references; received ${contract.commands.length} definitions and ${commandReferenceCount} references`,
`command authority baseline must contain exactly 94 definitions and 106 references; received ${contract.commands.length} definitions and ${commandReferenceCount} references`,
);
}
// Template merge. 126 product artifacts plus the two the template added.
@@ -548,8 +556,10 @@ function canonicalAuthorityBaselineFailures(contract: CiGateContract): string[]
// 그리고 Studio 의 주제 편집 `/studio/topics/:id`.
// 환경 구성(SETUP) 문서 종류가 `/setups/:slug` 를 더했다 — 설치된 라우트마다 수동 접근성
// 증거를 하나씩 갖는 규칙이 그대로 적용된다.
if (contract.artifacts.length !== 139) {
failures.push(`artifact authority baseline must contain exactly 139 artifacts; received ${contract.artifacts.length}`);
// Template sync (ebea300). The template's own baseline was 109 artifacts;
// this product's was 139. Recomputed from the merged config/ci/gates.json.
if (contract.artifacts.length !== 141) {
failures.push(`artifact authority baseline must contain exactly 141 artifacts; received ${contract.artifacts.length}`);
}
if (contract.stages.length !== 5) {
failures.push(`stage authority baseline must contain exactly 5 stages; received ${contract.stages.length}`);
+1 -1
View File
@@ -3,7 +3,7 @@ import { pathToFileURL } from "node:url";
import { shouldRetry } from "../src/adapters/http/retry-policy.ts";
import { createTelemetryAdapter } from "../src/adapters/telemetry/best-effort-telemetry.ts";
import { verifyCompatibilityTuple } from "../src/application/policies/compatibility.ts";
import { verifyCompatibilityTuple } from "../src/contracts/compatibility.ts";
import type { StoragePort } from "../src/application/ports/storage-port.ts";
import { decideChunkRecovery } from "../src/application/use-cases/decide-chunk-recovery.ts";
import { validateRuntimeConfig } from "../src/bootstrap/runtime-config-schema.ts";
+2 -1
View File
@@ -21,6 +21,7 @@ import {
flattenPnpmDependencyTree,
isValidSha512Integrity,
parsePnpmLockfilePackages,
PROJECT_NAME,
supplyChainDigest,
verifySupplyChainCoherence,
} from "./lib/supply-chain.ts";
@@ -270,7 +271,7 @@ const provenance = {
],
},
runDetails: {
builder: { id: "local:tech-log-frontend" },
builder: { id: `local:${PROJECT_NAME}` },
metadata: { invocationId: "LOCAL_UNSIGNED" },
},
materials: {
+2 -2
View File
@@ -66,6 +66,7 @@ import { secretScanRules } from "./secret-scan.ts";
import {
isValidSha512Integrity,
parsePnpmLockfilePackages,
PROJECT_NAME,
supplyChainDigest,
verifySupplyChainCoherence,
} from "./supply-chain.ts";
@@ -304,8 +305,7 @@ export async function verifyLocalSupplyChainEvidence(
});
}
export const LOCAL_EVIDENCE_VERIFIER_ID =
"tech-log-frontend/local-evidence-verifier";
export const LOCAL_EVIDENCE_VERIFIER_ID = `${PROJECT_NAME}/local-evidence-verifier`;
export const LOCAL_EVIDENCE_VERIFIER_VERSION = "1";
export {
LOCAL_EVIDENCE_POLICY_INPUT_PATHS,
+2 -2
View File
@@ -4,13 +4,13 @@ import { z } from "zod";
import {
canonicalizeSupplyChainValue,
PROJECT_NAME,
supplyChainDigest,
} from "./supply-chain.ts";
export const PROVIDER_FUTURE_SKEW_MS = 5 * 60 * 1_000;
export const PROVIDER_MAX_LIFETIME_MS = 2 * 60 * 60 * 1_000;
export const PROMOTION_VERIFIER_ID =
"tech-log-frontend/promotion-verifier";
export const PROMOTION_VERIFIER_ID = `${PROJECT_NAME}/promotion-verifier`;
export const PROMOTION_VERIFIER_VERSION = "3";
const sha256 = z.string().regex(/^[a-f0-9]{64}$/u);
+1 -1
View File
@@ -1,4 +1,4 @@
import { isVersionCompatible } from "../../src/application/policies/compatibility.ts";
import { isVersionCompatible } from "../../src/contracts/compatibility.ts";
import { verifyContractSet } from "../../src/contracts/contract-set.ts";
import type { InstalledContractPackageIdentity } from "../../src/contracts/external-contract-runtime.ts";
import type { ReleaseArtifact } from "../../src/contracts/release-artifacts.ts";
+21
View File
@@ -1,6 +1,27 @@
import { createHash } from "node:crypto";
import { readFileSync } from "node:fs";
import { readFile } from "node:fs/promises";
function readProjectName(): string {
const manifest: unknown = JSON.parse(
readFileSync(new URL("../../package.json", import.meta.url), "utf8"),
);
const name =
typeof manifest === "object" && manifest !== null
? (manifest as { name?: unknown }).name
: undefined;
if (typeof name !== "string" || name.length === 0) {
throw new TypeError("package.json must declare a non-empty \"name\"");
}
return name;
}
/**
* Identity every release artifact is attributed to. A project derived from this
* template renames itself by editing `name` in package.json and nothing else.
*/
export const PROJECT_NAME = readProjectName();
export type DependencyScope = "production" | "development";
export type LockfilePackage = Readonly<{
name: string;
+67
View File
@@ -0,0 +1,67 @@
import { spawnSync } from "node:child_process";
import { existsSync } from "node:fs";
import { fileURLToPath } from "node:url";
function assertSupportedNode(): void {
const [majorText = "0", minorText = "0"] = process.versions.node.split(".");
const major = Number(majorText);
const minor = Number(minorText);
if (major !== 24 || minor < 11) {
process.stderr.write(
[
`Unsupported Node.js runtime for tests: ${process.versions.node}`,
"Required by package.json: >=24.11.0 <25.0.0",
"Use the repository-supported Node.js runtime before running a test suite.",
"",
].join("\n"),
);
process.exit(1);
}
}
assertSupportedNode();
const vitestEntry = fileURLToPath(
new URL("../node_modules/vitest/vitest.mjs", import.meta.url),
);
if (!existsSync(vitestEntry)) {
process.stderr.write(
"Vitest is not installed. Run the repository package installation first.\n",
);
process.exit(1);
}
const testEnvironment: NodeJS.ProcessEnv = {
...process.env,
NODE_ENV: "test",
};
for (const key of [
"npm_config_userconfig",
"npm_config_prefix",
"npm_config_globalconfig",
"NPM_CONFIG_USERCONFIG",
"NPM_CONFIG_PREFIX",
"NPM_CONFIG_GLOBALCONFIG",
]) {
delete testEnvironment[key];
}
const result = spawnSync(
process.execPath,
[vitestEntry, ...process.argv.slice(2)],
{
stdio: "inherit",
env: testEnvironment,
},
);
if (result.error) {
throw result.error;
}
if (result.signal) {
process.stderr.write(`Vitest terminated by signal ${result.signal}.\n`);
process.exit(1);
}
process.exit(result.status ?? 1);
+123 -16
View File
@@ -42,24 +42,53 @@ const featureOwnedPaths = [
featureSource,
featureTests,
"tests/integration/http-scenario-catalog.test.ts",
"tests/integration/http-execution-v3-observability.test.ts",
"tests/features/tech-log/runtime-composition.test.ts",
// Template sync (ebea300). The kill-switch test attributes a real route to a
// real installed feature id; with the sample feature gone there is no
// installed feature left to attribute to, so it goes with it.
"tests/component/product-feature-switch.test.tsx",
// Same sync. This TechLog test imports the sample feature's contract
// contribution on purpose — it proves a 403 on *another* feature's operation
// does not discard TechLog's CSRF token, which needs a second feature to
// exist. With the sample feature gone the premise is gone, so the test goes
// with it rather than being rewritten around a feature that is not there.
"tests/features/tech-log/studio-csrf-composition.test.ts",
"tests/e2e/reference-form.spec.ts",
"tests/e2e/reference-route.spec.ts",
"tests/mocks",
"tests/fixtures/typecheck/invalid-feature-input.ts",
"tests/fixtures/typecheck/invalid-reference-operation.ts",
"tests/fixtures/typecheck/invalid-http-operation-input.ts",
"tests/fixtures/typecheck/invalid-http-wire-mapper.ts",
"tests/fixtures/typecheck/invalid-http-operation-id.ts",
"tests/fixtures/typecheck/invalid-http-route-id.ts",
"tests/fixtures/typecheck/invalid-feature-contribution-input.ts",
"tests/fixtures/typecheck/invalid-feature-capability-selection.ts",
"tests/fixtures/typecheck/tsconfig.feature-input.json",
"tests/fixtures/typecheck/tsconfig.reference-operation.json",
"tests/fixtures/typecheck/tsconfig.http-operation-input.json",
"tests/fixtures/typecheck/tsconfig.http-wire-mapper.json",
"tests/fixtures/typecheck/tsconfig.http-operation-id.json",
"tests/fixtures/typecheck/tsconfig.http-route-id.json",
"tests/fixtures/typecheck/tsconfig.feature-contribution-input.json",
"tests/fixtures/typecheck/tsconfig.feature-capability-selection.json",
];
const emptyProductManifest = `export const COMPILED_PRODUCT_FEATURE_IDS: readonly string[] = Object.freeze([]);
export const INSTALLED_PRODUCT_FEATURES: readonly never[] = Object.freeze([]);
export const INSTALLED_PRODUCT_FEATURE_IDS: readonly string[] = Object.freeze([]);
`;
const emptyContracts = `import type { RouteDefinition } from "../contracts/routes.ts";
import { PLATFORM_SCHEMA_REGISTRY } from "../contracts/schema-registry.ts";
import { INSTALLED_PRODUCT_FEATURES } from "./installed-product-manifest.ts";
import {
TECH_LOG_ROUTE_REGISTRY,
TECH_LOG_ROUTE_RUNTIME_CONTRACT,
TECH_LOG_ROUTE_SCHEMA_REGISTRY,
} from "./tech-log/contracts/tech-log-route-contract.ts";
export const INSTALLED_FEATURE_CONTRACTS: readonly unknown[] = Object.freeze([]);
export const INSTALLED_FEATURE_CONTRACTS = INSTALLED_PRODUCT_FEATURES;
export const ROUTE_REGISTRY = TECH_LOG_ROUTE_REGISTRY;
export const ROUTE_RUNTIME_CONTRACT = TECH_LOG_ROUTE_RUNTIME_CONTRACT;
export const API_OPERATIONS = Object.freeze({});
@@ -73,6 +102,7 @@ export const SCHEMA_REGISTRY = Object.freeze({
...PLATFORM_SCHEMA_REGISTRY,
...TECH_LOG_ROUTE_SCHEMA_REGISTRY,
});
export const ROUTE_FEATURE_OWNER: Readonly<Record<string, string>> = Object.freeze({});
export const NAVIGATION_ROUTES = Object.freeze(
Object.values(ROUTE_REGISTRY)
.filter((definition) => definition.navigationOrder !== null)
@@ -103,12 +133,37 @@ export const ROUTE_CODECS = Object.freeze({
export const ROUTE_RUNTIME = TECH_LOG_ROUTE_RUNTIME;
`;
const emptyAdapters = `import { createTechLogFeatureInstalledInput } from "./tech-log/adapters/create-tech-log-feature-input.ts";
const emptyAdapters = `import type { InstalledHttpOperationExecutor } from "../adapters/http/index.ts";
import type { ApplicationFeatureInputs } from "../application/ports/in/application-api.ts";
import {
composeFeatureAdapterInputs,
type InstalledFeatureInputs,
} from "./feature-adapter-contribution.ts";
import { INSTALLED_PRODUCT_FEATURE_IDS } from "./installed-product-manifest.ts";
import {
createTechLogFeatureInstalledInput,
type TechLogInstallContext,
} from "./tech-log/adapters/create-tech-log-feature-input.ts";
import { TECH_LOG_FEATURE_ID } from "./tech-log/application/tech-log-feature-input.ts";
export function createInstalledFeatureInputs(_context: unknown) {
void _context;
const techLog = createTechLogFeatureInstalledInput();
return Object.freeze({ [techLog.featureId]: techLog.input });
const COMPILED_FEATURE_ADAPTER_CONTRIBUTIONS = Object.freeze([] as const);
type ProductFeatureInputs = InstalledFeatureInputs &
Readonly<Pick<ApplicationFeatureInputs, typeof TECH_LOG_FEATURE_ID>>;
export function createInstalledFeatureInputs(
context: TechLogInstallContext &
Readonly<{ http: InstalledHttpOperationExecutor }>,
): ProductFeatureInputs {
const techLog = createTechLogFeatureInstalledInput(context);
return Object.freeze({
...composeFeatureAdapterInputs(
COMPILED_FEATURE_ADAPTER_CONTRIBUTIONS,
INSTALLED_PRODUCT_FEATURE_IDS,
context,
),
[techLog.featureId]: techLog.input,
}) as ProductFeatureInputs;
}
`;
@@ -117,9 +172,17 @@ const emptyContractContributions = `import {
type InstalledContractContribution,
type InstalledContractPackageIdentity,
} from "../contracts/external-contract-runtime.ts";
import { INSTALLED_PRODUCT_FEATURE_IDS } from "./installed-product-manifest.ts";
const COMPILED_CONTRACT_CONTRIBUTIONS: readonly InstalledContractContribution[] =
Object.freeze([]);
export const INSTALLED_CONTRACT_CONTRIBUTIONS: readonly InstalledContractContribution[] =
Object.freeze([]);
Object.freeze(
COMPILED_CONTRACT_CONTRIBUTIONS.filter((contribution) =>
INSTALLED_PRODUCT_FEATURE_IDS.includes(contribution.featureId),
),
);
export const COMPOSED_CONTRACT_CONTRIBUTIONS = composeContractContributions(
INSTALLED_CONTRACT_CONTRIBUTIONS,
@@ -168,7 +231,9 @@ try {
await prepareRemovalFixture(fixtureRoot);
for (const excludedFixtureTest of [
"tests/integration/security-followup-archive.test.ts",
"tests/unit/ci-artifact-contract.test.ts",
// Template sync (ebea300). `ci-artifact-contract` moved to
// `tests/system/ci-runner/`, which `test:all` does not run, so it no longer
// needs excluding — upstream dropped it from this list for the same reason.
"tests/unit/ci-workflow-generation.test.ts",
"tests/unit/__snapshots__/ci-workflow-generation.test.ts.snap",
"tests/unit/removal-fixture.test.ts",
@@ -202,6 +267,10 @@ try {
force: true,
});
}
await writeFile(
path.join(fixtureRoot, "src/features/installed-product-manifest.ts"),
emptyProductManifest,
);
await writeFile(
path.join(fixtureRoot, "src/features/installed-feature-contracts.ts"),
emptyContracts,
@@ -223,6 +292,34 @@ try {
emptyContractContributions,
);
// Runtime profiles are product configuration. Once the feature is physically
// removed, its override key must disappear too or the built config still
// advertises a source capability that no longer exists.
for (const profile of [
"local",
"development",
"staging",
"production",
] as const) {
const profilePath = path.join(
fixtureRoot,
"config/runtime",
`${profile}.json`,
);
const runtimeConfig = JSON.parse(
await readFile(profilePath, "utf8"),
) as {
FEATURE_OVERRIDES?: Record<string, string>;
};
if (runtimeConfig.FEATURE_OVERRIDES) {
delete runtimeConfig.FEATURE_OVERRIDES["reference-feature"];
}
await writeFile(
profilePath,
`${JSON.stringify(runtimeConfig, null, 2)}\n`,
);
}
const retainedCriticalModules = coveragePolicy.criticalModules.filter(
(modulePolicy) => !modulePolicy.path?.startsWith(`${featureSource}/`),
);
@@ -317,6 +414,12 @@ try {
const removedCiScripts = new Set([
"check:types:fixture:feature-input",
"check:types:fixture:reference-operation",
"check:types:fixture:http-operation-input",
"check:types:fixture:http-wire-mapper",
"check:types:fixture:http-operation-id",
"check:types:fixture:http-route-id",
"check:types:fixture:feature-contribution-input",
"check:types:fixture:feature-capability-selection",
"test:http-scenario-evidence",
"test:reference-feature",
]);
@@ -391,13 +494,17 @@ try {
["build", runPnpm("build")],
];
const builtResidue: string[] = [];
for (const file of await filesBelow(path.join(fixtureRoot, "dist"))) {
if (!/\.(?:js|css|html|json)$/.test(file)) continue;
const content = await readFile(file, "utf8");
if (
/REFERENCE_RESOURCE|reference-feature|reference-resource/i.test(content)
) {
builtResidue.push(path.relative(fixtureRoot, file));
const buildSucceeded =
checks.find(([name]) => name === "build")?.[1] === true;
if (buildSucceeded) {
for (const file of await filesBelow(path.join(fixtureRoot, "dist"))) {
if (!/\.(?:js|css|html|json)$/.test(file)) continue;
const content = await readFile(file, "utf8");
if (
/REFERENCE_RESOURCE|reference-feature|reference-resource/i.test(content)
) {
builtResidue.push(path.relative(fixtureRoot, file));
}
}
}
const routeCatalog = await import(
+1 -1
View File
@@ -5,7 +5,7 @@ import { pathToFileURL } from "node:url";
import {
verifyCompatibilityTuple,
type CompatibilityTuple,
} from "../src/application/policies/compatibility.ts";
} from "../src/contracts/compatibility.ts";
import type { InstalledContractPackageIdentity } from "../src/contracts/external-contract-runtime.ts";
import {
parseBuildManifestArtifact,