Migrate Policy retention interfaces

This commit is contained in:
2026-08-03 10:22:46 +02:00
parent 344e15dea4
commit f964ed7dc0
8 changed files with 198 additions and 8 deletions
@@ -0,0 +1,17 @@
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import { resolve } from "node:path";
import { fileURLToPath } from "node:url";
const webuiRoot = resolve(fileURLToPath(new URL("..", import.meta.url)));
const panel = readFileSync(resolve(webuiRoot, "src/features/policy/RetentionPoliciesPanel.tsx"), "utf8");
assert.match(panel, /<RetentionPolicyScopeManager/, "Policy delegates effective-policy blockers and provenance to the shared Core contract");
assert.match(panel, /contextId: "policy\.retention"/, "retention exposes stable contextual documentation");
assert.match(panel, /disabledReason=\{actionDisabledReason\}/, "retention execution explains unavailable actions");
assert.match(panel, /<ConfirmDialog/, "destructive retention uses shared confirmation");
assert.match(panel, /<DataGrid/, "retention outcomes use the shared data-grid pattern");
assert.doesNotMatch(panel, /admin-json-preview/, "retention outcome is not presented as raw JSON");
assert.doesNotMatch(panel, /<pre/, "retention outcome is a typed projection");
console.log("Policy interface-pattern contracts passed.");