nullius-eval 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (291) hide show
  1. _nullius_app/.env.example +55 -0
  2. _nullius_app/app.py +96 -0
  3. _nullius_app/requirements.txt +1 -0
  4. _nullius_app/static/brand/README.md +20 -0
  5. _nullius_app/static/brand/docker.svg +1 -0
  6. _nullius_app/static/brand/favicon.svg +1 -0
  7. _nullius_app/static/brand/huggingface.svg +37 -0
  8. _nullius_app/static/brand/mark-dark.svg +1 -0
  9. _nullius_app/static/brand/marks.svg +34 -0
  10. _nullius_app/static/brand/tokens.json +51 -0
  11. _nullius_app/static/brand/typesafe.png +0 -0
  12. _nullius_app/static/brand/wordmark-dark.svg +1 -0
  13. _nullius_app/static/builder/command-builder-core.js +763 -0
  14. _nullius_app/static/builder/command-builder.css +248 -0
  15. _nullius_app/static/builder/command-builder.js +997 -0
  16. _nullius_app/static/builder/model-picker.js +113 -0
  17. _nullius_app/static/catalogue/add.js +46 -0
  18. _nullius_app/static/catalogue/agents/README.md +19 -0
  19. _nullius_app/static/catalogue/agents/goose.svg +1 -0
  20. _nullius_app/static/catalogue/agents/jiuwenswarm.svg +33 -0
  21. _nullius_app/static/catalogue/agents/marks.json +8 -0
  22. _nullius_app/static/catalogue/agents/mini-swe-agent.svg +7 -0
  23. _nullius_app/static/catalogue/agents/opencode.svg +7 -0
  24. _nullius_app/static/catalogue/catalogue.css +436 -0
  25. _nullius_app/static/catalogue/catalogue.js +87 -0
  26. _nullius_app/static/catalogue/marks.svg +29 -0
  27. _nullius_app/static/catalogue/new.js +78 -0
  28. _nullius_app/static/catalogue/versions.js +27 -0
  29. _nullius_app/static/compare/comparison.css +117 -0
  30. _nullius_app/static/controls.js +117 -0
  31. _nullius_app/static/disclosures.js +70 -0
  32. _nullius_app/static/fonts/0569c822cab6c510.ttf +0 -0
  33. _nullius_app/static/fonts/DMSans-Medium.woff2 +0 -0
  34. _nullius_app/static/fonts/DMSans-Regular.woff2 +0 -0
  35. _nullius_app/static/fonts/IBMPlexMono-Medium.woff2 +0 -0
  36. _nullius_app/static/fonts/IBMPlexMono-Regular.woff2 +0 -0
  37. _nullius_app/static/fonts/InstrumentSerif-Italic.woff2 +0 -0
  38. _nullius_app/static/fonts/InstrumentSerif-Regular.woff2 +0 -0
  39. _nullius_app/static/fonts/README.md +11 -0
  40. _nullius_app/static/fonts/c1e7453ea26a1d1e.ttf +0 -0
  41. _nullius_app/static/fonts/dmsans-OFL.txt +93 -0
  42. _nullius_app/static/fonts/ibmplexmono-OFL.txt +93 -0
  43. _nullius_app/static/fonts/instrumentserif-OFL.txt +93 -0
  44. _nullius_app/static/fonts.css +49 -0
  45. _nullius_app/static/notifications.js +49 -0
  46. _nullius_app/static/onboarding.css +78 -0
  47. _nullius_app/static/onboarding.js +158 -0
  48. _nullius_app/static/runs/board.css +358 -0
  49. _nullius_app/static/runs/board.js +127 -0
  50. _nullius_app/static/runs/launches.css +88 -0
  51. _nullius_app/static/runs/live-board.css +186 -0
  52. _nullius_app/static/runs/live-board.js +394 -0
  53. _nullius_app/static/runs/path-suggestions.js +119 -0
  54. _nullius_app/static/runs/start.css +38 -0
  55. _nullius_app/static/settings/autosave.js +162 -0
  56. _nullius_app/static/settings/custom-keys.js +100 -0
  57. _nullius_app/static/settings/data-providers.js +88 -0
  58. _nullius_app/static/settings/judges.js +61 -0
  59. _nullius_app/static/settings/modal.css +32 -0
  60. _nullius_app/static/settings/modal.js +91 -0
  61. _nullius_app/static/settings/navigation.js +55 -0
  62. _nullius_app/static/settings/prices.js +68 -0
  63. _nullius_app/static/settings/providers.js +134 -0
  64. _nullius_app/static/settings/sandbox.js +20 -0
  65. _nullius_app/static/settings/settings.css +288 -0
  66. _nullius_app/static/style.css +1752 -0
  67. _nullius_app/static/traces/conversation.css +49 -0
  68. _nullius_app/static/traces/conversation.js +215 -0
  69. _nullius_app/templates/agents/entry.html +145 -0
  70. _nullius_app/templates/agents/kits.html +55 -0
  71. _nullius_app/templates/agents/standard.html +58 -0
  72. _nullius_app/templates/base.html +479 -0
  73. _nullius_app/templates/builder/new_run.html +55 -0
  74. _nullius_app/templates/catalogue/add_dialog.html +32 -0
  75. _nullius_app/templates/catalogue/benchmark.html +270 -0
  76. _nullius_app/templates/catalogue/benchmarks.html +91 -0
  77. _nullius_app/templates/catalogue/new.html +141 -0
  78. _nullius_app/templates/catalogue/use_bundle.html +11 -0
  79. _nullius_app/templates/compare/_detail.html +37 -0
  80. _nullius_app/templates/compare/compare.html +298 -0
  81. _nullius_app/templates/compare/compare_picker.html +51 -0
  82. _nullius_app/templates/compare/compare_task.html +329 -0
  83. _nullius_app/templates/runs/_execution.html +131 -0
  84. _nullius_app/templates/runs/_runtime.html +5 -0
  85. _nullius_app/templates/runs/ascii-mark.html +485 -0
  86. _nullius_app/templates/runs/feasibility.html +127 -0
  87. _nullius_app/templates/runs/index.html +609 -0
  88. _nullius_app/templates/runs/job.html +460 -0
  89. _nullius_app/templates/runs/preparing.html +14 -0
  90. _nullius_app/templates/runs/reconcile.html +124 -0
  91. _nullius_app/templates/runs/setup.html +272 -0
  92. _nullius_app/templates/runs/start.html +51 -0
  93. _nullius_app/templates/settings/custom_keys.html +82 -0
  94. _nullius_app/templates/settings/data_providers.html +27 -0
  95. _nullius_app/templates/settings/settings.html +564 -0
  96. _nullius_app/templates/traces/_charts.html +165 -0
  97. _nullius_app/templates/traces/_conversation.html +37 -0
  98. _nullius_app/templates/traces/_judgement.html +72 -0
  99. _nullius_app/templates/traces/artifact.html +15 -0
  100. _nullius_app/templates/traces/trial.html +838 -0
  101. _nullius_app/templates/workspaces/workspaces.html +54 -0
  102. _nullius_app/web/__init__.py +1 -0
  103. _nullius_app/web/agents.py +230 -0
  104. _nullius_app/web/builder.py +406 -0
  105. _nullius_app/web/catalogue.py +370 -0
  106. _nullius_app/web/compare.py +489 -0
  107. _nullius_app/web/core.py +17 -0
  108. _nullius_app/web/execute.py +223 -0
  109. _nullius_app/web/feasibility.py +60 -0
  110. _nullius_app/web/filters.py +231 -0
  111. _nullius_app/web/judge.py +623 -0
  112. _nullius_app/web/judge_tasks.py +33 -0
  113. _nullius_app/web/onboarding.py +20 -0
  114. _nullius_app/web/reconcile.py +47 -0
  115. _nullius_app/web/runs.py +464 -0
  116. _nullius_app/web/settings.py +324 -0
  117. _nullius_app/web/shared.py +507 -0
  118. _nullius_app/web/traces.py +306 -0
  119. _nullius_app/web/workspaces.py +84 -0
  120. nullius/__init__.py +32 -0
  121. nullius/__main__.py +5 -0
  122. nullius/catalogue/__init__.py +0 -0
  123. nullius/catalogue/agents/codex/agent.json +222 -0
  124. nullius/catalogue/agents/codex/config.toml +25 -0
  125. nullius/catalogue/agents/goose/agent.json +131 -0
  126. nullius/catalogue/agents/goose/config.yaml +20 -0
  127. nullius/catalogue/agents/jiuwenswarm/agent.json +197 -0
  128. nullius/catalogue/agents/jiuwenswarm/agent.py +355 -0
  129. nullius/catalogue/agents/mini-swe-agent/agent.json +68 -0
  130. nullius/catalogue/agents/mini-swe-agent/run.py +37 -0
  131. nullius/catalogue/agents/opencode/agent.json +135 -0
  132. nullius/catalogue/agents/opencode/opencode.json +32 -0
  133. nullius/catalogue/agents/reference/agent.json +89 -0
  134. nullius/catalogue/agents/reference/agent.py +209 -0
  135. nullius/catalogue/agents/terminus-2/agent.json +64 -0
  136. nullius/catalogue/agents/terminus-2/run.py +139 -0
  137. nullius/catalogue/benchmarks/gaia/benchmark.json +72 -0
  138. nullius/catalogue/benchmarks/gaia/data-source.json +29 -0
  139. nullius/catalogue/benchmarks/gaia/driver.py +188 -0
  140. nullius/catalogue/benchmarks/gaia/env/data.Dockerfile +1 -0
  141. nullius/catalogue/benchmarks/gaia/standard.json +278 -0
  142. nullius/catalogue/benchmarks/gaia/upstream-settings.json +275 -0
  143. nullius/catalogue/benchmarks/gsm8k/benchmark.json +34 -0
  144. nullius/catalogue/benchmarks/gsm8k/driver.py +101 -0
  145. nullius/catalogue/benchmarks/gsm8k/standard.json +124 -0
  146. nullius/catalogue/benchmarks/gsm8k/upstream-settings.json +86 -0
  147. nullius/catalogue/benchmarks/humaneval/benchmark.json +36 -0
  148. nullius/catalogue/benchmarks/humaneval/driver.py +243 -0
  149. nullius/catalogue/benchmarks/humaneval/standard.json +115 -0
  150. nullius/catalogue/benchmarks/humaneval/upstream-settings.json +72 -0
  151. nullius/catalogue/benchmarks/locomo/benchmark.json +43 -0
  152. nullius/catalogue/benchmarks/locomo/driver.py +270 -0
  153. nullius/catalogue/benchmarks/locomo/standard.json +265 -0
  154. nullius/catalogue/benchmarks/locomo/upstream-settings.json +112 -0
  155. nullius/catalogue/benchmarks/longmemeval/benchmark.json +65 -0
  156. nullius/catalogue/benchmarks/longmemeval/driver.py +379 -0
  157. nullius/catalogue/benchmarks/longmemeval/standard.json +733 -0
  158. nullius/catalogue/benchmarks/longmemeval/upstream-settings.json +76 -0
  159. nullius/catalogue/benchmarks/swe-bench-verified/benchmark.json +87 -0
  160. nullius/catalogue/benchmarks/swe-bench-verified/driver.py +116 -0
  161. nullius/catalogue/benchmarks/swe-bench-verified/images.json +502 -0
  162. nullius/catalogue/benchmarks/swe-bench-verified/standard.json +108 -0
  163. nullius/catalogue/benchmarks/swe-bench-verified/upstream-settings.json +32 -0
  164. nullius/catalogue/benchmarks/tau3-bench/benchmark.json +49 -0
  165. nullius/catalogue/benchmarks/tau3-bench/driver.py +608 -0
  166. nullius/catalogue/benchmarks/tau3-bench/mcp_server.py +114 -0
  167. nullius/catalogue/benchmarks/tau3-bench/search_relay.py +19 -0
  168. nullius/catalogue/benchmarks/tau3-bench/standard.json +547 -0
  169. nullius/catalogue/benchmarks/tau3-bench/upstream-settings.json +639 -0
  170. nullius/catalogue/benchmarks/terminal-bench/benchmark.json +69 -0
  171. nullius/catalogue/benchmarks/terminal-bench/driver.py +267 -0
  172. nullius/catalogue/benchmarks/terminal-bench/standard.json +166 -0
  173. nullius/catalogue/benchmarks/terminal-bench/upstream-settings.json +36 -0
  174. nullius/catalogue/capabilities/keyword-memory/capability.json +33 -0
  175. nullius/catalogue/capabilities/keyword-memory/capability.py +55 -0
  176. nullius/catalogue/capabilities/mem0/capability.json +135 -0
  177. nullius/catalogue/capabilities/mem0/capability.py +173 -0
  178. nullius/catalogue/catalog.py +426 -0
  179. nullius/catalogue/citation.py +116 -0
  180. nullius/catalogue/harbor_entry.py +367 -0
  181. nullius/catalogue/sources.py +107 -0
  182. nullius/catalogue/storage.py +125 -0
  183. nullius/cli.py +85 -0
  184. nullius/compare/__init__.py +0 -0
  185. nullius/compare/cli.py +265 -0
  186. nullius/compare/comparison.py +184 -0
  187. nullius/execution.py +1653 -0
  188. nullius/gitrefs.py +128 -0
  189. nullius/harbor/__init__.py +0 -0
  190. nullius/harbor/feed.py +228 -0
  191. nullius/harbor/source.py +582 -0
  192. nullius/hosts.py +368 -0
  193. nullius/importers/__init__.py +140 -0
  194. nullius/importers/atif.py +387 -0
  195. nullius/importers/cli.py +135 -0
  196. nullius/importers/otel.py +274 -0
  197. nullius/judge/__init__.py +14 -0
  198. nullius/judge/batch.py +122 -0
  199. nullius/judge/client.py +433 -0
  200. nullius/judge/floors.json +86 -0
  201. nullius/judge/lanes.py +89 -0
  202. nullius/judge/questions.py +309 -0
  203. nullius/judge/reconcile.py +176 -0
  204. nullius/judge/state.py +224 -0
  205. nullius/judge/store.py +167 -0
  206. nullius/migrate.py +268 -0
  207. nullius/onboarding.py +116 -0
  208. nullius/paths.py +89 -0
  209. nullius/prerequisites.py +129 -0
  210. nullius/prices.py +283 -0
  211. nullius/progress.py +294 -0
  212. nullius/providers.py +335 -0
  213. nullius/recipes/__init__.py +0 -0
  214. nullius/recipes/launch.py +78 -0
  215. nullius/redact.py +72 -0
  216. nullius/runs/__init__.py +0 -0
  217. nullius/runs/artifacts.py +67 -0
  218. nullius/runs/classify.py +216 -0
  219. nullius/runs/cli.py +316 -0
  220. nullius/runs/feasibility.py +442 -0
  221. nullius/runs/launches.py +149 -0
  222. nullius/runs/live.py +715 -0
  223. nullius/runs/parse.py +1016 -0
  224. nullius/runs/verifier.py +241 -0
  225. nullius/sandbox.py +109 -0
  226. nullius/secrets.py +218 -0
  227. nullius/settings.py +544 -0
  228. nullius/standard/__init__.py +15 -0
  229. nullius/standard/acp.py +305 -0
  230. nullius/standard/cancellation.py +19 -0
  231. nullius/standard/cli.py +703 -0
  232. nullius/standard/conform.py +149 -0
  233. nullius/standard/container.py +1870 -0
  234. nullius/standard/definitions.py +1651 -0
  235. nullius/standard/egress.py +192 -0
  236. nullius/standard/fidelity.py +256 -0
  237. nullius/standard/forward.py +139 -0
  238. nullius/standard/hostreq.py +105 -0
  239. nullius/standard/howto.py +220 -0
  240. nullius/standard/install.py +428 -0
  241. nullius/standard/job.py +551 -0
  242. nullius/standard/jsonl.py +129 -0
  243. nullius/standard/kits/agent-conversation-v1/driver.py +27 -0
  244. nullius/standard/kits/agent-conversation-v1/standard.json +26 -0
  245. nullius/standard/kits/agent-search-v1/driver.py +171 -0
  246. nullius/standard/kits/agent-search-v1/standard.json +99 -0
  247. nullius/standard/kits/agent-task-v1/driver.py +25 -0
  248. nullius/standard/kits/agent-task-v1/standard.json +100 -0
  249. nullius/standard/kits/agent-tools-v1/driver.py +206 -0
  250. nullius/standard/kits/agent-tools-v1/mcp_kit.py +209 -0
  251. nullius/standard/kits/agent-tools-v1/standard.json +119 -0
  252. nullius/standard/kits/agent-workspace-v1/driver.py +65 -0
  253. nullius/standard/kits/agent-workspace-v1/standard.json +95 -0
  254. nullius/standard/kits/cap-memory-v1/driver.py +39 -0
  255. nullius/standard/kits/cap-memory-v1/standard.json +91 -0
  256. nullius/standard/ledger.py +326 -0
  257. nullius/standard/match.py +66 -0
  258. nullius/standard/mcp_bridge.py +62 -0
  259. nullius/standard/mcp_machine.py +193 -0
  260. nullius/standard/merge.py +239 -0
  261. nullius/standard/names.py +37 -0
  262. nullius/standard/network_requirements.py +44 -0
  263. nullius/standard/pace.py +53 -0
  264. nullius/standard/payload.py +278 -0
  265. nullius/standard/pins.py +130 -0
  266. nullius/standard/ports.py +70 -0
  267. nullius/standard/prove.py +373 -0
  268. nullius/standard/recipe.py +746 -0
  269. nullius/standard/relay.py +785 -0
  270. nullius/standard/run.py +1781 -0
  271. nullius/standard/setup_container.py +208 -0
  272. nullius/standard/shard.py +71 -0
  273. nullius/standard/web_services.py +30 -0
  274. nullius/traces/__init__.py +0 -0
  275. nullius/traces/behavior.py +131 -0
  276. nullius/traces/charts.py +898 -0
  277. nullius/traces/conversation.py +159 -0
  278. nullius/traces/otel.py +608 -0
  279. nullius/traces/trace.py +1477 -0
  280. nullius/traces/trajectory.py +586 -0
  281. nullius/workspace.py +417 -0
  282. nullius/workspace_cli.py +119 -0
  283. nullius_eval-0.1.0.dist-info/METADATA +93 -0
  284. nullius_eval-0.1.0.dist-info/RECORD +291 -0
  285. nullius_eval-0.1.0.dist-info/WHEEL +5 -0
  286. nullius_eval-0.1.0.dist-info/entry_points.txt +2 -0
  287. nullius_eval-0.1.0.dist-info/licenses/LICENSE +202 -0
  288. nullius_eval-0.1.0.dist-info/licenses/app/static/fonts/dmsans-OFL.txt +93 -0
  289. nullius_eval-0.1.0.dist-info/licenses/app/static/fonts/ibmplexmono-OFL.txt +93 -0
  290. nullius_eval-0.1.0.dist-info/licenses/app/static/fonts/instrumentserif-OFL.txt +93 -0
  291. nullius_eval-0.1.0.dist-info/top_level.txt +2 -0
@@ -0,0 +1,329 @@
1
+ {% extends "base.html" %}
2
+ {% block title %}{{ task }} side by side — Nullius{% endblock %}
3
+ {% block head %}<link rel="stylesheet" href="{{ url_for('static', filename='compare/comparison.css') }}">
4
+ <style>
5
+ /* The distributions panel is the trial page's, unchanged; inside a grid cell
6
+ its own box would double the cell's. */
7
+ .cmp-cell > .panel { border: 0; padding: 0; margin: 0; background: transparent; }
8
+ .cmp-cell .strip-caption { margin: .9rem 0 .35rem; font-size: .78rem; color: var(--text-dim); }
9
+ .cmp-cell .strip-caption:first-child { margin-top: 0; }
10
+ </style>{% endblock %}
11
+ {% block crumb %}/ <a href="{{ url_for('compare', pick=picks, cohort=cohort) }}">compare</a> / {{ task }}{% endblock %}
12
+ {% import "traces/_charts.html" as ui %}
13
+
14
+ {# Same shape as the trial page's `view_url`, so the shared chart macros can
15
+ call it without knowing which page they are on. Only the legend state rides
16
+ in it: this page has no trace filter, so `f` is always the empty one. #}
17
+ {% macro view_url(f, cf=none) -%}
18
+ {{ url_for('compare_task', task=task, pick=picks, cohort=cohort, dataset=dataset,
19
+ **((cf if cf is not none else chart_filter).query)) }}
20
+ {%- endmacro %}
21
+
22
+ {% block body %}
23
+
24
+ <div class="page-title"><h1 class="mono">{{ task }}</h1></div>
25
+ <p class="subtitle">{{ panels|length }} runs side by side<span class="dot">·</span>
26
+ <a href="{{ url_for('compare', pick=picks, cohort=cohort) }}">back to the comparison</a><span class="dot">·</span>
27
+ <span class="faint">drag a column header to reorder</span></p>
28
+ <div class="cohort-note">
29
+ <p>{{ 'Dataset not recorded' if dataset.startswith('[unidentified:') else dataset }} · {{ 'Matched tasks' if cohort == 'matched' else 'Whole runs' }}</p>
30
+ {% if panels|selectattr('attempts', 'gt', 1)|list %}<p>A run has repeated attempts on this task. This page shows the last indexed attempt, matching the task table; all attempts remain in the comparison totals.</p>{% endif %}
31
+ </div>
32
+
33
+ {# One grid, sections as full-width rows. Each section's cells land on the same
34
+ grid row, so every run's "Files edited" starts at the same y — which separate
35
+ per-run cards can never guarantee. #}
36
+ <div class="table-wrap">
37
+ <div class="cmp-grid" style="--cols: {{ panels|length }}">
38
+
39
+ {% for p in panels %}
40
+ <div class="cmp-head draggable-col" draggable="true" data-job="{{ p.selection.value }}" title="Drag to reorder">
41
+ <div class="pane-title compare-trial-heading">
42
+ <h2>{{ p.job.agent_label or p.job.job_id }}</h2>
43
+ <span class="compare-trial-tags">
44
+ {% if p.job.is_control %}<span class="chip-control"
45
+ title="Harbor control: applies the gold patch or does nothing. Never calls a model, and never ranked.">control</span>{% endif %}
46
+ {% if p.trial %}
47
+ <span class="tag oc-{{ p.trial.outcome }}">{{ p.trial.outcome_label }}</span>
48
+ {% if p.trial.is_regression %}<span class="badge danger">⚠ broke {{ p.trial.p2p_fail }}</span>{% endif %}
49
+ {% else %}<span class="tag">not run</span>{% endif %}
50
+ </span>
51
+ </div>
52
+ <div class="pane-links">
53
+ <a class="pane-id faint mono" href="{{ url_for('job', job_id=p.job.job_id, workspace=p.selection.workspace) }}"
54
+ title="{{ p.job.job_id }}">{{ p.job.job_id }}</a>
55
+ {% if p.trial %}
56
+ <a class="pane-open" href="{{ url_for('trial', job_id=p.trial.job_id, trial_name=p.trial.trial_name, workspace=p.selection.workspace) }}"
57
+ title="Every step, tool call and observation for this run">Open full trial →</a>
58
+ {% endif %}
59
+ </div>
60
+ <p class="compare-workspace">{{ p.selection.workspace_label }}{% if p.attempts > 1 %} · {{ p.attempts }} attempts, last indexed shown{% endif %}</p>
61
+ </div>
62
+ {% endfor %}
63
+
64
+ <h3 class="cmp-section">Result</h3>
65
+ {% for p in panels %}
66
+ <div class="cmp-cell">
67
+ {% if not p.trial %}<p class="muted" style="margin:0">Didn't include this task.</p>{% else %}
68
+ {# Check rows come from the dataset's Vocabulary. Panels compare one task,
69
+ so every panel shares a dataset and the conditional rows stay aligned
70
+ across the grid — the same property the unconditional rows below rely
71
+ on. #}
72
+ {% set vocab = p.trial.vocab %}
73
+ <dl class="pane-stats">
74
+ {% if vocab.gained %}<div><dt>{{ vocab.gained }}</dt><dd>{% if p.trial.f2p_pass or p.trial.f2p_fail %}<span class="ok">{{ p.trial.f2p_pass }}</span>/<span class="bad">{{ p.trial.f2p_fail }}</span>{% else %}<span class="faint">—</span>{% endif %}</dd></div>{% endif %}
75
+ {% if vocab.held %}<div><dt>{{ vocab.held }}</dt><dd>{% if p.trial.p2p_pass or p.trial.p2p_fail %}<span class="ok">{{ p.trial.p2p_pass }}</span>/<span class="bad">{{ p.trial.p2p_fail }}</span>{% else %}<span class="faint">—</span>{% endif %}</dd></div>{% endif %}
76
+ {% if vocab.has_patch %}<div><dt>Patch applied</dt><dd>{% if p.trial.patch_exists is none %}—{% else %}{{ 'Yes' if p.trial.patch_applied else 'No' }}{% endif %}</dd></div>{% endif %}
77
+ <div><dt>Agent time</dt><dd>{{ p.trial.dur_agent|secs }}</dd></div>
78
+ {# Emit these two unconditionally. pane-stats is a grid, so a panel with
79
+ fewer items shifts every later metric up a row and the columns stop
80
+ lining up — an agent's "Tool calls" ends up level with the oracle's
81
+ "Prompt size", and the oracle looks like it made tool calls. #}
82
+ <div><dt>Steps</dt><dd>{% if p.traj %}{{ p.traj.n_steps }}{% else %}<span class="faint">—</span>{% endif %}</dd></div>
83
+ <div><dt>Tool calls</dt><dd>
84
+ {%- if p.traj %}{{ p.traj.calls|length }}
85
+ {%- if p.traj.n_failed_calls %} <span class="bad">({{ p.traj.n_failed_calls }} failed)</span>{% endif %}
86
+ {%- else %}<span class="faint">—</span>{% endif -%}
87
+ </dd></div>
88
+ <div><dt>Prompt size</dt><dd>{{ p.trial.n_input_tokens|tokens(p.job.kind) }}</dd></div>
89
+ <div><dt>Fresh prompt</dt><dd>{{ (p.trial.n_input_tokens - p.trial.n_cache_tokens)|tokens(p.job.kind) }}</dd></div>
90
+ <div><dt>Cached</dt><dd>{{ p.trial.n_cache_tokens|tokens(p.job.kind) }}</dd></div>
91
+ <div><dt>Cached ratio</dt><dd>
92
+ {# 0 cached over 0 prompt is undefined, not 0% — controls get "—" here
93
+ even though their token counts are real zeros. #}
94
+ {%- if p.trial.n_input_tokens %}{{ (100 * p.trial.n_cache_tokens / p.trial.n_input_tokens)|round|int }}%{% else %}—{% endif -%}
95
+ </dd></div>
96
+ <div><dt>Output tokens</dt><dd>{{ p.trial.n_output_tokens|tokens(p.job.kind) }}</dd></div>
97
+ <div><dt title="An estimate: priced by the agent from its price table over the recorded usage, not a figure from the provider. — where the agent recorded none">Cost (estimated)</dt>
98
+ <dd class="{{ '' if (p.trial.cost_usd or p.job.is_control) else 'faint' }}">{{ p.trial.cost_usd|usd(p.job.kind) }}</dd></div>
99
+ </dl>
100
+ {% endif %}
101
+ </div>
102
+ {% endfor %}
103
+
104
+ <h3 class="cmp-section">Where the time went</h3>
105
+ {% for p in panels %}
106
+ <div class="cmp-cell">
107
+ {% if p.trial %}
108
+ {# Four phases in execution order. A 0s phase emits no segment, so a
109
+ control's empty setup leaves no stray sliver. #}
110
+ <div class="bar phases">
111
+ {% if p.trial.dur_env|phase %}<span class="seg ph-env" style="flex:{{ p.trial.dur_env|phase }}" title="Env {{ p.trial.dur_env|secs }}"></span>{% endif %}
112
+ {% if p.trial.dur_agent_setup|phase %}<span class="seg ph-setup" style="flex:{{ p.trial.dur_agent_setup|phase }}" title="Agent setup {{ p.trial.dur_agent_setup|secs }}"></span>{% endif %}
113
+ {% if p.trial.dur_agent|phase %}<span class="seg ph-agent" style="flex:{{ p.trial.dur_agent|phase }}" title="Agent {{ p.trial.dur_agent|secs }}"></span>{% endif %}
114
+ {% if p.trial.dur_verifier|phase %}<span class="seg ph-verify" style="flex:{{ p.trial.dur_verifier|phase }}" title="Verify {{ p.trial.dur_verifier|secs }}"></span>{% endif %}
115
+ {% if p.trial.dur_other|phase %}<span class="seg ph-other" style="flex:{{ p.trial.dur_other|phase }}" title="Other {{ p.trial.dur_other|secs }} — time in the trial that Harbor does not attribute to a phase: image pull, container start and teardown, artifact collection"></span>{% endif %}
116
+ </div>
117
+ <div class="legend" style="margin:.5rem 0 0">
118
+ <span class="chip ph-env">Env <b>{{ p.trial.dur_env|secs }}</b></span>
119
+ <span class="chip ph-setup">Setup <b>{{ p.trial.dur_agent_setup|secs }}</b></span>
120
+ <span class="chip ph-agent">Agent <b>{{ p.trial.dur_agent|secs }}</b></span>
121
+ <span class="chip ph-verify">Verify <b>{{ p.trial.dur_verifier|secs }}</b></span>
122
+ <span class="chip ph-other"
123
+ title="Time Harbor does not attribute to a phase: image pull, container start and teardown, artifact collection">Other <b>{{ p.trial.dur_other|secs }}</b></span>
124
+ </div>
125
+ {% else %}<span class="faint">—</span>{% endif %}
126
+ </div>
127
+ {% endfor %}
128
+
129
+ {# ---- traces, side by side ----
130
+ Two sections from each side's own trace.json, and nothing across them.
131
+ The charts are the trial page's, through the same macro over the same
132
+ `charts_of` — a side here draws what the trial's own page draws for it.
133
+ Each side is loaded alone: two trials never shared a clock,
134
+ so there is no pooled population, no combined wall clock and no waterfall.
135
+ A side without a trace says so in its own cell rather than vanishing. #}
136
+ <h3 class="cmp-section">Traces
137
+ <span class="muted" style="font-weight:400">· each side from its own capture, nothing pooled across them</span></h3>
138
+ {% for p in panels %}
139
+ <div class="cmp-cell">
140
+ {% if p.charts %}
141
+ {% set breakdown_tail %}<b>Time breakdown</b> below is this side's accounting of where its seconds went; this is the shape of the calls that spent them.{% endset %}
142
+ {# `empty_note` names this page's one reason for an empty plot: there is no
143
+ filter here, so "every span is filtered out" could never be it. #}
144
+ {{ ui.charts_panel(p.charts, chart_filter, no_filter, view_url, tail=breakdown_tail,
145
+ empty_note="None of the " ~ p.charts.total ~ " spans in this trace has a known duration — there is nothing to plot.") }}
146
+ {% else %}<p class="muted" style="margin:0">{{ p.absent }}</p>{% endif %}
147
+ </div>
148
+ {% endfor %}
149
+
150
+ {# Two strips per side, never mixed and never compared by a Δ. The first is
151
+ the producer's `totals`, verbatim — its own arithmetic, which differs by
152
+ producer: one sums its LLM spans and can exceed its wall clock, another
153
+ partitions. The second is this reader's partition over the whole tree,
154
+ the same arithmetic on both sides, which is the one strip two producers'
155
+ traces can honestly be read across. Shares are of each side's own wall
156
+ clock; no number here adds one side's clock to the other's. #}
157
+ <h3 class="cmp-section">Time breakdown
158
+ <span class="muted" style="font-weight:400">· categories, not a timeline</span></h3>
159
+ {% for p in panels %}
160
+ <div class="cmp-cell">
161
+ {% if p.trace and not p.trace.error %}
162
+ {% set tr = p.trace %}
163
+ {% set clocked = 'inferred' if tr.zero_measured else 'measured' %}
164
+ <p class="strip-caption">Reported by the trace
165
+ {%- if tr.totals.wall_ns %} · <b>{{ tr.totals.wall_ns|nsdur }}</b> {{ clocked }}{% endif %}
166
+ {%- if tr.zero_measured %} · <span class="bad">inferred, not measured</span>{% endif %}</p>
167
+ {% if tr.totals.segments %}
168
+ <div class="bar strip">
169
+ {% for s in tr.totals.segments %}
170
+ <span class="seg tt-{{ s.key }}" style="flex:{{ s.ns }}"
171
+ title="{{ s.label }}: {{ s.ns|nsdur }} · {{ s.pct|share }} of the {{ tr.totals.wall_ns|nsdur }} {{ clocked }}"></span>
172
+ {% endfor %}
173
+ </div>
174
+ <div class="legend" style="margin-bottom:0">
175
+ {% for s in tr.totals.segments %}
176
+ <span class="chip tt-{{ s.key }}">{{ s.label }} <b>{{ s.ns|nsdur }}</b> <span class="faint">{{ s.pct|share }}</span></span>
177
+ {% endfor %}
178
+ </div>
179
+ {% else %}<p class="muted small" style="margin:0">The trace reports no totals.</p>{% endif %}
180
+
181
+ <p class="strip-caption">Partitioned here <span class="faint">· every instant charged once</span></p>
182
+ {% set part = tr.baseline.segments %}
183
+ {% if part %}
184
+ <div class="bar strip">
185
+ {% for s in part %}
186
+ <span class="seg tt-{{ s.key }}" style="flex:{{ s.ns }}"
187
+ title="{{ s.label }}: {{ s.ns|nsdur }} · {{ s.pct|share }} of the {{ tr.baseline.wall_ns|nsdur }} {{ clocked }}"></span>
188
+ {% endfor %}
189
+ </div>
190
+ <div class="legend" style="margin-bottom:0">
191
+ {% for s in part %}
192
+ <span class="chip tt-{{ s.key }}">{{ s.label }} <b>{{ s.ns|nsdur }}</b> <span class="faint">{{ s.pct|share }}</span></span>
193
+ {% endfor %}
194
+ </div>
195
+ {% else %}<p class="muted small" style="margin:0">No span carries a usable clock — nothing to partition.</p>{% endif %}
196
+ <p class="muted small" style="margin:.75rem 0 0">Two accountings of the same {{ tr.totals.wall_ns|nsdur if tr.totals.wall_ns else 'run' }},
197
+ shown apart and never mixed. The first is the producer's own and is displayed as reported —
198
+ producers differ, and one that sums its LLM spans can exceed its wall clock. The second charges
199
+ every instant to exactly one category (waiting on a human beats real work, which beats the
200
+ call it ran inside) and is the same arithmetic on every side of this page, so it is the strip
201
+ to read across. Neither is summed from the charts above: spans nest, so adding them up
202
+ double-counts.</p>
203
+ {% else %}<p class="muted" style="margin:0">{{ p.absent }}</p>{% endif %}
204
+ </div>
205
+ {% endfor %}
206
+
207
+ <h3 class="cmp-section">Flow</h3>
208
+ {% for p in panels %}
209
+ <div class="cmp-cell">
210
+ {% if p.traj %}
211
+ <div class="flow">
212
+ {% for c in p.traj.calls %}
213
+ <span class="flow-cell cat-{{ c.category }}{% if c.failure %} failed{% endif %}"
214
+ title="#{{ c.step_id }} {{ c.category }}{% if c.target %} · {{ c.target[:70] }}{% endif %}{% if c.failure %} — {{ c.failure[:80] }}{% endif %}"></span>
215
+ {% endfor %}
216
+ </div>
217
+ <div class="legend" style="margin:.6rem 0 0">
218
+ {% for cat, n in p.traj.category_freq.most_common() %}
219
+ <span class="chip cat-{{ cat }}">{{ cat }} <b>{{ n }}</b></span>
220
+ {% endfor %}
221
+ </div>
222
+ {% else %}<span class="faint">—</span>{% endif %}
223
+ </div>
224
+ {% endfor %}
225
+
226
+ {% if panels|selectattr('trial')|selectattr('trial.p2p_failures')|list
227
+ or panels|selectattr('trial')|selectattr('trial.f2p_failures')|list %}
228
+ <h3 class="cmp-section">Tests still failing</h3>
229
+ {% for p in panels %}
230
+ <div class="cmp-cell">
231
+ {% if p.trial and p.trial.p2p_failures %}
232
+ <p class="bad small" style="margin:0 0 .3rem">Broke {{ p.trial.p2p_fail }} passing:</p>
233
+ <ul class="files tight">{% for f in p.trial.p2p_failures %}<li class="mono bad">{{ f }}</li>{% endfor %}</ul>
234
+ {% endif %}
235
+ {% if p.trial and p.trial.f2p_failures %}
236
+ <ul class="files tight">{% for f in p.trial.f2p_failures %}<li class="mono faint">{{ f }}</li>{% endfor %}</ul>
237
+ {% elif not (p.trial and p.trial.p2p_failures) %}<span class="faint">—</span>{% endif %}
238
+ </div>
239
+ {% endfor %}
240
+ {% endif %}
241
+
242
+ <h3 class="cmp-section">Files edited</h3>
243
+ {% for p in panels %}
244
+ <div class="cmp-cell">
245
+ {% if p.traj and p.traj.files_touched %}
246
+ <ul class="files tight">{% for f in p.traj.files_touched %}<li class="mono">{{ f }}</li>{% endfor %}</ul>
247
+ {% else %}<span class="faint">None recorded.</span>{% endif %}
248
+ </div>
249
+ {% endfor %}
250
+
251
+ <h3 class="cmp-section">Tool calls</h3>
252
+ {% for p in panels %}
253
+ <div class="cmp-cell">
254
+ {% if p.traj %}
255
+ <div class="calls-scroll">
256
+ <table class="grid compact calls">
257
+ <thead><tr><th class="c-n">#</th><th class="c-kind">Kind</th><th>Target</th><th class="c-res">Result</th></tr></thead>
258
+ <tbody>
259
+ {% for c in p.traj.calls %}
260
+ <tr class="{% if c.failure %}row-failed{% endif %}">
261
+ <td class="num faint">{{ c.step_id }}</td>
262
+ <td><span class="cat-tag cat-{{ c.category }}"><span class="cat-dot"></span>{{ c.category }}</span></td>
263
+ <td class="mono faint clip" title="{{ c.target }}">{{ c.target or '—' }}</td>
264
+ <td class="clip">{% if c.failure %}<span class="bad" title="{{ c.failure }}">× {{ c.failure }}</span>
265
+ {%- else %}<span class="faint">ok</span>{% endif %}</td>
266
+ </tr>
267
+ {% endfor %}
268
+ </tbody>
269
+ </table>
270
+ </div>
271
+ {% else %}<span class="faint">—</span>{% endif %}
272
+ </div>
273
+ {% endfor %}
274
+
275
+ <h3 class="cmp-section">Final message</h3>
276
+ {% for p in panels %}
277
+ <div class="cmp-cell">
278
+ {% if p.traj and p.traj.last_agent_message %}
279
+ <details class="tc"><summary><span class="name">Show</span></summary>
280
+ <pre class="msg">{{ p.traj.last_agent_message }}</pre></details>
281
+ {% else %}<span class="faint">—</span>{% endif %}
282
+ </div>
283
+ {% endfor %}
284
+ </div>
285
+ </div>
286
+
287
+ <script>
288
+ /* Drag a column header to reorder — same URL-driven approach as /compare. */
289
+ (() => {
290
+ const ORDER = {{ picks|tojson }};
291
+ let dragged = null;
292
+ const clear = () => document.querySelectorAll('.draggable-col').forEach(el =>
293
+ el.classList.remove('dragging', 'drop-before', 'drop-after'));
294
+
295
+ document.querySelectorAll('.draggable-col').forEach(el => {
296
+ el.addEventListener('dragstart', e => {
297
+ dragged = el.dataset.job;
298
+ el.classList.add('dragging');
299
+ e.dataTransfer.effectAllowed = 'move';
300
+ e.dataTransfer.setData('text/plain', dragged);
301
+ });
302
+ el.addEventListener('dragend', clear);
303
+ el.addEventListener('dragover', e => {
304
+ if (!dragged || el.dataset.job === dragged) return;
305
+ e.preventDefault();
306
+ const box = el.getBoundingClientRect();
307
+ const after = e.clientX > box.left + box.width / 2;
308
+ el.classList.toggle('drop-before', !after);
309
+ el.classList.toggle('drop-after', after);
310
+ });
311
+ el.addEventListener('dragleave', () => el.classList.remove('drop-before', 'drop-after'));
312
+ el.addEventListener('drop', e => {
313
+ e.preventDefault();
314
+ const target = el.dataset.job;
315
+ if (!dragged || target === dragged) return clear();
316
+ const box = el.getBoundingClientRect();
317
+ const after = e.clientX > box.left + box.width / 2;
318
+ const next = ORDER.filter(id => id !== dragged);
319
+ next.splice(next.indexOf(target) + (after ? 1 : 0), 0, dragged);
320
+ const url = new URL({{ url_for('compare_task', task=task)|tojson }}, location.origin);
321
+ next.forEach(id => url.searchParams.append('pick', id));
322
+ url.searchParams.set('cohort', {{ cohort|tojson }});
323
+ url.searchParams.set('dataset', {{ dataset|tojson }});
324
+ location.href = url;
325
+ });
326
+ });
327
+ })();
328
+ </script>
329
+ {% endblock %}
@@ -0,0 +1,131 @@
1
+ {# A run started from the builder, as the page that follows it: state, host, the run's own log (uv, Harbor, the tasks, the run),
2
+ a Stop while it lives. Shown on the job page beside the job, and instead of it while Harbor has not written the job yet. #}
3
+ {# `csrf` is an argument, not a context lookup: an imported macro sees no
4
+ template context, so a `{{ csrf }}` inside it rendered empty and every
5
+ Stop and Continue answered 403. #}
6
+ {# `own`: this job's own (state, finished) when the run is of several agents - an arm that
7
+ answered everything is done though a later arm failed; the run's state is said beside it. #}
8
+ {% macro execution_strip(ex, csrf, waiting=false, own=none) %}
9
+ {% set shown = own[0] if own else ex.state %}
10
+ <section class="execution" id="execution" data-run="{{ url_for('run_status', run_id=ex.id) }}" data-stop="{{ url_for('run_stop', run_id=ex.id) }}" data-continue="{{ url_for('run_continue', run_id=ex.id) }}"
11
+ data-live="{{ 'yes' if ex.state in ('preparing', 'running') else 'no' }}" data-waiting="{{ 'yes' if waiting else 'no' }}" data-csrf="{{ csrf }}" data-own="{{ own[0] if own else '' }}">
12
+ <div class="execution-line">
13
+ <span class="chip {{ 'st-runs' if shown == 'done' else 'st-blocked' if shown == 'failed' else 'st-lane' }}" id="execution-state">{{ shown }}{% if not own and ex.step and ex.state in ('preparing', 'running') %} · {{ ex.step }}{% endif %}</span>
14
+ <span class="small">on <strong>{{ ex.plan.host.label if ex.plan.host else 'this machine' }}</strong></span>
15
+ {% if ex.error and not own %}<span class="small bad" id="execution-error">{{ ex.error }}</span>{% endif %}
16
+ <span class="small muted" id="execution-run"{% if not own or ex.state == shown %} hidden{% endif %}>· the run: {{ ex.state }}{% if ex.error %} · {{ ex.error }}{% endif %}</span>
17
+ {% if ex.state in ('preparing', 'running', 'paused') %}<button type="button" class="btn sm ghost" id="execution-stop">Stop</button>{% endif %}
18
+ </div>
19
+ {# an agent's run failed with more to come: the question, and the answer #}
20
+ <div class="execution-ask" id="execution-ask" {% if ex.state != 'paused' %}hidden{% endif %}>
21
+ <span class="small bad" id="execution-question">{{ ex.question or '' }}</span>
22
+ <button type="button" class="btn sm" id="execution-continue">Continue</button>
23
+ </div>
24
+ {# what the run is doing: a stepper of the stages before its first unit (a check when done, its number until then), then its units (nullius/progress.py) #}
25
+ {% set sp = ex.stages() %}
26
+ <div class="execution-stages" id="execution-stages"{% if not sp.stages and not sp.units %} hidden{% endif %}>
27
+ <ol class="xs-list" id="execution-stage-list">{% for st in sp.stages %}
28
+ <li class="xs {{ st.state }}"{% if st.detail %} title="{{ st.detail }}"{% endif %}{% if st.state == 'running' %} aria-current="step"{% endif %}><i aria-hidden="true">{{ '' if st.state in ('done', 'cached') else '✕' if st.state == 'failed' else loop.index }}</i><span class="xs-label">{{ st.label }}</span>
29
+ {%- if st.state == 'cached' %}<span class="xs-time">cached</span>{% elif st.get('seconds') is not none and st.state in ('done', 'failed') %}<span class="xs-time">{{ st.seconds|secs }}</span>{% endif %}
30
+ {%- if st.state in ('running', 'failed') and st.detail and st.detail != sp.detail %}<span class="xs-detail">{{ st.detail }}</span>{% endif %}</li>{% endfor %}
31
+ </ol>
32
+ <div class="xs-units" id="execution-units"{% if not sp.units %} hidden{% endif %}>{% if sp.units %}{% set u = sp.units %}<progress max="{{ u.n or 1 }}" value="{{ u.done }}"></progress><span class="small"><b>{{ u.done }} / {{ u.n if u.n is not none else '?' }}</b> {{ u.noun }}{% for k in ('passed', 'failed', 'scored', 'errors') if u[k] %} · {{ u[k] }} {{ 'error' + ('' if u[k] == 1 else 's') if k == 'errors' else k }}{% endfor %}{% if u.running %} · {{ u.running }} running{% endif %}</span>{% endif %}</div>
33
+ <div class="small bad" id="execution-refused"{% if sp.ended != 'refused' %} hidden{% endif %}>{% if sp.ended == 'refused' %}Refused before its first unit: {{ sp.detail }}{% endif %}</div>
34
+ </div>
35
+ {# a part downloading: its file, how much of it, as a bar #}
36
+ <div class="execution-progress" id="execution-progress" hidden><progress id="execution-bar" max="1" value="0"></progress><span class="small mono" id="execution-progress-text"></span></div>
37
+ <details class="execution-log" {% if waiting %}open{% endif %}><summary class="small">Run log</summary><pre id="execution-lines"></pre></details>
38
+ </section>
39
+ <script>
40
+ (() => {
41
+ const box = document.getElementById('execution'), pre = document.getElementById('execution-lines'), state = document.getElementById('execution-state');
42
+ let since = 0, live = box.dataset.live === 'yes';
43
+ // the stages, drawn as the template draws them: the same marks, times and units line. A step keeps
44
+ // its element from one answer to the next, so its mark changes in place and the running one's beat goes on.
45
+ const secs = v => v < 9.95 ? v.toFixed(1) + 's' : v < 60 ? Math.round(v) + 's' : (v / 60).toFixed(1) + 'm';
46
+ const clock = s => Math.floor(s / 60) + ':' + String(Math.floor(s % 60)).padStart(2, '0');
47
+ const el = (tag, cls, text) => { const e = document.createElement(tag); if (cls) e.className = cls; if (text != null) e.textContent = text; return e; };
48
+ const stages = sp => {
49
+ const wrap = document.getElementById('execution-stages'), list = document.getElementById('execution-stage-list'), units = document.getElementById('execution-units');
50
+ if (!sp || (!sp.stages.length && !sp.units)) return;
51
+ wrap.hidden = false;
52
+ sp.stages.forEach((st, n) => {
53
+ const li = list.children[n] || list.appendChild(el('li'));
54
+ li.className = 'xs ' + st.state;
55
+ li.title = st.detail || '';
56
+ if (st.state === 'running') li.setAttribute('aria-current', 'step'); else li.removeAttribute('aria-current');
57
+ let mark = li.querySelector('i');
58
+ if (!mark) { mark = el('i'); mark.setAttribute('aria-hidden', 'true'); li.append(mark); }
59
+ mark.textContent = {done: '', cached: '', failed: '✕'}[st.state] ?? String(n + 1);
60
+ while (mark.nextSibling) mark.nextSibling.remove();
61
+ li.append(el('span', 'xs-label', st.label));
62
+ if (st.state === 'cached') li.append(el('span', 'xs-time', 'cached'));
63
+ else if (st.state === 'running' && st.t) li.append(el('span', 'xs-time', clock(Math.max(0, Date.now() / 1000 - st.t))));
64
+ else if (st.seconds != null && (st.state === 'done' || st.state === 'failed')) li.append(el('span', 'xs-time', secs(st.seconds)));
65
+ if (st.state === 'running' && st.bytes != null) li.append(el('span', 'xs-detail', Math.round(st.bytes / 1e6) + (st.total ? ' of ' + Math.round(st.total / 1e6) : '') + ' MB'));
66
+ else if ((st.state === 'running' || st.state === 'failed') && st.detail && st.detail !== sp.detail) li.append(el('span', 'xs-detail', st.detail));
67
+ });
68
+ while (list.children.length > sp.stages.length) list.lastElementChild.remove();
69
+ const refused = document.getElementById('execution-refused');
70
+ refused.hidden = sp.ended !== 'refused'; refused.textContent = sp.ended === 'refused' ? 'Refused before its first unit: ' + sp.detail : '';
71
+ const u = sp.units;
72
+ units.hidden = !u;
73
+ if (u) {
74
+ const bar = el('progress'); bar.max = u.n || 1; bar.value = u.done;
75
+ const txt = el('span', 'small'); txt.append(el('b', '', u.done + ' / ' + (u.n != null ? u.n : '?')), ' ' + u.noun);
76
+ for (const k of ['passed', 'failed', 'scored', 'errors']) if (u[k]) txt.append(' · ' + u[k] + ' ' + (k === 'errors' ? (u[k] === 1 ? 'error' : 'errors') : k));
77
+ if (u.running) txt.append(' · ' + u.running + ' running');
78
+ units.replaceChildren(bar, txt);
79
+ }
80
+ };
81
+ const tick = async () => {
82
+ let retry = true;
83
+ try {
84
+ const r = await nulliusFetch(box.dataset.run + '?since=' + since, {cache: 'no-store'}); if (!r.ok) return;
85
+ const j = await r.json();
86
+ if (j.log.length) { pre.textContent += j.log.join('\n') + '\n'; pre.scrollTop = pre.scrollHeight; since = j.lines; }
87
+ const bar = document.getElementById('execution-progress'), p = j.progress;
88
+ bar.hidden = !p;
89
+ if (p) {
90
+ const mb = n => Math.round(n / 1e6);
91
+ document.getElementById('execution-bar').max = p.total || 1; document.getElementById('execution-bar').value = p.total ? Math.min(p.done, p.total) : 0;
92
+ document.getElementById('execution-progress-text').textContent = p.label + ' · ' + mb(p.done) + (p.total ? ' of ' + mb(p.total) + ' MB (' + Math.floor(100 * p.done / p.total) + '%)' : ' MB');
93
+ }
94
+ stages(j.stages);
95
+ const alive = ['preparing', 'running', 'paused', 'stopping'].includes(j.state), own = box.dataset.own;
96
+ retry = alive;
97
+ if (own) { // this arm has ended: its chip stays, the run's state goes beside it
98
+ const run = document.getElementById('execution-run');
99
+ run.hidden = j.state === own; run.textContent = '· the run: ' + j.state + (alive && j.step && j.state !== 'paused' ? ' · ' + j.step : '') + (j.error ? ' · ' + j.error : '');
100
+ } else {
101
+ state.textContent = j.state + (alive && j.step && j.state !== 'paused' ? ' · ' + j.step : '');
102
+ state.className = 'chip ' + (j.state === 'done' ? 'st-runs' : j.state === 'failed' ? 'st-blocked' : (j.state === 'paused' || j.state === 'stopping') ? 'st-branch' : 'st-lane');
103
+ }
104
+ if (j.state === 'stopping') document.getElementById('execution-stop')?.remove();
105
+ const ask = document.getElementById('execution-ask'); ask.hidden = j.state !== 'paused'; document.getElementById('execution-question').textContent = j.question || '';
106
+ if (!alive && live) { live = false; document.getElementById('execution-stop')?.remove(); if (j.error && !own) { const e = document.createElement('span'); e.className = 'small bad'; e.textContent = j.error; state.after(e); } }
107
+ // Check once more at completion, but do not wait forever for a job that never started.
108
+ if (box.dataset.waiting === 'yes') { const h = await nulliusFetch(location.pathname, {method: 'HEAD', cache: 'no-store'}); if (h.ok) location.reload(); }
109
+ if (alive) setTimeout(tick, 1000);
110
+ } catch { if (retry) setTimeout(tick, 5000); }
111
+ };
112
+ tick();
113
+ // The answer names the state (`stopping`) at once; the run's own thread
114
+ // finishes the stop. A refused stop puts the button back and says why.
115
+ document.getElementById('execution-stop')?.addEventListener('click', async e => {
116
+ e.target.disabled = true;
117
+ try {
118
+ const r = await nulliusFetch(box.dataset.stop, {method: 'POST', headers: {'X-CSRF-Token': box.dataset.csrf}});
119
+ if (!r.ok) throw new Error('stop refused: HTTP ' + r.status);
120
+ const j = await r.json(); state.textContent = j.state; e.target.remove();
121
+ } catch (err) {
122
+ e.target.disabled = false;
123
+ const n = document.createElement('span'); n.className = 'small bad'; n.textContent = String(err.message || err); e.target.after(n);
124
+ }
125
+ });
126
+ document.getElementById('execution-continue')?.addEventListener('click', async e => {
127
+ e.target.disabled = true; try { await nulliusFetch(box.dataset.continue, {method: 'POST', headers: {'X-CSRF-Token': box.dataset.csrf}}); } catch {} e.target.disabled = false;
128
+ });
129
+ })();
130
+ </script>
131
+ {% endmacro %}
@@ -0,0 +1,5 @@
1
+ {#- What ran, for a runner's job: the benchmark itself at the commit its
2
+ install resolved. -#}
3
+ {% macro what_ran(job) -%}
4
+ {%- if job and job.runner %}<span class="mono" title="What ran: the runner, and the upstream commit its install resolved">{{ job.runner }}{% if job.runner_commit %} {{ job.runner_commit }}{% endif %}</span>{% endif -%}
5
+ {%- endmacro %}