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,609 @@
1
+ {% from 'runs/_runtime.html' import what_ran %}
2
+ {% extends "base.html" %}
3
+ {% block title %}Runs — Nullius{% endblock %}
4
+ {% block head %}<link rel="stylesheet" href="{{ url_for('static', filename='runs/launches.css') }}">{% endblock %}
5
+
6
+ {# Value filter for one column: a caret in the header opening a checkbox list.
7
+ Values start all-checked; unchecking hides the matching rows. #}
8
+ {% macro filter_button(col) %}
9
+ <span class="th-filter">
10
+ <button class="filter-btn" type="button" data-filter="{{ col }}"
11
+ aria-haspopup="true" aria-expanded="false" aria-label="Filter by {{ col }}">▼</button>
12
+ <div class="menu filter-menu" data-filter-menu="{{ col }}" hidden>
13
+ <div class="menu-head">
14
+ <button type="button" class="linkish" data-all="{{ col }}">All</button>
15
+ <button type="button" class="linkish" data-none="{{ col }}">None</button>
16
+ </div>
17
+ {% for value, label in choices[col] %}
18
+ <label><input type="checkbox" data-value="{{ value }}" checked> {{ label }}</label>
19
+ {% endfor %}
20
+ </div>
21
+ </span>
22
+ {% endmacro %}
23
+
24
+ {% block body %}
25
+
26
+ <div class="page-title runs-head"><h1>Runs</h1>
27
+ <span class="runs-acts">
28
+ <a class="btn sm ghost" href="{{ url_for('import_page') }}">Import</a>
29
+ <a class="btn sm" href="{{ url_for('new_run') }}">New run</a>
30
+ </span></div>
31
+ {# Agents only: a control's trials are a check on the tasks, not results, and
32
+ are shown as their launch's task checks. #}
33
+ <p class="subtitle" id="counts"
34
+ data-runs="{{ n_agent_runs }}" data-trials="{{ n_trials }}">
35
+ {{ n_agent_runs }} runs<span class="dot">·</span>{{ n_trials }} trials
36
+ </p>
37
+ <p class="runs-glance" id="glance">
38
+ {%- if workspace %}<span>in <b>{{ workspace.label }}</b></span>{% endif -%}
39
+ <span><b>{{ launches|length }}</b> launch{{ '' if launches|length == 1 else 'es' }}</span>
40
+ {%- for s, n in states|dictsort %}<span class="st-{{ s }}"><b>{{ n }}</b> {{ s }}</span>{% endfor -%}
41
+ <span title="Launches whose nop and oracle controls behaved on every task">task checks <b>{{ n_checked }}</b> of {{ launches|length }}</span>
42
+ </p>
43
+
44
+ <div class="bar">
45
+ {% for k in ORDER %}{% if totals[k] %}
46
+ <button class="seg oc-{{ k }}" style="flex:{{ totals[k] }}" data-outcome="{{ k }}"
47
+ title="{{ LABELS[k] }}: {{ totals[k] }} — click to filter"></button>
48
+ {% endif %}{% endfor %}
49
+ </div>
50
+ <div class="legend">
51
+ {% for k in ORDER %}{% if totals[k] %}
52
+ <button class="chip oc-{{ k }}" data-outcome="{{ k }}"
53
+ title="Show runs containing a {{ LABELS[k]|lower }} trial">{{ LABELS[k] }} <b>{{ totals[k] }}</b></button>
54
+ {% endif %}{% endfor %}
55
+ {% set n_regr = jobs|map(attribute='n_regressions')|sum %}
56
+ {% if n_regr %}
57
+ <button class="chip regression-chip" data-outcome="regression"
58
+ title="Runs containing a patch that broke previously-passing tests">⚠ Broke tests <b>{{ n_regr }}</b></button>
59
+ {% endif %}
60
+ <button class="chip clear" id="clear-filter" hidden>Clear filter ×</button>
61
+ </div>
62
+
63
+ <div class="runs-views" role="group" aria-label="View">
64
+ <a class="rv{{ ' on' if view == 'launch' }}" href="?view=launch" data-view="launch" aria-pressed="{{ 'true' if view == 'launch' else 'false' }}">By launch</a>
65
+ <a class="rv{{ ' on' if view == 'all' }}" href="?view=all" data-view="all" aria-pressed="{{ 'true' if view == 'all' else 'false' }}">All runs</a>
66
+ </div>
67
+
68
+ {#- By launch: runs started together ran the same tasks. Each launch is one block - its task checks (the nop and oracle
69
+ controls), then its agents on one 0-100% scale, then the runs its record named that Harbor has not written yet. -#}
70
+ <div id="view-launch" class="launches"{% if view != 'launch' %} hidden{% endif %}>
71
+ {% for g in launches %}{% set L = g.launch %}
72
+ <section class="launch" data-launch="{{ L.key }}" aria-label="Launch {{ L.title }}">
73
+ {% set by_runner = g.agents|map(attribute='job')|select|map(attribute='runner')|select|first %}
74
+ {% set words = g.agents|map(attribute='job')|select|map(attribute='runner_items')|select|first %}
75
+ <header class="launch-head">
76
+ <h2>{{ g.dataset_title if L.dataset else (L.name or g.dataset_title) }}{% if g.n_tasks %} · {{ g.n_tasks }} {% if words %}{{ words[0] if g.n_tasks == 1 else words[1] }}{% else %}task{{ '' if g.n_tasks == 1 else 's' }}{% endif %}{% endif %}</h2>
77
+ <span class="launch-id mono" title="{{ 'Launched together by one Run from the builder' if L.source == 'record' and not L.launch_ids else 'Shards of one launch, run on several machines' if L.launch_ids else 'Grouped: the same dataset, started within half an hour of the first' }}">{{ L.title }}</span>
78
+ <span class="launch-when">{% if L.started %}{{ L.started|dt }} · {% endif %}{{ L.job_ids|length + L.pending|length }} run{{ '' if (L.job_ids|length + L.pending|length) == 1 else 's' }}</span>
79
+ </header>
80
+ {# a runner's launch is checked by its own floor and ceiling, which are arms in its table #}
81
+ {% if not by_runner %}
82
+ {#- the controls themselves are rows at the top of the table; this line says what they add up to #}
83
+ <div class="launch-checks{{ ' none' if not g.controls }}">
84
+ <span class="lc-label">Task checks</span>
85
+ <span class="lc-verdict {{ 'ok' if g.checked else 'open' }}">{{ g.verdict or 'No nop or oracle ran with this launch: its tasks are not checked.' }}{% if g.feasibility %} <a href="{{ url_for('feasibility_page', job_id=g.feasibility) }}">Feasibility</a>{% endif %}</span>
86
+ </div>
87
+ {% endif %}
88
+ {% if g.agents or g.controls %}
89
+ <div class="launch-table">
90
+ <table class="launch-agents">
91
+ <thead><tr><th>Agent</th><th class="lh-state">State</th><th title="Solved ÷ trials that actually ran; the tick is the raw rate, solved ÷ all trials">Adjusted solve rate</th><th class="lh-mix">Outcomes</th><th class="num">Solved</th><th class="num lh-more">Tokens</th><th class="num lh-more">Cost</th><th class="num lh-more">Time</th><th></th></tr></thead>
92
+ <tbody>
93
+ {#- the task checks first: their verdict where an agent has its rate, never ranked, kept once they end #}
94
+ {% for r in g.controls if not by_runner %}{% set j = r.job %}{% set v = r.verdict %}
95
+ <tr class="la-control st-{{ r.state }}" data-control="{{ r.control }}" data-state="{{ v.state if v else 'pending' }}">
96
+ <td><div class="la-who"><span class="la-name"><a href="{{ url_for('job', job_id=r.job_id) }}">{{ r.control }}</a> <span class="la-kind">task check</span></span>
97
+ <small class="mono">{{ r.job_id }}</small></div></td>
98
+ <td class="lh-state"><span class="la-state {{ r.state|replace(' ', '-') }}"><i aria-hidden="true"></i>{{ r.state }}</span></td>
99
+ <td><div class="la-verdict control-verdict {{ v.state if v else 'pending' }}"><span class="lc-mark" aria-hidden="true">{{ '✓' if v and v.state == 'ok' else ('⚠' if v and v.state == 'warn' else '○') }}</span>
100
+ {%- if v %}<b>{{ v.label }}</b>{% else %}<span class="faint">{{ 'must reject every task' if r.control == 'nop' else 'must pass every task' }}</span>{% endif %}</div></td>
101
+ <td class="lh-mix">{% if j and j.trials %}<span class="la-mix" role="img" aria-label="{% for k in ORDER %}{% if j.counts[k] %}{{ LABELS[k] }} {{ j.counts[k] }}{{ ', ' if not loop.last }}{% endif %}{% endfor %}">{% for k in ORDER %}{% if j.counts[k] %}<span class="oc-{{ k }}" style="flex:{{ j.counts[k] }}"></span>{% endif %}{% endfor %}</span>{% else %}<span class="la-mix"></span>{% endif %}</td>
102
+ <td class="num"><span class="faint" title="A check on the tasks, not a score">—</span></td>
103
+ <td class="num lh-more">{% if j and (j.total_input_tokens or j.total_output_tokens) %}{{ (j.total_input_tokens + j.total_output_tokens)|tokens(j.kind) }}{% else %}<span class="faint">—</span>{% endif %}</td>
104
+ <td class="num lh-more">{% if j and j.total_cost_usd is not none %}{{ j.total_cost_usd|usd(j.kind) }}{% else %}<span class="faint">—</span>{% endif %}</td>
105
+ <td class="num lh-more">{% if j and j.duration_min %}{{ j.duration_min|runtime }}{% else %}<span class="faint">—</span>{% endif %}</td>
106
+ <td class="la-go"><a href="{{ url_for('job', job_id=r.job_id) }}">Open →</a></td>
107
+ </tr>
108
+ {% endfor %}
109
+ {% for r in g.agents %}{% set j = r.job %}
110
+ <tr class="st-{{ r.state }}" data-outcomes="{% if j %}{% for k in ORDER %}{% if j.counts[k] %}{{ k }} {% endif %}{% endfor %}{% if j.n_regressions %}regression{% endif %}{% endif %}">
111
+ <td><div class="la-who"><span class="la-name"><a href="{{ url_for('job', job_id=r.job_id) }}">{{ j.agent_label if j and j.agent_label else r.job_id[L.prefix|length - 1:] if L.prefix.endswith('*') and r.job_id.startswith(L.prefix[:-1]) else r.job_id }}</a>
112
+ {%- if j and j.runner %} {{ what_ran(j) }}{% elif j and j.agent_version %} <span class="la-ver mono">{{ j.agent_version }}</span>{% endif %}</span>
113
+ <small class="mono">{{ r.job_id }}</small></div></td>
114
+ <td class="lh-state"><span class="la-state {{ r.state|replace(' ', '-') }}"{% if r.state == 'not in this workspace' %} title="Its run ended, and Harbor's job for it is not under this workspace's roots"{% elif r.state == 'refused' %} title="Refused before it started: {{ r.why }}"{% endif %}><i aria-hidden="true"></i>{{ r.state }}</span></td>
115
+ <td>{% if j and j.scored_only %}
116
+ <div class="la-rate la-score" title="This benchmark gives a score and no pass or fail: the mean score{% if j.n_scored_parts %} over its {{ j.n_scored_parts }} scored{% endif %}, no solve rate"><b>{{ '%.2f'|format(j.mean_score) }}</b><span class="la-scale"><i style="width:{{ '%.1f'|format(100 * j.mean_score) }}%"></i></span></div>
117
+ {%- elif j and j.adjusted_solve_rate is not none %}
118
+ <div class="la-rate"><b>{{ j.adjusted_solve_rate|pct }}</b><span class="la-scale" title="Adjusted {{ j.adjusted_solve_rate|pct }} (the bar), raw {{ j.raw_solve_rate|pct }} (the tick)"><i style="width:{{ '%.1f'|format(100 * j.adjusted_solve_rate) }}%"></i><s style="left:{{ '%.1f'|format(100 * j.raw_solve_rate) }}%"></s></span></div>
119
+ {%- else %}<div class="la-rate na"><b>—</b><span class="la-scale"></span></div>{% endif %}
120
+ {%- if j and j.trials and not j.scored_only and j.counts.unknown and j.counts.unknown * 4 >= j.trials|length %}<span class="la-flag" title="Trials the classifier could not give an outcome: no verifier record, no exception">⚠ {{ j.counts.unknown }} of {{ j.trials|length }} have no verdict</span>{% endif %}</td>
121
+ <td class="lh-mix">{% if j and j.trials %}<span class="la-mix" role="img" aria-label="{% for k in ORDER %}{% if j.counts[k] %}{{ LABELS[k] }} {{ j.counts[k] }}{{ ', ' if not loop.last }}{% endif %}{% endfor %}">{% for k in ORDER %}{% if j.counts[k] %}<span class="oc-{{ k }}" style="flex:{{ j.counts[k] }}"></span>{% endif %}{% endfor %}</span>{% else %}<span class="la-mix"></span>{% endif %}</td>
122
+ <td class="num">{% if j and j.scored_only %}<span class="faint" title="Scored, not solved: no pass or fail in this benchmark">—</span>{% elif j %}{{ j.n_resolved }}<span class="faint">/{{ j.n_planned or j.trials|length }}</span>{% else %}<span class="faint">0{% if g.n_tasks %}/{{ g.n_tasks }}{% endif %}</span>{% endif %}</td>
123
+ <td class="num lh-more">{% if j and (j.total_input_tokens or j.total_output_tokens) %}{{ (j.total_input_tokens + j.total_output_tokens)|tokens(j.kind) }}{% else %}<span class="faint">—</span>{% endif %}</td>
124
+ <td class="num lh-more">{% if j and j.total_cost_usd is not none %}{{ j.total_cost_usd|usd(j.kind) }}{% else %}<span class="faint">—</span>{% endif %}</td>
125
+ <td class="num lh-more">{% if j and j.duration_min %}{{ j.duration_min|runtime }}{% else %}<span class="faint">—</span>{% endif %}</td>
126
+ <td class="la-go">{% if r.state != 'not in this workspace' %}<a href="{{ url_for('job', job_id=r.job_id) }}">{{ 'Open to resume' if r.state == 'paused' else 'Open →' }}</a>{% endif %}</td>
127
+ </tr>
128
+ {% endfor %}
129
+ </tbody>
130
+ </table>
131
+ </div>
132
+ {% endif %}
133
+ <footer class="launch-foot">
134
+ <span>{{ g.summary or 'controls only' }}</span>
135
+ {% if g.paused %}<span class="launch-paused">Paused after a failure: <a href="{{ url_for('job', job_id=g.paused) }}">continue or stop</a></span>{% endif %}
136
+ <span class="header-spacer"></span>
137
+ {% if g.recipe %}<a href="{{ url_for('new_run', run=g.recipe) }}">Open this launch's recipe</a>{% endif %}
138
+ {% if g.compare|length >= 2 %}<a class="btn sm" href="{{ url_for('compare', job=g.compare) }}">Compare these {{ g.compare|length }}</a>
139
+ {% elif g.agents %}<span class="faint" title="Two finished agents with a verdict are needed">Compare needs two finished agents</span>{% endif %}
140
+ </footer>
141
+ </section>
142
+ {% endfor %}
143
+ </div>
144
+
145
+ <div id="view-all"{% if view != 'all' %} hidden{% endif %}>
146
+ <div class="table-tools">
147
+ <div class="menu-wrap">
148
+ <button class="btn ghost sm" id="col-btn" aria-haspopup="true" aria-expanded="false">▦ Columns</button>
149
+ </div>
150
+ <div class="menu-wrap">
151
+ <button class="btn ghost sm" id="density-btn" aria-pressed="false" title="Fit more columns on screen">⇔ Compact</button>
152
+ <div class="menu" id="col-menu" hidden>
153
+ {% for col, label in COLUMNS %}
154
+ <label><input type="checkbox" data-col="{{ col }}"> {{ label }}</label>
155
+ {% endfor %}
156
+ </div>
157
+ </div>
158
+ <span class="table-note" id="filter-note"></span>
159
+ <span class="header-spacer"></span>
160
+ <form action="{{ url_for('compare') }}" method="get" id="compare-form" class="compare-bar">
161
+ <span class="table-note" id="pick-note">Tick two or more runs to compare</span>
162
+ <button class="btn sm" type="submit" id="compare-btn" disabled>Compare</button>
163
+ </form>
164
+ </div>
165
+
166
+ <div class="table-wrap">
167
+ <table class="grid sortable" id="runs">
168
+ <thead>
169
+ <tr>
170
+ <th class="pick-col">
171
+ <input type="checkbox" id="pick-all" aria-label="Select all runs for comparison"
172
+ title="Select / unselect all">
173
+ </th>
174
+ <th data-col="run" data-type="text">Run</th>
175
+ <th data-col="agent" data-type="text">Agent{{ filter_button('agent') }}</th>
176
+ <th data-col="version" data-type="text" title="The agent's version as the run recorded it, or the runner and its commit">Version</th>
177
+ <th data-col="start" data-type="num">Start</th>
178
+ <th data-col="end" data-type="num">End</th>
179
+ <th data-col="time" data-type="num" class="num">Time</th>
180
+ <th data-col="model" data-type="text">
181
+ Model{{ filter_button('model') }}
182
+ </th>
183
+ <th data-col="dataset" data-type="text">
184
+ Dataset{{ filter_button('dataset') }}
185
+ </th>
186
+ <th data-col="mix" data-type="num">Mix</th>
187
+ <th data-col="trials" data-type="num" class="num">Trials</th>
188
+ <th data-col="solved" data-type="num" class="num">Solved</th>
189
+ <th data-col="raw" data-type="num" class="num" title="Solved ÷ all trials">Raw</th>
190
+ <th data-col="adjusted" data-type="num" class="num"
191
+ title="Solved ÷ trials that actually ran (excludes infra failures)">Adjusted</th>
192
+ <th data-col="infra" data-type="num" class="num"
193
+ title="Trials that never got a fair attempt — rate limits and setup failures. Excluded from Adjusted.">Infra errors</th>
194
+ <th data-col="broke" data-type="num" class="num"
195
+ title="Trials whose patch broke previously-passing tests">Broke tests</th>
196
+ <th data-col="tokens" data-type="num" class="num"
197
+ title="Input + output tokens across the run">Tokens</th>
198
+ <th data-col="cost" data-type="num" class="num"
199
+ title="Only recorded by agents that report it">Cost</th>
200
+ </tr>
201
+ </thead>
202
+ <tbody>
203
+ {% for j in jobs %}
204
+ {# A control row carries no outcomes to filter by: the chips count the
205
+ agents' trials, and a nop's rejections are not failed verifications. #}
206
+ {% set v = verdicts[j.job_id] %}
207
+ <tr data-outcomes="{% if not v %}{% for k in ORDER %}{% if j.counts[k] %}{{ k }} {% endif %}{% endfor %}{% if j.n_regressions %}regression{% endif %}{% endif %}"
208
+ data-f-dataset="{{ j.dataset }}" data-f-model="{{ j.model_name }}"
209
+ data-f-agent="{{ j.agent_label }}"{% if v %} class="control-row" data-control="{{ v.control }}" data-state="{{ v.state }}"{% endif %}>
210
+ <td class="pick-col"><input type="checkbox" class="pick-run" value="{{ j.job_id }}"
211
+ aria-label="Compare {{ j.job_id }}"></td>
212
+ <td data-col="run"><a href="{{ url_for('job', job_id=j.job_id) }}">{{ j.job_id }}</a>
213
+ {%- if j.is_preparing %} <span class="badge"
214
+ title="Launched: Harbor has written this run's configuration and nothing else yet. No trial has started; the row will change on its own.">preparing</span>
215
+ {%- elif j.is_running and ended[j.job_id] %} <span class="badge"
216
+ title="The run that wrote this job was {{ ended[j.job_id][0] }} at {{ ended[j.job_id][1].strftime('%H:%M:%S') }}Z; Harbor never closed it, so its record still names {{ j.n_running_trials }} running · {{ j.n_pending_trials }} pending — those trials will not run">{{ ended[j.job_id][0] }}</span>
217
+ {%- elif j.is_running %} <span class="badge warn"
218
+ title="{{ j.n_running_trials }} running · {{ j.n_pending_trials }} pending — this run is not finished; its numbers are partial">running</span>{% endif %}</td>
219
+ <td data-col="agent"><span>{{ j.agent_label or '—' }}</span>
220
+ {%- if j.is_control %} <span class="chip-control"
221
+ title="Harbor control: applies the gold patch or does nothing. Never calls a model.">control</span>{% endif %}</td>
222
+ <td data-col="version">{% if j.runner %}{{ what_ran(j) }}{% elif j.agent_version %}<span class="mono small">{{ j.agent_version }}</span>{% else %}<span class="faint">—</span>{% endif %}</td>
223
+ <td data-col="start" data-sort="{{ j.started_at|ts }}" class="faint nowrap">{{ j.started_at|dt }}</td>
224
+ <td data-col="end" data-sort="{{ j.finished_at|ts }}" class="faint nowrap">{{ j.finished_at|dt }}</td>
225
+ <td data-col="time" data-sort="{{ j.duration_min or -1 }}" class="num faint">
226
+ {%- if j.duration_min %}{{ j.duration_min|runtime }}{% else %}—{% endif -%}
227
+ </td>
228
+ <td data-col="model" class="mono faint">{{ j.model_name }}</td>
229
+ <td data-col="dataset" data-sort="{{ j.dataset|dsname }}" title="{{ j.dataset }}">{{ j.dataset|dsname }}</td>
230
+ {# A control's mix is its verdict in the control colour — behaved
231
+ against not — and sorts below every agent row (-1) so the column
232
+ orders agents by what they solved and leaves the controls apart. #}
233
+ {% if v %}
234
+ <td data-col="mix" data-sort="-1">
235
+ <span class="minibar control-bar" title="{{ v.control }}: {{ v.label }}">
236
+ {%- if v.n_behaved %}<span class="seg ctl-ok" style="flex:{{ v.n_behaved }}"></span>{% endif -%}
237
+ {%- if v.n - v.n_behaved %}<span class="seg ctl-warn" style="flex:{{ v.n - v.n_behaved }}"></span>{% endif -%}
238
+ </span>
239
+ </td>
240
+ {% else %}
241
+ <td data-col="mix" data-sort="{{ j.n_resolved }}">
242
+ <span class="minibar" title="{% for k in ORDER %}{% if j.counts[k] %}{{ LABELS[k] }}: {{ j.counts[k] }}&#10;{% endif %}{% endfor %}">
243
+ {%- for k in ORDER %}{% if j.counts[k] %}<span class="seg oc-{{ k }}" style="flex:{{ j.counts[k] }}"></span>{% endif %}{% endfor -%}
244
+ </span>
245
+ </td>
246
+ {% endif %}
247
+ {# present/planned exposes a partial run; the tooltip carries Harbor's
248
+ retry and error counters, which have nowhere else to live. #}
249
+ <td data-col="trials" data-sort="{{ j.trials|length }}" class="num"
250
+ title="{{ j.trials|length }} on disk{% if j.n_planned %} of {{ j.n_planned }} planned{% endif %}{% if j.n_retries %} · {{ j.n_retries }} retried{% endif %}{% if j.n_errored_trials %} · {{ j.n_errored_trials }} errored{% endif %}">
251
+ {{- j.trials|length }}{% if j.n_planned and j.n_planned != j.trials|length %}<small class="faint">/{{ j.n_planned }}</small>{% endif -%}
252
+ </td>
253
+ {% if v %}
254
+ {# A control has a verdict, not a score: Solved says whether it behaved
255
+ and the two rates show absence with the verdict in their tooltip.
256
+ All three sort at -2 — below the agents and below a run nothing
257
+ scored (-1) — so the columns keep the controls apart. #}
258
+ {% set ctl_title = v.control ~ " is a Harbor control: it must be " ~ v.expected ~ " on every task — " ~ v.label ~ ". Not a score." %}
259
+ <td data-col="solved" data-sort="-2" class="control-verdict {{ v.state }}" title="{{ ctl_title }}">{{ v.label }}</td>
260
+ <td data-col="raw" data-sort="-2" class="num faint" title="{{ ctl_title }}">—</td>
261
+ <td data-col="adjusted" data-sort="-2" class="num faint" title="{{ ctl_title }}">—</td>
262
+ {% elif j.scored_only %}
263
+ {# A benchmark that gives a score and no pass or fail: the mean score where the rate would be, and nothing solved #}
264
+ {% set score_title = "This benchmark gives a score and no pass or fail: the mean score" ~ (" over its " ~ j.n_scored_parts ~ " scored" if j.n_scored_parts else "") ~ ", no solve rate" %}
265
+ <td data-col="solved" data-sort="-1" class="num faint" title="{{ score_title }}">—</td>
266
+ <td data-col="raw" data-sort="-1" class="num faint" title="{{ score_title }}">—</td>
267
+ <td data-col="adjusted" data-sort="{{ j.mean_score }}" class="num strong" title="{{ score_title }}">{{ '%.2f'|format(j.mean_score) }}</td>
268
+ {% else %}
269
+ <td data-col="solved" data-sort="{{ j.n_resolved }}" class="num">{{ j.n_resolved }}</td>
270
+ {# A run nothing scored (a standalone trajectory, a span export) has no
271
+ rate, not a rate of zero: it shows absence and sorts below a measured 0%. #}
272
+ <td data-col="raw" data-sort="{{ -1 if j.raw_solve_rate is none else j.raw_solve_rate }}" class="num faint"
273
+ {%- if j.raw_solve_rate is none %} title="No trial in this run carries a verdict"{% endif %}>{{ j.raw_solve_rate|pct }}</td>
274
+ <td data-col="adjusted" data-sort="{{ -1 if j.adjusted_solve_rate is none else j.adjusted_solve_rate }}" class="num {{ 'faint' if j.adjusted_solve_rate is none else 'strong' }}"
275
+ {%- if j.adjusted_solve_rate is none %} title="No trial in this run carries a verdict"{% endif %}>{{ j.adjusted_solve_rate|pct }}</td>
276
+ {% endif %}
277
+ {# Zero infra errors is a measured fact, and a good one — every trial has
278
+ an outcome, so the count is always knowable. #}
279
+ <td data-col="infra" data-sort="{{ j.n_infra }}" class="num {% if j.n_infra %}warn{% else %}faint{% endif %}">{{ j.n_infra }}</td>
280
+ {# Zero regressions is only a fact for a benchmark that checks for them.
281
+ Where none were reported the column shows absence, not a reassuring 0. #}
282
+ <td data-col="broke" data-sort="{{ j.n_regressions }}" class="num">
283
+ {%- if j.n_regressions %}<span class="badge danger" title="Broke previously-passing tests">⚠ {{ j.n_regressions }}</span>
284
+ {%- elif j.reports_regressions %}<span class="faint">0</span>
285
+ {%- else %}<span class="faint" title="This benchmark does not report previously-passing tests">—</span>{% endif -%}
286
+ </td>
287
+ <td data-col="tokens" data-sort="{{ j.total_input_tokens + j.total_output_tokens }}"
288
+ class="num faint"
289
+ title="in {{ j.total_input_tokens }} · cached {{ j.total_cache_tokens }} · out {{ j.total_output_tokens }}">
290
+ {{ (j.total_input_tokens + j.total_output_tokens)|tokens(j.kind) }}</td>
291
+ {# A control's real $0.00 sorts as zero; an unmeasured agent sorts last. #}
292
+ <td data-col="cost" data-sort="{{ j.total_cost_usd if j.total_cost_usd is not none else (0 if j.is_control else -1) }}"
293
+ class="num {{ '' if (j.total_cost_usd or j.is_control) else 'faint' }}">{{ j.total_cost_usd|usd(j.kind) }}</td>
294
+ </tr>
295
+ {% endfor %}
296
+ </tbody>
297
+ </table>
298
+ </div>
299
+ <p class="empty-note" id="empty-note" hidden>No runs contain that outcome.</p>
300
+ </div>
301
+
302
+ {% if datasets %}
303
+ <h2>Datasets in these runs</h2>
304
+ <div class="datasets">
305
+ {% for d in datasets %}
306
+ <section class="dataset">
307
+ <div class="dataset-head">
308
+ <h3 class="dataset-name">{{ d.info.title }}</h3>
309
+ <span class="mono faint">{{ d.name }}</span>
310
+ <span class="header-spacer"></span>
311
+ <span class="dataset-count">{{ d.runs }} run{{ '' if d.runs == 1 else 's' }}<span class="dot">·</span>{{ d.trials }} trial{{ '' if d.trials == 1 else 's' }}</span>
312
+ </div>
313
+ <p>{{ d.info.what }}</p>
314
+ {% if d.info.scored %}<p><span class="lede">How it's scored</span> {{ d.info.scored }}</p>{% endif %}
315
+ {% if d.info.note %}<p class="muted">{{ d.info.note }}</p>{% endif %}
316
+ </section>
317
+ {% endfor %}
318
+ </div>
319
+ {% endif %}
320
+
321
+ <script>
322
+ (() => {
323
+ const table = document.getElementById('runs');
324
+ let rows = [...table.tBodies[0].rows];
325
+ // what the server last sent for each piece, set aside before the filters and columns below change the page
326
+ const sent = new Map([...document.querySelectorAll('.launch')].map(l => [l.dataset.launch, l.outerHTML]));
327
+ sent.set('tbody', table.tBodies[0].innerHTML);
328
+ const counts = document.getElementById('counts');
329
+ const note = document.getElementById('filter-note');
330
+ const emptyNote = document.getElementById('empty-note');
331
+ const clearBtn = document.getElementById('clear-filter');
332
+ const HIDDEN_BY_DEFAULT = ['end', 'model', 'dataset', 'raw'];
333
+
334
+ const colBtn = document.getElementById('col-btn');
335
+ const colMenu = document.getElementById('col-menu');
336
+ const stored = JSON.parse(localStorage.getItem('runs.cols') || 'null');
337
+
338
+ function setCol(col, on) {
339
+ table.querySelectorAll(`[data-col="${col}"]`).forEach(el => el.style.display = on ? '' : 'none');
340
+ }
341
+ const showCols = () => colMenu.querySelectorAll('input[data-col]').forEach(cb => setCol(cb.dataset.col, cb.checked));
342
+ colMenu.querySelectorAll('input[data-col]').forEach(cb => {
343
+ const col = cb.dataset.col;
344
+ cb.checked = stored ? stored.includes(col) : !HIDDEN_BY_DEFAULT.includes(col);
345
+ setCol(col, cb.checked);
346
+ cb.addEventListener('change', () => {
347
+ setCol(col, cb.checked);
348
+ localStorage.setItem('runs.cols', JSON.stringify(
349
+ [...colMenu.querySelectorAll('input:checked')].map(i => i.dataset.col)));
350
+ });
351
+ });
352
+ const densityBtn = document.getElementById('density-btn');
353
+ const setDensity = on => {
354
+ table.classList.toggle('compact', on);
355
+ densityBtn.setAttribute('aria-pressed', String(on));
356
+ densityBtn.textContent = on ? '⇔ Comfortable' : '⇔ Compact';
357
+ };
358
+ setDensity(localStorage.getItem('runs.compact') === '1');
359
+ densityBtn.addEventListener('click', () => {
360
+ const on = !table.classList.contains('compact');
361
+ setDensity(on);
362
+ localStorage.setItem('runs.compact', on ? '1' : '0');
363
+ });
364
+
365
+ colBtn.addEventListener('click', () => {
366
+ const open = colMenu.hidden;
367
+ colMenu.hidden = !open;
368
+ colBtn.setAttribute('aria-expanded', String(open));
369
+ });
370
+ document.addEventListener('click', e => {
371
+ if (!colMenu.hidden && !colMenu.contains(e.target) && e.target !== colBtn) {
372
+ colMenu.hidden = true;
373
+ colBtn.setAttribute('aria-expanded', 'false');
374
+ }
375
+ });
376
+
377
+ let sortCol = null, sortDir = 1;
378
+ const sortRows = () => {
379
+ if (sortCol === null) return;
380
+ const type = table.tHead.rows[0].cells[sortCol].dataset.type || 'text';
381
+ rows.sort((a, b) => {
382
+ const x = key(a, sortCol, type), y = key(b, sortCol, type);
383
+ return (x < y ? -1 : x > y ? 1 : 0) * sortDir;
384
+ }).forEach(r => table.tBodies[0].appendChild(r));
385
+ };
386
+ const key = (row, idx, type) => {
387
+ const cell = row.cells[idx];
388
+ const raw = cell.dataset.sort ?? cell.textContent.trim();
389
+ return type === 'num' ? parseFloat(raw) || 0 : raw.toLowerCase();
390
+ };
391
+ [...table.tHead.rows[0].cells].forEach((th, idx) => {
392
+ th.tabIndex = 0;
393
+ const sort = () => {
394
+ const type = th.dataset.type || 'text';
395
+ sortDir = sortCol === idx ? -sortDir : (type === 'num' ? -1 : 1);
396
+ sortCol = idx;
397
+ [...table.tHead.rows[0].cells].forEach(c => c.removeAttribute('data-sorted'));
398
+ th.dataset.sorted = sortDir > 0 ? 'asc' : 'desc';
399
+ sortRows();
400
+ };
401
+ th.addEventListener('click', sort);
402
+ th.addEventListener('keydown', e => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); sort(); } });
403
+ });
404
+
405
+ /* ---- filters: outcome (from the bar/chips) + per-column value menus ----
406
+ A run matches an outcome if ANY of its trials had it. Column filters are
407
+ sets of allowed values; all must pass. */
408
+ let active = null;
409
+ const colFilters = {}; // col -> Set of allowed values, or absent for "all"
410
+
411
+ function applyFilter() {
412
+ let shown = 0;
413
+ rows.forEach(r => {
414
+ let hit = !active || r.dataset.outcomes.split(' ').includes(active);
415
+ if (hit) {
416
+ for (const [col, allowed] of Object.entries(colFilters)) {
417
+ if (allowed && !allowed.has(r.getAttribute('data-f-' + col))) { hit = false; break; }
418
+ }
419
+ }
420
+ r.hidden = !hit;
421
+ if (hit) shown++;
422
+ });
423
+ document.querySelectorAll('[data-outcome]').forEach(el =>
424
+ el.classList.toggle('active', el.dataset.outcome === active));
425
+ // the launch view's rows: dimmed rather than hidden, so a launch keeps its shape
426
+ document.querySelectorAll('.launch-agents tbody tr').forEach(r =>
427
+ r.classList.toggle('dim', !!active && !(r.dataset.outcomes || '').split(' ').includes(active)));
428
+ const filtered = active || Object.values(colFilters).some(Boolean);
429
+ clearBtn.hidden = !filtered;
430
+ emptyNote.hidden = shown > 0;
431
+ note.textContent = filtered ? `${shown} of ${rows.length} runs` : '';
432
+ counts.textContent = filtered
433
+ ? `${shown} of ${counts.dataset.runs} runs shown`
434
+ : `${counts.dataset.runs} runs · ${counts.dataset.trials} trials`;
435
+ syncPicks(); // the header checkbox tracks visible rows only
436
+ }
437
+ // on the document: the bar and the chips are replaced as the runs move
438
+ document.addEventListener('click', e => {
439
+ const el = e.target.closest('[data-outcome]');
440
+ if (!el) return;
441
+ active = active === el.dataset.outcome ? null : el.dataset.outcome;
442
+ applyFilter();
443
+ });
444
+
445
+ document.querySelectorAll('.filter-menu').forEach(menu => {
446
+ const col = menu.dataset.filterMenu;
447
+ const boxes = () => [...menu.querySelectorAll('input[data-value]')];
448
+ const btn = document.querySelector(`.filter-btn[data-filter="${col}"]`);
449
+
450
+ const sync = () => {
451
+ const on = boxes().filter(b => b.checked).map(b => b.dataset.value);
452
+ // All checked means "no filter" — keeps the active marker honest.
453
+ colFilters[col] = on.length === boxes().length ? null : new Set(on);
454
+ btn.classList.toggle('on', Boolean(colFilters[col]));
455
+ applyFilter();
456
+ };
457
+ menu.addEventListener('change', sync);
458
+ menu.addEventListener('click', e => {
459
+ if (e.target.closest('[data-all]')) { boxes().forEach(b => b.checked = true); sync(); }
460
+ if (e.target.closest('[data-none]')) { boxes().forEach(b => b.checked = false); sync(); }
461
+ });
462
+
463
+ btn.addEventListener('click', e => {
464
+ e.stopPropagation(); // the th itself sorts; don't sort on filter
465
+ const open = menu.hidden;
466
+ document.querySelectorAll('.filter-menu').forEach(m => m.hidden = true);
467
+ menu.hidden = !open;
468
+ btn.setAttribute('aria-expanded', String(open));
469
+ });
470
+ menu.addEventListener('click', e => e.stopPropagation());
471
+ document.addEventListener('click', () => {
472
+ menu.hidden = true;
473
+ btn.setAttribute('aria-expanded', 'false');
474
+ });
475
+ });
476
+
477
+ /* ---- the two views, switched in place and kept in the address ---- */
478
+ document.querySelectorAll('.runs-views [data-view]').forEach(a => a.addEventListener('click', e => {
479
+ e.preventDefault();
480
+ const v = a.dataset.view;
481
+ document.querySelectorAll('.runs-views [data-view]').forEach(x => { const on = x === a; x.classList.toggle('on', on); x.setAttribute('aria-pressed', String(on)); });
482
+ document.getElementById('view-launch').hidden = v !== 'launch';
483
+ document.getElementById('view-all').hidden = v !== 'all';
484
+ const u = new URL(location.href); u.searchParams.set('view', v); history.replaceState(null, '', u);
485
+ }));
486
+
487
+ const form = document.getElementById('compare-form');
488
+ const compareBtn = document.getElementById('compare-btn');
489
+ const pickNote = document.getElementById('pick-note');
490
+ let picks = [...document.querySelectorAll('.pick-run')];
491
+
492
+ const pickAll = document.getElementById('pick-all');
493
+ const selectable = () => picks.filter(p => !p.closest('tr').hidden);
494
+
495
+ function syncPicks() {
496
+ const on = picks.filter(p => p.checked);
497
+ compareBtn.disabled = on.length < 2;
498
+ pickNote.textContent = on.length
499
+ ? `${on.length} selected`
500
+ : 'Tick two or more runs to compare';
501
+ // Header box reflects the visible rows: all, none, or partial.
502
+ const vis = selectable();
503
+ const hit = vis.filter(p => p.checked).length;
504
+ pickAll.checked = vis.length > 0 && hit === vis.length;
505
+ pickAll.indeterminate = hit > 0 && hit < vis.length;
506
+ // Rebuild the querystring: ?job=…&job=… in the order they were ticked.
507
+ form.querySelectorAll('input[name="job"]').forEach(i => i.remove());
508
+ on.forEach(p => {
509
+ const hidden = document.createElement('input');
510
+ hidden.type = 'hidden';
511
+ hidden.name = 'job';
512
+ hidden.value = p.value;
513
+ form.appendChild(hidden);
514
+ });
515
+ }
516
+ table.addEventListener('change', e => { if (e.target.matches('.pick-run')) syncPicks(); });
517
+
518
+ // Select/unselect all — scoped to rows the current filter leaves visible.
519
+ pickAll.addEventListener('change', () => {
520
+ selectable().forEach(p => p.checked = pickAll.checked);
521
+ syncPicks();
522
+ });
523
+
524
+ clearBtn.addEventListener('click', () => {
525
+ active = null;
526
+ document.querySelectorAll('.filter-menu').forEach(menu => {
527
+ menu.querySelectorAll('input[data-value]').forEach(b => b.checked = true);
528
+ colFilters[menu.dataset.filterMenu] = null;
529
+ });
530
+ document.querySelectorAll('.filter-btn').forEach(b => b.classList.remove('on'));
531
+ applyFilter();
532
+ });
533
+
534
+ /* ---- the list keeps up by itself ----
535
+ A run launched elsewhere shows up here on its own: every few seconds the page
536
+ asks what the job roots look like now and, when that changes (a new directory,
537
+ a feed growing, a result landing), reads itself again and puts in only what
538
+ moved. No reload: the scroll, the view, the filters, the sort and the ticks
539
+ stay. A hidden tab does not ask, and a selection is left to be copied. */
540
+ function refreshLaunches(fresh) {
541
+ const wrap = document.getElementById('view-launch');
542
+ const coming = [...fresh.querySelectorAll('#view-launch > .launch')], keys = new Set(coming.map(l => l.dataset.launch));
543
+ wrap.querySelectorAll(':scope > .launch').forEach(l => { if (!keys.has(l.dataset.launch)) l.remove(); });
544
+ let before = null;
545
+ coming.forEach(l => {
546
+ const name = l.dataset.launch, html = l.outerHTML;
547
+ let el = wrap.querySelector(`:scope > .launch[data-launch="${CSS.escape(name)}"]`);
548
+ if (el && sent.get(name) !== html) { el.replaceWith(l); el = l; }
549
+ el = el || l;
550
+ sent.set(name, html);
551
+ const next = before ? before.nextElementSibling : wrap.firstElementChild;
552
+ if (next !== el) wrap.insertBefore(el, next);
553
+ before = el;
554
+ });
555
+ }
556
+ function refreshRows(fresh) {
557
+ document.querySelectorAll('.filter-menu').forEach(menu => {
558
+ const col = menu.dataset.filterMenu;
559
+ const next = fresh.querySelector(`[data-filter-menu="${col}"]`);
560
+ if (!next) return;
561
+ menu.innerHTML = next.innerHTML;
562
+ menu.querySelectorAll('input[data-value]').forEach(b => {
563
+ b.checked = !colFilters[col] || colFilters[col].has(b.dataset.value);
564
+ });
565
+ });
566
+ const html = fresh.querySelector('#runs tbody').innerHTML;
567
+ if (sent.get('tbody') === html) return;
568
+ sent.set('tbody', html);
569
+ const ticked = picks.filter(p => p.checked).map(p => p.value);
570
+ table.tBodies[0].innerHTML = html;
571
+ rows = [...table.tBodies[0].rows];
572
+ picks = [...document.querySelectorAll('.pick-run')];
573
+ picks.forEach(p => { p.checked = ticked.includes(p.value); });
574
+ showCols();
575
+ sortRows();
576
+ }
577
+ function refreshHead(fresh) {
578
+ document.getElementById('glance').replaceWith(fresh.getElementById('glance'));
579
+ document.querySelector('.bar').replaceWith(fresh.querySelector('.bar'));
580
+ const legend = document.querySelector('.legend');
581
+ legend.querySelectorAll('.chip:not(.clear)').forEach(c => c.remove());
582
+ clearBtn.before(...fresh.querySelectorAll('.legend .chip:not(.clear)'));
583
+ const now = fresh.getElementById('counts');
584
+ counts.dataset.runs = now.dataset.runs;
585
+ counts.dataset.trials = now.dataset.trials;
586
+ }
587
+ let seen = {{ pulse | tojson }}, asking = false;
588
+ setInterval(async () => {
589
+ if (asking || document.hidden || !getSelection().isCollapsed) return;
590
+ asking = true;
591
+ try {
592
+ const pulse = await nulliusFetch({{ url_for('runs_pulse') | tojson }}, {cache: 'no-store'});
593
+ const {signature} = pulse.ok ? await pulse.json() : {signature: seen};
594
+ if (signature !== seen) {
595
+ const page = await nulliusFetch(location.href, {cache: 'no-store'});
596
+ const fresh = new DOMParser().parseFromString(await page.text(), 'text/html');
597
+ if (!page.ok || !fresh.getElementById('view-launch')) return location.reload(); // no longer the list: the workspace emptied
598
+ refreshLaunches(fresh);
599
+ refreshRows(fresh);
600
+ refreshHead(fresh);
601
+ applyFilter();
602
+ seen = signature;
603
+ }
604
+ } catch {}
605
+ asking = false;
606
+ }, 3000);
607
+ })();
608
+ </script>
609
+ {% endblock %}