fix: reject empty removal fixture scans

This commit is contained in:
DongHyeonka
2026-08-02 15:02:57 +09:00
parent f49d147b01
commit 42ffb79997
3 changed files with 62 additions and 1 deletions
+20 -1
View File
@@ -195,7 +195,26 @@ describe("CI gate contract", () => {
await writeFile(path.join(root, "package.json"), await readFile("package.json"));
await expect(loadCiGateContract(root)).rejects.toThrow(
/canonical gate semantic shape|lacks a bound producer command/i,
/lacks a bound producer command/i,
);
});
it("rejects canonical gate name drift through the semantic-shape digest", async () => {
const root = await mkdtemp(path.join(tmpdir(), "ci-contract-gate-name-shape-"));
temporaryRoots.push(root);
await mkdir(path.join(root, "config/ci"), { recursive: true });
const contract = JSON.parse(
JSON.stringify(await loadCiGateContract(process.cwd())),
) as Record<string, any>;
const gate = contract.gates.find(
(candidate: Record<string, any>) => candidate.id === "FE-GATE-013",
);
gate.name = `${gate.name}-renamed`;
await writeFile(path.join(root, "config/ci/gates.json"), `${JSON.stringify(contract)}\n`);
await writeFile(path.join(root, "package.json"), await readFile("package.json"));
await expect(loadCiGateContract(root)).rejects.toThrow(
/canonical gate semantic shape/i,
);
});