feat: deliver policy-driven Git Validator 2.0

This commit is contained in:
NuklearRabbit
2026-07-29 18:24:27 +02:00
parent 7b05c953b6
commit a0733875c4
18 changed files with 502 additions and 133 deletions
+17
View File
@@ -466,6 +466,11 @@ function createMockDeploymentBridge(context) {
checkedAt: iso(),
score: 78,
grade: "Good",
policy: { id: "standard", label: "Standard", requiredScore: 70 },
ready: true,
commitSha: "8cbaf303aa3bb9b4023a7c89aa13fb70ce612847",
trend: { newlyFound: ["working-tree"], resolved: ["editorconfig"], regressions: [], suppressions: [] },
expiredSuppressions: [],
summary: { passed: 7, warnings: 3, errors: 0, repairable: 2 },
checks: [
{
@@ -566,6 +571,18 @@ function createMockDeploymentBridge(context) {
],
};
},
async gitValidatorSetPolicy(_fullName, policy) {
return { id: policy.id, label: policy.id[0].toUpperCase() + policy.id.slice(1) };
},
async gitValidatorSuppress(_fullName, suppression) {
return { ...suppression, id: `suppression-${Date.now()}`, createdAt: iso() };
},
async gitValidatorPreviewRepair(_fullName, check) {
return { checkId: check.id, action: check.fixAction, files: [".git/config"], diff: "+ reviewed configuration change\n", remoteMutation: check.fixAction === "protect-default-branch" };
},
async gitValidatorExport(fullName, format) {
return { extension: format === "markdown" ? "md" : format, mimeType: "text/plain", content: `# Git assurance — ${fullName}\n` };
},
async gitValidatorRepair() {
await wait(180);
return { repaired: true };