{% extends "base.html" %}
{% block content %}
<h1>Agent topology history</h1>
<div class="table-wrap">
<table>
<tr><th>Task class</th><th class="num">Workers</th><th>Models</th><th>Skills</th><th class="num">Tokens</th><th class="num">Cost</th><th class="num">Latency (ms)</th><th class="num">Quality</th><th>Succeeded</th><th>Recorded</th></tr>
{% for r in records %}
<tr>
  <td>{{ r.task_class }}</td>
  <td class="num">{{ r.worker_count }}</td>
  <td>{{ r.model_names | join(", ") }}</td>
  <td>{{ r.skill_ids | join(", ") }}</td>
  <td class="num">{{ r.total_tokens }}</td>
  <td class="num">{{ "%.4f" | format(r.cost_estimate) }}</td>
  <td class="num">{{ r.latency_ms }}</td>
  <td class="num">{{ "%.2f" | format(r.quality_score) }}</td>
  <td><span class="pill {{ (r.succeeded | string) | pill_class }}">{{ r.succeeded }}</span></td>
  <td>{{ r.created_at }}</td>
</tr>
{% else %}
<tr><td colspan="10" class="empty">No agent spawns recorded yet.</td></tr>
{% endfor %}
</table>
</div>
{% endblock %}
