feat(housekeeping): unify complete rebuild in gated preview
CI / check (pull_request) Failing after 10s
CI / deploy (pull_request) Skipped
CI / release (pull_request) Skipped

This commit is contained in:
Simo committed 2026-08-31 20:37:51 +02:00
1 parent 4ad007d241
commit 43470ebf82
402 files changed
+78313 -1663

No files matched your search

@@ -0,0 +1,32 @@
import { fail, type HousekeepingResult, ok } from "../contracts";
import type { HousekeepingCommand } from "./registry";
export interface HousekeepingCommandConfirmation {
commandId: string;
risk: "safe" | "sensitive";
requiresReason: boolean;
reason?: string;
}
export function confirmHousekeepingCommand<I, O>(
command: HousekeepingCommand<I, O>,
reason: string | undefined,
correlationId: string,
): HousekeepingResult<HousekeepingCommandConfirmation> {
const normalizedReason = reason?.normalize("NFC").trim() || undefined;
if (command.requiresReason && !normalizedReason) {
return fail("VALIDATION", "errors.housekeeping.validation", correlationId, {
reason: ["errors.validation.required"],
});
}
return ok(
{
commandId: command.id,
risk: command.risk,
requiresReason: command.requiresReason,
...(normalizedReason === undefined ? {} : { reason: normalizedReason }),
},
correlationId,
);
}