Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
7d09e70
refactor(web): share the table toolkit's word matching
harenome Nov 17, 2026
63a8799
test(compare): pin every row and section the Compare page shows
harenome Nov 17, 2026
57890d3
feat(compare): compare runs in columns, each a workspace and a run
harenome Nov 17, 2026
b10ee4c
docs(compare): describe the columns, the baseline and its difference
harenome Nov 17, 2026
b91a1fa
fix(web): keep the run list Compare opens under the first-visit guide
harenome Nov 17, 2026
9ee5bcf
fix(compare): open with two columns, an empty one beside a single run
harenome Nov 18, 2026
ba85709
feat(compare): label a column's workspace and run as rows of the table
harenome Nov 18, 2026
97b3220
fix(compare): link every shard of a sharded run under its column
harenome Nov 18, 2026
f1e0620
feat(compare): name each run's benchmark in a row above its dataset
harenome Nov 18, 2026
98f5a6a
fix(compare): open a column's run list only on its button
harenome Nov 18, 2026
1c6c48a
feat(web): pin a table's rows as it scrolls down, as its columns as i…
harenome Nov 18, 2026
5371d11
refactor(compare): head the side table with the toolkit's controls row
harenome Nov 18, 2026
30ca036
feat(compare): keep the side table's controls and the runs' identity …
harenome Nov 18, 2026
6f472c1
fix(web): give every control in a table's controls row one height
harenome Nov 18, 2026
61b2884
refactor(compare): drop the cohort explanation, keep the no-shared-co…
harenome Nov 18, 2026
48c29b1
feat(compare): grey the runs other columns already show in a column's…
harenome Nov 18, 2026
972ca98
feat(compare): show the side-by-side table or the task table, one at …
harenome Nov 18, 2026
1154b3d
feat(compare): give the task table the columns' controls
harenome Nov 18, 2026
792871e
feat(web): float a table's sticky rows under its controls instead of …
harenome Nov 18, 2026
08be672
feat(compare): drop the task table's explanation line
harenome Nov 18, 2026
5b6b825
style(compare): mend the pages table row and stray blank lines
harenome Nov 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions app/nullius/compare/comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ def value(self) -> str:
return f"{self.workspace}:{self.job_id}"

@classmethod
def parse(cls, value: str) -> "RunRef":
def parse(cls, value: str, empty: bool = False) -> "RunRef":
"""``empty``: also a column with no run yet, ``<workspace>:``."""
name, separator, job_id = value.partition(":")
if not separator or not job_id:
if not separator or not (job_id or empty):
raise ValueError("A run selection must include its workspace and run id.")
# Empty means the active source, for legacy selections without a saved
# workspace. Named workspaces use the same slug alphabet as workspace.py.
Expand Down
128 changes: 128 additions & 0 deletions app/static/compare/columns.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
/* Compare's columns (templates/compare/compare.html): each header's workspace and run. The page's URL is the
comparison, its ordered pick= values: a run picked opens it with that run in its column; a workspace picked
lists its runs in place (/compare/runs). The run list searches as the table toolkit does. */
window.NulliusCompare = {
/* This page's URL with column `k` holding `value` (`<workspace>:<run id>`, `<workspace>:` for none). */
url(values, k, value) {
const u = new URL(location.href);
u.searchParams.delete('pick');
u.searchParams.delete('job');
values.forEach((v, i) => u.searchParams.append('pick', i === k ? value : v));
return u.pathname + u.search;
},

/* `node` showing the run `r`: agent · model, a check or its shards marked, the date at the right, where it
ran from below; its id in the tooltip. */
entry(node, r) {
const span = (cls, text) => { const s = document.createElement('span'); s.setAttribute('class', cls); s.textContent = text; return s; };
const line = span('run-line', [r.agent, r.model].filter(Boolean).join(' · '));
if (r.check) line.appendChild(span('chip-control', 'check'));
if (r.shards > 1) line.appendChild(span('run-shards', `${r.shards} shards`));
node.textContent = '';
[line, span('run-date', r.date), span('run-where', r.where)].forEach(s => node.appendChild(s));
node.setAttribute('title', r.id);
},

/* The listbox `list` of `runs`, the `same` first (the baseline's dataset) and a labelled line after them, a
line between launches. `n` names the options. */
fill(list, runs, same, n) {
const line = text => {
const li = document.createElement('li');
li.setAttribute('role', 'separator');
li.setAttribute('class', text ? 'run-sep labelled' : 'run-sep');
li.textContent = text;
return li;
};
list.textContent = '';
runs.forEach((r, i) => {
if (i && i === same) list.appendChild(line('Other datasets'));
else if (i && r.launch !== runs[i - 1].launch) list.appendChild(line(''));
const li = document.createElement('li');
li.setAttribute('role', 'option');
li.setAttribute('id', `${n}-${i}`);
li.setAttribute('class', 'run-entry');
li.dataset.value = r.value;
li.dataset.search = [r.agent, r.model, r.where, r.date, r.id, r.check ? 'check' : '', r.shards > 1 ? `${r.shards} shards` : ''].join(' ');

this.entry(li, r);
list.appendChild(li);
});
},

/* One column's `cells`, its header `th` first: its workspace select, its run button and the searchable list it
opens. */
column(cells, cfg) {
const th = cells[0], find = s => cells.map(c => c.querySelector(s)).find(Boolean);
const k = +th.dataset.column, ws = find('[data-ws]'), btn = find('[data-run-btn]');
const menu = find('[data-run-menu]'), q = menu.querySelector('input'), list = menu.querySelector('[role="listbox"]');
const none = menu.querySelector('[data-none]');
let at = -1;
const shown = () => [...list.querySelectorAll('[role="option"]')].filter(o => !o.hidden);
const able = () => shown().filter(o => o.getAttribute('aria-disabled') !== 'true');
const mark = i => {
const os = able();
at = Math.max(Math.min(i, os.length - 1), os.length ? 0 : -1);
os.forEach((o, j) => o.setAttribute('aria-selected', String(j === at)));
if (at < 0) q.removeAttribute('aria-activedescendant');
else { q.setAttribute('aria-activedescendant', os[at].id); os[at].scrollIntoView?.({block: 'nearest'}); }
};
const search = () => {
list.querySelectorAll('[role="option"]').forEach(o => { o.hidden = !NulliusTable.matches(o.dataset.search, q.value); });
list.querySelectorAll('[role="separator"]').forEach(s => { s.hidden = Boolean(q.value.trim()); });
none.hidden = shown().length > 0;
mark(0);
};
const show = data => {
this.fill(list, data.runs, data.same, list.id);
// the page's picks name whole runs (a shard's id stands for its run): another column's is greyed, this one's checked
list.querySelectorAll('[role="option"]').forEach(o => {
const j = cfg.values.indexOf(o.dataset.value);
if (j === k) o.setAttribute('aria-checked', 'true');
else if (j >= 0) { o.setAttribute('aria-disabled', 'true'); o.setAttribute('title', `Already in column ${j + 1}`); }
});
search();
};
const pick = o => { location.href = this.url(cfg.values, k, o.dataset.value); };
q.addEventListener('input', search);
q.addEventListener('keydown', e => {
if (e.key === 'ArrowDown' || e.key === 'ArrowUp') { e.preventDefault(); mark(at + (e.key === 'ArrowDown' ? 1 : -1)); }
else if (e.key === 'Enter' && able()[at]) { e.preventDefault(); pick(able()[at]); }
});
list.addEventListener('click', e => { const o = e.target.closest('[role="option"]'); if (o && o.getAttribute('aria-disabled') !== 'true') pick(o); });
// fixed under its button (the table's scroll box would clip it), placed before it opens and takes the focus,
// so the focus never scrolls the table
const place = () => {
const b = btn.getBoundingClientRect(), w = Math.min(Math.max(b.width, 320), innerWidth - 16);
Object.assign(menu.style, {top: `${b.bottom + 4}px`, left: `${Math.max(8, Math.min(b.left, innerWidth - w - 8))}px`, width: `${w}px`});
};
btn.addEventListener('click', place);
NulliusTable.menu(btn, menu);

addEventListener('resize', place);
document.addEventListener('scroll', e => { if (!menu.contains(e.target)) place(); }, true);

ws.addEventListener('change', () => {
nulliusFetch(cfg.runs + '?' + new URLSearchParams({workspace: ws.value, dataset: cfg.dataset}))
.then(r => r.ok ? r.json() : Promise.reject(r.status))
.then(data => {
show(data);
// an empty column keeps its workspace in the URL; one with a run keeps it until another is picked
if (!th.dataset.run) { cfg.values[k] = ws.value + ':'; history.replaceState(null, '', this.url(cfg.values, k, cfg.values[k])); }
if (menu.hidden) btn.click();
});
});
show(cfg.lists[ws.value] || {runs: [], same: 0});
const mine = (cfg.lists[ws.value]?.runs || []).find(r => r.value === cfg.values[k]);
if (mine) this.entry(btn.querySelector('[data-run-label]'), mine);
},

/* Every column of the page, its cells in the rows they share, and the Order menu. A list opens only on its
button. */
wire(cfg) {
const order = document.querySelector('[data-order-btn]');
if (order) NulliusTable.menu(order, order.nextElementSibling);
const cols = [];
document.querySelectorAll('[data-column]').forEach(c => (cols[+c.dataset.column] ||= []).push(c));
cols.forEach(cells => this.column(cells, cfg));
},
};
67 changes: 44 additions & 23 deletions app/static/compare/comparison.css
Original file line number Diff line number Diff line change
@@ -1,31 +1,48 @@
/* Comparison controls share the shell's theme and leave data colours alone. */
.compare-title { justify-content: space-between; align-items: center; }
.cohort-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin: 1.5rem 0; }
.cohort-switch { display: inline-flex; padding: 4px; gap: 4px; border: 1px solid var(--border-soft); border-radius: 8px; background: var(--surface); }
.cohort-switch a { padding: .5rem .9rem; border-radius: 5px; font-size: .84rem; color: var(--text-dim); }
.cohort-switch a:hover { background: var(--surface-2); text-decoration: none; }
.cohort-switch a[aria-current="true"] { background: var(--accent-soft); color: var(--accent); }
.cohort-note { margin: 1rem 0 1.6rem; padding: 1rem 1.2rem; background: var(--surface-2); border-radius: 7px; color: var(--text-dim); font-size: .85rem; line-height: 1.7; }
.cohort-note p { margin: 0; }
.cohort-note p + p { margin-top: .55rem; }
.compare-workspace { color: var(--text-dim); font-size: .74rem; font-weight: 400; margin-top: .35rem; }
.compare-excluded { color: var(--text-faint); font-size: .73rem; margin-top: .35rem; }
.compare-attempts { display: block; color: var(--text-faint); font-size: .72rem; margin-top: .4rem; }
.compare-task-dataset { display: block; color: var(--text-faint); font: .7rem var(--sans); margin: .3rem 0 0 1.5rem; }
.compare-picker { max-width: 1100px; }
.compare-pick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem; }
.compare-pick-side { min-width: 0; display: flex; flex-direction: column; gap: .6rem; }
.compare-pick-side > label { color: var(--text-dim); font-size: .82rem; }
.compare-pick-side select { width: 100%; min-width: 0; padding: .75rem .85rem; border: 1px solid var(--border); border-radius: 7px; font: .88rem var(--sans); color: var(--text); background: var(--surface); }
.compare-pick-side option { color: var(--text); background: var(--surface); }
.compare-pick-caption { color: var(--text-faint); font-size: .8rem; margin: .2rem 0 0; }
.compare-pick-actions { display: flex; align-items: center; gap: 1rem; margin-top: 1.4rem; flex-wrap: wrap; }
.compare-pick-actions > label { display: inline-flex; gap: .45rem; align-items: center; color: var(--text-dim); font-size: .85rem; }
.compare-pick-step { color: var(--text-faint); font: .7rem var(--mono); letter-spacing: .08em; text-transform: uppercase; margin: 0 0 1.4rem; }
@media (max-width: 640px) {
.compare-pick-grid { grid-template-columns: 1fr; gap: 1rem; }
.cohort-tools { align-items: flex-start; flex-direction: column; }
}
.compare-warn { color: var(--patch_failed_tests); font-size: .86rem; margin: 0 0 1.4rem; }

/* A column's tools in its header, its workspace and run in the rows below; an empty column greyed, with no numbers. */
.compare-col { vertical-align: top; text-transform: none; letter-spacing: 0; font-weight: 400; }
.col-head { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.col-tools { display: flex; align-items: center; gap: .15rem; }
.col-id { display: flex; flex-wrap: wrap; gap: .2rem .8rem; }
.col-tools .icon-btn { width: 26px; height: 26px; font-size: .9rem; text-decoration: none; }
.compare-baseline { margin-right: auto; color: var(--accent); font-size: .7rem; letter-spacing: .07em; text-transform: uppercase; }
.col-ws, .col-run { width: 100%; min-width: 0; padding: .45rem .6rem; border: 1px solid var(--border); border-radius: 7px; font: .82rem var(--sans); color: var(--text); background: var(--surface); text-align: left; }
.col-run { cursor: pointer; }
.col-run:hover, .col-ws:hover { border-color: var(--text-faint); }
.compare-col.empty .col-ws, .compare-col.empty .col-run { color: var(--text-dim); background: var(--surface-2); border-style: dashed; }
.compare-empty { background-image: linear-gradient(color-mix(in srgb, var(--surface-2) 45%, transparent) 0 0); } /* an image: a pinned row's opaque colour stays under it */
/* a run as its list and its button show it */
.run-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .1rem .6rem; min-width: 0; }
.run-line { overflow-wrap: anywhere; color: var(--text); }
.run-line .chip-control, .run-shards { margin-left: .4rem; }
.run-shards { color: var(--text-faint); font-size: .72rem; white-space: nowrap; }
.run-date { color: var(--text-faint); font-size: .72rem; white-space: nowrap; }
.run-where { grid-column: 1 / -1; color: var(--text-dim); font-size: .72rem; overflow-wrap: anywhere; }
.run-menu { position: fixed; z-index: 30; padding: .5rem; }

.run-menu .st-search { margin: 0 0 .4rem; }
.run-list { list-style: none; margin: 0; padding: 0; max-height: min(60vh, 26rem); overflow-y: auto; }
.run-list [role="option"] { padding: .45rem .5rem; border-radius: 6px; cursor: pointer; font-size: .82rem; }
.run-list [role="option"]:not([aria-disabled="true"]):hover, .run-list [aria-selected="true"] { background: var(--surface-2); }
.run-list [aria-selected="true"] { box-shadow: inset 2px 0 0 var(--accent); }
.run-list [aria-disabled="true"] { opacity: .45; cursor: default; } /* another column's run */
.run-list [aria-checked="true"] .run-line::before { content: "✓ "; color: var(--accent); } /* this column's run */
.run-sep { border-top: 1px solid var(--border-soft); margin: .25rem 0; }
.run-sep.labelled { padding: .4rem .5rem .1rem; color: var(--text-faint); font-size: .7rem; letter-spacing: .07em; text-transform: uppercase; }
/* a summary cell's difference from the baseline, in the row's unit */
.delta { display: block; font-size: .72rem; font-weight: 400; color: var(--text-faint); }
.delta.ok { color: var(--resolved); }
.delta.bad { color: var(--bad); }

/* One column contract for the overview, task rows and expanded metrics. */
.compare-table-wrap {
Expand All @@ -48,6 +65,8 @@
padding-inline: var(--compare-cell-inset);
}
.compare-table-wrap .grid.compare.tasks > tbody > .compare-task-row > td { vertical-align: middle; }
/* the task table's header row, under its columns' controls: read as a table head */
.grid.compare.tasks .compare-task-head > th { color: var(--text-dim); font-weight: 500; font-size: .78rem; border-bottom-color: var(--border); }
.compare-task-name { display: flex; align-items: center; gap: .4rem; min-width: 0; }
.compare-task-name .disclose { flex: none; margin: 0; min-height: 1.8rem; }
.compare-task-label { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; min-width: 0; overflow: hidden; overflow-wrap: anywhere; font-size: .82rem; }
Expand Down Expand Up @@ -78,13 +97,15 @@
}
@media (max-width: 640px) {
.compare-table-wrap { --compare-label-width: 14rem; }
/* the summary keeps room for a run column beside its pinned names */
.compare-table-wrap .grid.compare:not(.tasks) { --compare-label-width: 8.5rem; min-width: calc(var(--compare-label-width) + var(--cols, 2) * 15rem); }
/* Let a whole agent column enter the viewport when scrolling on a phone. */
.compare-table-wrap .grid.compare th.rowhead,
.compare-table-wrap .grid.inner th.rowhead,
.compare-table-wrap .grid.compare.tasks > thead > tr > th:first-child,
.compare-table-wrap .grid.compare.tasks > tbody > .compare-task-row > td:first-child { position: static; }
.compare-table-wrap .grid.compare.tasks .sticky-col,
.compare-table-wrap .grid.inner .sticky-col { position: static; }
}



/* Side-by-side trial headings: section-title margins must not offset badges. */
.cmp-head .compare-trial-heading {
display: flex;
Expand Down
2 changes: 1 addition & 1 deletion app/static/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
if (active && (!active.select.isConnected || active.select.disabled)) close();
for (const [select, button] of controls) if (!select.isConnected) { button.remove(); controls.delete(select); }
document.querySelectorAll('select:not([multiple])').forEach(select => {
if (select.size > 1) return;
if (select.size > 1 || select.closest('[inert]')) return; // an inert copy (a sticky row's placeholder) needs no menu
let button = controls.get(select);
if (!button) {
button = document.createElement('button'); button.type = 'button'; button.className = 'ui-select-trigger';
Expand Down
3 changes: 2 additions & 1 deletion app/static/onboarding.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,13 @@
<p>A one-minute look at the main pages, then a checklist that takes you to a first result:</p>
<ul><li>Set up a key and where runs happen</li><li>A free check run: oracle and nop call no model</li><li>Read the result, then compare an agent's run</li></ul>
<div class="onb-actions"><button class="btn ghost" type="button" data-a="no">No, I'll explore</button><button class="btn" type="button" data-a="yes">Yes, guide me</button></div></div>`;
const back = document.activeElement;
document.body.append(layer);
layer.querySelector('[data-a=yes]').focus();
layer.addEventListener('click', e => {
const a = e.target.closest('[data-a]')?.dataset.a;
if (!a) return;
S.asked = true; S.open = a === 'yes'; save(); layer.remove();
S.asked = true; S.open = a === 'yes'; save(); layer.remove(); back?.focus();
if (a === 'yes') startTour(); else renderPanel();
});
}
Expand Down
Loading
Loading