chore(review): 1105 CI 기준선 조치 브랜치를 합친다

This commit is contained in:
DongHyeonka
2026-11-06 02:59:02 +09:00
3 changed files with 31 additions and 4 deletions
+2 -2
View File
@@ -1,11 +1,11 @@
{
"schemaVersion": 1,
"owner": "DongHyeonka",
"reason": "1103/13-03: FE-GATE-027 also runs scan:dependency-advisories, a non-blocking release-stage advisory signal",
"reason": "1105/12-01: FE-GATE-013 hostRequirements are part of the reviewed gate shape",
"gates": 27,
"commands": 100,
"commandReferences": 104,
"artifacts": 110,
"stages": 5,
"gateShapeSha256": "6225494d6447a2065d921a34597a744d180a7a68e601119e32f8fc42e18eb1c1"
"gateShapeSha256": "7bebafe65d528be6a59d4bb70edd2cad99455b2b49087e4a46b83d77bfd163de"
}
+7 -2
View File
@@ -295,8 +295,9 @@ const gateSchema = z
* 1105/12-01. What the runner host must provide for the gate to pass, one
* line each. The workflow shows them as comments beside the job's
* `runs-on`; a line cannot hold a line break, so it cannot leave the
* comment. They describe the runner, not the gate's commands or evidence,
* so the reviewed gate shape (canonicalGateShapeSha256) leaves them out.
* comment. They are part of the reviewed gate shape
* (canonicalGateShapeSha256): dropping or changing one needs a new
* contract baseline, like any other change to what a gate demands.
*/
hostRequirements: z.array(nonEmpty.max(512)).min(1).max(8).optional(),
})
@@ -504,6 +505,7 @@ function canonicalGateShapeSha256(gates: CiGateContract["gates"]): string {
evidenceArtifactIds,
retentionClassId,
requiresEnvironment,
hostRequirements,
}) => ({
id,
name,
@@ -512,6 +514,9 @@ function canonicalGateShapeSha256(gates: CiGateContract["gates"]): string {
evidenceArtifactIds,
retentionClassId,
requiresEnvironment: requiresEnvironment ?? [],
// Only gates that declare runner requirements carry the key, so the
// digest of every other gate stays what it was.
...(hostRequirements === undefined ? {} : { hostRequirements }),
}),
);
return createHash("sha256").update(JSON.stringify(normalized)).digest("hex");
+22
View File
@@ -579,6 +579,28 @@ describe("CI gate contract", () => {
await expect(loadCiGateContract(root)).rejects.toThrow(/gateShapeSha256: baseline/i);
});
it("rejects runner requirement drift through the semantic-shape digest (1105/12-01)", async () => {
const root = await mkdtemp(path.join(tmpdir(), "ci-contract-host-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",
);
expect(gate.hostRequirements?.length).toBeGreaterThan(0);
gate.hostRequirements = gate.hostRequirements.slice(1);
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 writeFile(
path.join(root, "config/ci/contract-baseline.json"),
await readFile("config/ci/contract-baseline.json"),
);
await expect(loadCiGateContract(root)).rejects.toThrow(/gateShapeSha256: baseline/i);
});
it.each(["check:artifact-schemas", "check:ci-workflow"])(
"rejects a missing nested check:ci dependency: %s",
async (removedScript) => {