fix: preserve frozen source bytes in CI
Dada P0-A isolated Windows CI / validate-and-package (push) Failing after 53s

This commit is contained in:
suyx
2026-07-28 14:51:56 +08:00
parent e3d9759d24
commit 9d36ca3e94
2 changed files with 19 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
# Frozen inputs must retain their committed bytes on every platform.
/PRD.md -text
/FeatureSummary.md -text
/DevelopmentPlan.md -text
/UIDesign.md -text
/tdd.md -text
/Dada-P0A-LowFi.pen -text
/tasks.md -text
/tasks.manifest.json -text
/Dada-LowFi-Preview/** -text
+9
View File
@@ -2,7 +2,16 @@ import assert from "node:assert/strict";
import { readFileSync } from "node:fs"; import { readFileSync } from "node:fs";
const policy = JSON.parse(readFileSync("ci/runner-isolation-policy.json", "utf8")); const policy = JSON.parse(readFileSync("ci/runner-isolation-policy.json", "utf8"));
const manifest = JSON.parse(readFileSync("tasks.manifest.json", "utf8"));
const workflow = readFileSync(".gitea/workflows/p0a-ci.yml", "utf8"); const workflow = readFileSync(".gitea/workflows/p0a-ci.yml", "utf8");
const gitAttributes = readFileSync(".gitattributes", "utf8");
const escapeRegExp = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
const frozenBytePaths = [...Object.keys(manifest.source_hashes), "tasks.manifest.json"];
for (const path of frozenBytePaths) {
assert.match(gitAttributes, new RegExp(`^/${escapeRegExp(path)}\\s+-text\\s*$`, "m"));
}
assert.match(gitAttributes, /^\/Dada-LowFi-Preview\/\*\*\s+-text\s*$/m);
for (const label of policy.required_labels) assert.match(workflow, new RegExp(`\\b${label}\\b`)); for (const label of policy.required_labels) assert.match(workflow, new RegExp(`\\b${label}\\b`));
assert.doesNotMatch(workflow, /\bcorepack enable\b/); assert.doesNotMatch(workflow, /\bcorepack enable\b/);