import assert from "node:assert/strict";
import { test } from 'vitest';

import { requiresHumanProductionMutationApproval } from "../auto/phases.ts";

test("production mutation guard flags live unified failover POST tasks", () => {
	assert.equal(
		requiresHumanProductionMutationApproval(
			[
				"Execute smoke test against production NixOS Hetzner infrastructure.",
				"POST to /action/unified-failover with test server_id and vm_names.",
				"Verify command row was created with status=pending.",
			].join("\n"),
		),
		true,
	);
});

test("production mutation guard allows read-only production checks", () => {
	assert.equal(
		requiresHumanProductionMutationApproval(
			[
				"Run read-only smoke checks against production.",
				"GET /health and query current gateway routing table.",
			].join("\n"),
		),
		false,
	);
});
