feat: normalize deployment inventory evidence

This commit is contained in:
NuklearRabbit committed 2026-07-29 17:39:22 +02:00
1 parent 6b93391a9b
commit 5d3731a853
13 files changed
+433 -45

No files matched your search

+11
View File
@@ -1532,6 +1532,17 @@
if (serverId !== "server-unraid" || planId !== "a".repeat(64)) throw new Error("The reconciliation plan is stale.");
return { adopted: 0, refreshed: 1, retired: 0, state: clone(state) };
},
async planInventoryReview(serverId, workloadId, action, reason = "", repositoryFullName = null) {
if (["ignore", "manual-exclude", "exclude-scan-root"].includes(action) && reason.length < 5) throw new Error("A meaningful review reason is required.");
return { id: "b".repeat(64), serverId, workloadId, action, reason, repositoryFullName, evidenceHash: "c".repeat(64), classification: "ambiguous", containersUnaffected: true, configurationChanges: [`Persist review decision ${action}`], recovery: "Remove the decision or rescan after evidence changes." };
},
async applyInventoryReview(serverId, workloadId, action, reason, repositoryFullName, planId) {
if (planId !== "b".repeat(64)) throw new Error("The inventory review plan is stale.");
const inventory = (await this.discoverServerDeployments()).find((item) => item.serverId === serverId);
const workload = inventory.workloads.find((item) => item.workloadId === workloadId);
if (workload) workload.reviewDecision = { action, reason, repositoryFullName, evidenceHash: "c".repeat(64) };
return { decision: workload?.reviewDecision, inventory, state: clone(state) };
},
async linkServerWorkload(repository, serverId, workloadId, deploymentMode = "server-git", remoteFolder = "") {
await wait(120);
const repo = repositories.find((item) => item.fullName === repository.fullName);