// Shared task abstraction. Each Wave-1 task type provides a TaskPlan describing the
// initial model messages, the patch target, and the state-path capabilities the loop is
// allowed to enter. The loop reads `allows*` flags to route — read-only enforcement for
// explain-plan is a property of the task, not of configuration (ADR-0004 D8).
import { buildExplainPlan } from "./explain-plan.js";
import { buildGenerateUnitTests } from "./generate-unit-tests.js";
import { buildInvestigateBug } from "./investigate-bug.js";
import { buildVerify } from "./verify.js";
// Routes a validated TaskInput to its task-specific plan. The discriminated union makes
// this total: adding a TaskType without a branch is a compile error.
export function resolveTaskPlan(task) {
    switch (task.taskType) {
        case "generate-unit-tests":
            return buildGenerateUnitTests(task.input);
        case "investigate-bug":
            return buildInvestigateBug(task.input);
        case "explain-plan":
            return buildExplainPlan(task.input);
        case "verify":
            return buildVerify(task.input);
    }
}
