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)
100 lines
3.5 KiB
TypeScript
100 lines
3.5 KiB
TypeScript
import { readFileSync } from "node:fs";
|
|
import { readFile } from "node:fs/promises";
|
|
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
import { loadCiGateContract } from "../../scripts/contracts/ci-gates.ts";
|
|
import {
|
|
gatedTestPaths,
|
|
listTestFiles,
|
|
parseUngatedTestExclusions,
|
|
ungatedTestFailures,
|
|
} from "../../scripts/lib/ungated-tests.ts";
|
|
|
|
/**
|
|
* 12-04 / 09-11. A test file only protects anything if a CI gate runs it.
|
|
* Several directories were reachable only from local scripts, and nothing
|
|
* noticed a new one.
|
|
*/
|
|
async function repositoryInputs() {
|
|
const contract = await loadCiGateContract(process.cwd());
|
|
const packageDocument = JSON.parse(await readFile("package.json", "utf8")) as {
|
|
scripts: Record<string, string>;
|
|
};
|
|
return {
|
|
testFiles: await listTestFiles(process.cwd()),
|
|
gatedPaths: gatedTestPaths(
|
|
packageDocument.scripts,
|
|
contract.commands.map(({ script }) => script),
|
|
(file) => readFileSync(file, "utf8"),
|
|
),
|
|
exclusions: parseUngatedTestExclusions(
|
|
JSON.parse(await readFile("config/ci/ungated-tests.json", "utf8")),
|
|
),
|
|
};
|
|
}
|
|
|
|
describe("ungated test files", () => {
|
|
it("runs every test file in a CI gate or names why it does not", async () => {
|
|
expect(ungatedTestFailures(await repositoryInputs())).toEqual([]);
|
|
});
|
|
|
|
it.each([
|
|
"tests/features/feature-module.test.ts",
|
|
"tests/architecture/observability-boundaries.test.ts",
|
|
"tests/release/old-asset-reachability.test.ts",
|
|
"tests/scripts/verify-extreme-scale.test.ts",
|
|
"tests/scale/browser-soak.contract.test.ts",
|
|
"tests/e2e/app-shell.spec.ts",
|
|
// 11-03: the CPU-independent scale PR tier runs in FE-GATE-005.
|
|
"tests/scale/growth-regression.test.ts",
|
|
"tests/scale/traffic/amplification-metrics.test.ts",
|
|
])("gates %s", async (file) => {
|
|
const inputs = await repositoryInputs();
|
|
expect(ungatedTestFailures({ ...inputs, testFiles: [file] })).toEqual([]);
|
|
expect(inputs.exclusions.some(({ path }) => path === file)).toBe(false);
|
|
});
|
|
|
|
it("reads the Vitest paths of a scale tier the gate command runs (11-03)", () => {
|
|
expect(
|
|
gatedTestPaths({ gate: "node scripts/scale/run-scale-profile.ts pr" }, ["gate"], () => ""),
|
|
).toEqual(expect.arrayContaining(["tests/scale/growth-regression.test.ts", "tests/scale/traffic"]));
|
|
expect(
|
|
gatedTestPaths({ gate: "node scripts/scale/run-scale-profile.ts pr" }, ["gate"], () => ""),
|
|
).not.toContain("tests/scale/session");
|
|
});
|
|
|
|
it("rejects a new test directory that no gate runs", async () => {
|
|
const inputs = await repositoryInputs();
|
|
expect(
|
|
ungatedTestFailures({
|
|
...inputs,
|
|
testFiles: [...inputs.testFiles, "tests/new-area/new-area.test.ts"],
|
|
}),
|
|
).toEqual([
|
|
"test file is not run by any CI gate command and is not in config/ci/ungated-tests.json: tests/new-area/new-area.test.ts",
|
|
]);
|
|
});
|
|
|
|
it("rejects an exclusion that a gate already runs", async () => {
|
|
const inputs = await repositoryInputs();
|
|
expect(
|
|
ungatedTestFailures({
|
|
...inputs,
|
|
exclusions: [...inputs.exclusions, { path: "tests/unit/ungated-tests.test.ts", reason: "stale" }],
|
|
}),
|
|
).toEqual([
|
|
"ungated test exclusion is stale; a CI gate runs it: tests/unit/ungated-tests.test.ts",
|
|
]);
|
|
});
|
|
|
|
it("requires a reason for every exclusion", () => {
|
|
expect(() =>
|
|
parseUngatedTestExclusions({
|
|
schemaVersion: 1,
|
|
entries: [{ path: "tests/scale/benchmark.test.ts", reason: " " }],
|
|
}),
|
|
).toThrow(/reason/u);
|
|
});
|
|
});
|