summarise method
Builds a human-readable plan summary for display or LLM context.
Implementation
String summarise(ExecutionDAG dag) {
final buf = StringBuffer();
buf.writeln('Plan for goal ${dag.goalId} (${dag.size} tasks):');
var step = 1;
for (final t in dag.topologicalOrder) {
final status = _statusIcon(t.status);
buf.writeln(' Step $step $status ${t.description}');
if (t.result?.output != null) {
buf.writeln(
' → ${_trunc(t.result!.output.toString(), 100)}');
}
step++;
}
return buf.toString().trimRight();
}