// engine/spec-dependency-graph/dot-exporter.ts — SPEC-746
// Converts a SpecGraph to Graphviz DOT format.
/**
 * Export a SpecGraph as Graphviz DOT source.
 *
 * Spec IDs are safe identifiers (regex ^SPEC-\d+$) so naive interpolation
 * is fine. Status labels pass through \n in the node label.
 */
export function toDot(graph) {
    const lines = ['digraph SpecGraph {', '  rankdir=LR;'];
    // Nodes
    for (const node of graph.nodes) {
        const label = `${node.id}\\n${node.status}${node.supersededBy ? `\\nsupersededBy:${node.supersededBy}` : ''}`;
        lines.push(`  "${node.id}" [label="${label}", shape=box];`);
    }
    // Edges
    for (const edge of graph.edges) {
        lines.push(`  "${edge.from}" -> "${edge.to}" [label="${edge.kind}"];`);
    }
    lines.push('}');
    return lines.join('\n');
}
//# sourceMappingURL=dot-exporter.js.map