import { buildVerificationDag } from '../verification/verification-dag.js';
const NODE_KIND_CYCLE = [
    'typecheck_shard',
    'unit_test_shard',
    'route_gate_shard',
    'lint_static_scan_shard',
    'schema_validation_shard',
    'patch_specific_test_shard',
    'docs_changelog_check',
    'side_effect_check',
    'mutation_ledger_check',
    'zellij_proof_check',
    'local_llm_structured_output_check'
];
export function buildNarutoVerificationDag(graph, input = {}) {
    const command = input.command || 'node -e "process.exit(0)"';
    const verifiableItems = graph.work_items.filter((item) => item.verification_required);
    const taskIdByWorkItemId = new Map(verifiableItems.map((item, index) => [item.id, `NV-${String(index + 1).padStart(6, '0')}`]));
    const tasks = verifiableItems
        .map((item, index) => {
        const kind = NODE_KIND_CYCLE[index % NODE_KIND_CYCLE.length] || 'route_gate_shard';
        const taskId = taskIdByWorkItemId.get(item.id) || `NV-${String(index + 1).padStart(6, '0')}`;
        return {
            id: taskId,
            command,
            ...(input.cwd ? { cwd: input.cwd } : {}),
            inputs: [...item.target_paths],
            outputs: [`.sneakoscope/reports/naruto-verification/${item.id}.json`],
            dependencies: item.dependencies.map((dep) => taskIdByWorkItemId.get(dep)).filter((dep) => typeof dep === 'string' && dep !== taskId),
            timeout_ms: 60000,
            read_only: true
        };
    });
    const dag = buildVerificationDag(tasks);
    return {
        ...dag,
        naruto_schema: 'sks.naruto-verification-dag.v1',
        node_kinds: NODE_KIND_CYCLE,
        starts_when_dependencies_ready: true
    };
}
//# sourceMappingURL=naruto-verification-dag.js.map