From 8bbed0995790dfabdca8dffbfe2c32a0b1ea9bf2 Mon Sep 17 00:00:00 2001 From: Etienne Filhol Date: Thu, 19 Nov 2026 15:42:06 +0100 Subject: [PATCH 1/8] fix(builder): show Boat's logo on the sandbox card and link a missing key to Settings The Where step's Boat card had no mark, unlike Settings. Without a key, the card now offers a button straight to Settings > Sandbox; other reasons Boat cannot run stay a plain line. --- app/static/builder/command-builder.css | 3 ++- app/static/builder/command-builder.js | 2 +- app/ui_tests/test_agents.py | 2 +- app/ui_tests/test_builder_where.py | 6 ++++++ app/web/builder.py | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/static/builder/command-builder.css b/app/static/builder/command-builder.css index 769c48da..5b151bad 100644 --- a/app/static/builder/command-builder.css +++ b/app/static/builder/command-builder.css @@ -282,7 +282,8 @@ #nullius-builder .std-machines button:focus-visible { outline: 2px solid var(--nb-blue); outline-offset: 2px; } #nullius-builder .std-machines button:disabled { opacity: .45; cursor: not-allowed; } #nullius-builder .std-boat-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: fit-content; max-width: 100%; min-width: 190px; margin-top: 12px; padding: 12px 14px; border: 1px solid var(--nb-blue); border-radius: 10px; background: var(--nb-tint); } -#nullius-builder .std-boat-card strong { font-size: 15px; font-weight: 500; } +#nullius-builder .std-boat-card strong { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; } +#nullius-builder .std-boat-logo { width: 20px; height: 20px; flex: none; } #nullius-builder .std-boat-card > span { font-size: 13px; color: var(--nb-muted); } #nullius-builder .std-boat-slots { border: 1px solid var(--nb-line); border-radius: 999px; padding: 2px 8px; } #nullius-builder .std-hosts { margin-top: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 240px)); } diff --git a/app/static/builder/command-builder.js b/app/static/builder/command-builder.js index 83831868..52532244 100644 --- a/app/static/builder/command-builder.js +++ b/app/static/builder/command-builder.js @@ -502,7 +502,7 @@ } return '

Where does it run?

' + `
${kind('hosts', 'Hosts')}${kind('boat', 'Sandboxes', here.boat || '')}
` - + (sandboxes ? `
BoatOne VM per ${esc(noun)}${here.boatSlots ? `${here.boatSlots} at once on this account` : ''}${here.boat ? `${esc(here.boat)}` : ''}
` + sizes + + (sandboxes ? `
BoatOne VM per ${esc(noun)}${here.boatSlots ? `${here.boatSlots} at once on this account` : ''}${here.boat ? (here.boatKey ? `${esc(here.boat)}` : button('Add a Boat API key in Settings', 'data-href="/settings#sandbox"', 'nb-inlinebutton std-boat-key')) : ''}
` + sizes : `
${machine('local', 'This machine', 'Runs here')}${H.map(h => machine(h.entry, h.label, 'Over SSH')).join('')}
` + (list.some(w => w !== 'local') ? button('Test connection', 'id="nb-test-host"') + ' ' : '')) + '

Isolation

' diff --git a/app/ui_tests/test_agents.py b/app/ui_tests/test_agents.py index 7dd77445..09138b0b 100644 --- a/app/ui_tests/test_agents.py +++ b/app/ui_tests/test_agents.py @@ -528,7 +528,7 @@ def test_the_builder_is_given_the_controls_their_proofs_and_whether_docker_runs_ {"key": "large", "label": "Large", "spec": "", "memory_gb": None, "why": None}, {"key": "xlarge", "label": "XLarge", "spec": "", "memory_gb": None, "why": None}] self.assertEqual(schema["standardHere"], {"docker": None, "boat": "no Boat API key: set it in Settings → Sandbox", - "boatSizes": sizes, "boatSlots": None, "licences": {}, "host": {}}) + "boatSizes": sizes, "boatSlots": None, "boatKey": False, "licences": {}, "host": {}}) def test_the_builder_offers_the_boat_sizes_and_vms_at_once_its_account_says(self): from nullius.standard import boat diff --git a/app/ui_tests/test_builder_where.py b/app/ui_tests/test_builder_where.py index 478b4fb5..9889a4ae 100644 --- a/app/ui_tests/test_builder_where.py +++ b/app/ui_tests/test_builder_where.py @@ -54,11 +54,17 @@ def test_hosts_or_sandboxes_never_both_and_a_sandbox_is_its_own_isolation(self): self.assertIn("The agent alone in each problem's VM", ordinary) self.assertIn("Answers and keys stay on this machine", ordinary) self.assertIn('class="std-boat-card"', ordinary) + self.assertIn('src="/static/brand/boat.svg"', ordinary) # Boat's mark, one per theme + self.assertIn('src="/static/brand/boat-dark.svg"', ordinary) self.assertNotIn("shards, merged", ordinary) self.assertNotIn("at once", self.draw(None, backends=("boat",), slots=None)["gsm8k boat"]) # the API said nothing: no number gone = self.draw(None, backends=("boat",), boat="no Boat API key: set it in Settings → Sandbox")["gsm8k boat"] self.assertIn('disabled aria-disabled="true" title="no Boat API key: set it in Settings → Sandbox"', card(gone, "boat")) self.assertNotIn("data-std-boat-size", gone) + self.assertIn('class="nb-inlinebutton std-boat-key" data-href="/settings#sandbox">Add a Boat API key in Settings', gone) + missing = self.draw(None, "schema.standardHere.boatKey=true;", backends=("boat",), boat="missing on this machine: ssh")["gsm8k boat"] + self.assertIn('missing on this machine: ssh', missing) # not a key: nothing in Settings fixes it + self.assertNotIn("std-boat-key", missing) def test_a_benchmark_booting_its_own_vms_asks_no_isolation_and_refuses_a_size_too_small_for_its_vm(self): for key in ("osworld1", "osworld2"): diff --git a/app/web/builder.py b/app/web/builder.py index d3bb2d7e..d391425c 100644 --- a/app/web/builder.py +++ b/app/web/builder.py @@ -102,7 +102,7 @@ def _builder_data() -> dict: data["standardHere"] = {"docker": execute.docker_problem(), "boat": boat_why, "boatSizes": [{"key": k, "label": z["label"], "spec": boat.spec(k), "memory_gb": z.get("memory_gb"), "why": types.get(k)} for k, z in boat.SIZES.items() if not types or k in types], - "boatSlots": account.get("slots"), "licences": _licence_states(), "host": host} + "boatSlots": account.get("slots"), "boatKey": bool(boat.key()), "licences": _licence_states(), "host": host} data["csrf"] = shared._csrf_token() data["local"] = shared_local_client() data["recipesWhy"] = WRITE_HERE From b4de4828d621712060d278c0c8fcc35341ea0073 Mon Sep 17 00:00:00 2001 From: Etienne Filhol Date: Thu, 19 Nov 2026 15:47:20 +0100 Subject: [PATCH 2/8] fix(builder): align Boat's VMs-at-once line with the rest of its card --- app/static/builder/command-builder.css | 1 - app/static/builder/command-builder.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/static/builder/command-builder.css b/app/static/builder/command-builder.css index 5b151bad..1d1ee45a 100644 --- a/app/static/builder/command-builder.css +++ b/app/static/builder/command-builder.css @@ -285,7 +285,6 @@ #nullius-builder .std-boat-card strong { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; } #nullius-builder .std-boat-logo { width: 20px; height: 20px; flex: none; } #nullius-builder .std-boat-card > span { font-size: 13px; color: var(--nb-muted); } -#nullius-builder .std-boat-slots { border: 1px solid var(--nb-line); border-radius: 999px; padding: 2px 8px; } #nullius-builder .std-hosts { margin-top: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 240px)); } #nullius-builder .std-isolation { padding: 12px 14px; border: 1px solid var(--nb-line); border-radius: 10px; background: var(--nb-soft); } #nullius-builder .std-isolation small { display: block; margin-top: 4px; font-size: 13px; color: var(--nb-muted); } diff --git a/app/static/builder/command-builder.js b/app/static/builder/command-builder.js index 52532244..dd384e17 100644 --- a/app/static/builder/command-builder.js +++ b/app/static/builder/command-builder.js @@ -502,7 +502,7 @@ } return '

Where does it run?

' + `
${kind('hosts', 'Hosts')}${kind('boat', 'Sandboxes', here.boat || '')}
` - + (sandboxes ? `
BoatOne VM per ${esc(noun)}${here.boatSlots ? `${here.boatSlots} at once on this account` : ''}${here.boat ? (here.boatKey ? `${esc(here.boat)}` : button('Add a Boat API key in Settings', 'data-href="/settings#sandbox"', 'nb-inlinebutton std-boat-key')) : ''}
` + sizes + + (sandboxes ? `
BoatOne VM per ${esc(noun)}${here.boatSlots ? `${here.boatSlots} at once on this account` : ''}${here.boat ? (here.boatKey ? `${esc(here.boat)}` : button('Add a Boat API key in Settings', 'data-href="/settings#sandbox"', 'nb-inlinebutton std-boat-key')) : ''}
` + sizes : `
${machine('local', 'This machine', 'Runs here')}${H.map(h => machine(h.entry, h.label, 'Over SSH')).join('')}
` + (list.some(w => w !== 'local') ? button('Test connection', 'id="nb-test-host"') + ' ' : '')) + '

Isolation

' From 27cf48733316047237de958755c2c6017b9add60 Mon Sep 17 00:00:00 2001 From: Etienne Filhol Date: Thu, 19 Nov 2026 15:49:18 +0100 Subject: [PATCH 3/8] fix(builder): open Sandboxes without a Boat key, its card greyed with only the Settings link live --- app/static/builder/command-builder.css | 3 +++ app/static/builder/command-builder.js | 4 ++-- app/ui_tests/test_builder_where.py | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/static/builder/command-builder.css b/app/static/builder/command-builder.css index 1d1ee45a..e3532717 100644 --- a/app/static/builder/command-builder.css +++ b/app/static/builder/command-builder.css @@ -285,6 +285,9 @@ #nullius-builder .std-boat-card strong { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; } #nullius-builder .std-boat-logo { width: 20px; height: 20px; flex: none; } #nullius-builder .std-boat-card > span { font-size: 13px; color: var(--nb-muted); } +#nullius-builder .std-boat-card.off { border-color: var(--nb-line); background: transparent; cursor: not-allowed; } /* cannot run here: not chosen, only its link works */ +#nullius-builder .std-boat-card.off > :not(.std-boat-key) { opacity: .5; } +#nullius-builder .std-boat-card.off .std-boat-key { cursor: pointer; } #nullius-builder .std-hosts { margin-top: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 240px)); } #nullius-builder .std-isolation { padding: 12px 14px; border: 1px solid var(--nb-line); border-radius: 10px; background: var(--nb-soft); } #nullius-builder .std-isolation small { display: block; margin-top: 4px; font-size: 13px; color: var(--nb-muted); } diff --git a/app/static/builder/command-builder.js b/app/static/builder/command-builder.js index dd384e17..1269034d 100644 --- a/app/static/builder/command-builder.js +++ b/app/static/builder/command-builder.js @@ -501,8 +501,8 @@ disabled: !!z.why, why: z.why, note: z.note || z.spec, title: z.label})).join('')}`; } return '

Where does it run?

' - + `
${kind('hosts', 'Hosts')}${kind('boat', 'Sandboxes', here.boat || '')}
` - + (sandboxes ? `
BoatOne VM per ${esc(noun)}${here.boatSlots ? `${here.boatSlots} at once on this account` : ''}${here.boat ? (here.boatKey ? `${esc(here.boat)}` : button('Add a Boat API key in Settings', 'data-href="/settings#sandbox"', 'nb-inlinebutton std-boat-key')) : ''}
` + sizes + + `
${kind('hosts', 'Hosts')}${kind('boat', 'Sandboxes', here.boatKey ? here.boat || '' : '')}
` + + (sandboxes ? `
BoatOne VM per ${esc(noun)}${here.boatSlots ? `${here.boatSlots} at once on this account` : ''}${here.boat ? (here.boatKey ? `${esc(here.boat)}` : button('Add a Boat API key in Settings', 'data-href="/settings#sandbox"', 'nb-inlinebutton std-boat-key')) : ''}
` + sizes : `
${machine('local', 'This machine', 'Runs here')}${H.map(h => machine(h.entry, h.label, 'Over SSH')).join('')}
` + (list.some(w => w !== 'local') ? button('Test connection', 'id="nb-test-host"') + ' ' : '')) + '

Isolation

' diff --git a/app/ui_tests/test_builder_where.py b/app/ui_tests/test_builder_where.py index 9889a4ae..0445fbdd 100644 --- a/app/ui_tests/test_builder_where.py +++ b/app/ui_tests/test_builder_where.py @@ -54,17 +54,19 @@ def test_hosts_or_sandboxes_never_both_and_a_sandbox_is_its_own_isolation(self): self.assertIn("The agent alone in each problem's VM", ordinary) self.assertIn("Answers and keys stay on this machine", ordinary) self.assertIn('class="std-boat-card"', ordinary) + self.assertIn('class="std-boat-card off"', self.draw(None, backends=("boat",), boat="no Boat API key")["gsm8k boat"]) # cannot run: drawn as not chosen self.assertIn('src="/static/brand/boat.svg"', ordinary) # Boat's mark, one per theme self.assertIn('src="/static/brand/boat-dark.svg"', ordinary) self.assertNotIn("shards, merged", ordinary) self.assertNotIn("at once", self.draw(None, backends=("boat",), slots=None)["gsm8k boat"]) # the API said nothing: no number gone = self.draw(None, backends=("boat",), boat="no Boat API key: set it in Settings → Sandbox")["gsm8k boat"] - self.assertIn('disabled aria-disabled="true" title="no Boat API key: set it in Settings → Sandbox"', card(gone, "boat")) + self.assertNotIn("disabled", card(gone, "boat")) # no key: still chosen, and its card links to Settings self.assertNotIn("data-std-boat-size", gone) self.assertIn('class="nb-inlinebutton std-boat-key" data-href="/settings#sandbox">Add a Boat API key in Settings', gone) missing = self.draw(None, "schema.standardHere.boatKey=true;", backends=("boat",), boat="missing on this machine: ssh")["gsm8k boat"] self.assertIn('missing on this machine: ssh', missing) # not a key: nothing in Settings fixes it self.assertNotIn("std-boat-key", missing) + self.assertIn('disabled aria-disabled="true" title="missing on this machine: ssh"', card(missing, "boat")) def test_a_benchmark_booting_its_own_vms_asks_no_isolation_and_refuses_a_size_too_small_for_its_vm(self): for key in ("osworld1", "osworld2"): From d5d4bc6d5520da4331b9363009405d67707fc9e2 Mon Sep 17 00:00:00 2001 From: Etienne Filhol Date: Thu, 19 Nov 2026 16:17:50 +0100 Subject: [PATCH 4/8] fix(builder): open Settings links as the Settings popup, Boat's on its key form, and say each Where error once --- app/nullius/standard/recipe.py | 8 +++++--- app/static/builder/command-builder.js | 12 +++++------- app/static/settings/modal.js | 20 +++++++++++++------- app/static/settings/sandbox.js | 7 ++++++- app/tests/test_standard_boat.py | 7 ++++++- app/ui_tests/test_builder_where.py | 2 +- 6 files changed, 36 insertions(+), 20 deletions(-) diff --git a/app/nullius/standard/recipe.py b/app/nullius/standard/recipe.py index 4afbeeb3..60b605c8 100644 --- a/app/nullius/standard/recipe.py +++ b/app/nullius/standard/recipe.py @@ -319,7 +319,9 @@ def compile(recipe: dict, defs: Optional[Dict[str, List[dict]]] = None, *, the run sends it as.""" d = defs or _all() errors, notes = [], [] - add = lambda step, message: errors.append({"step": STEP[step], "message": message}) + # shown: the step already says it where it is fixed (Where's Boat card links a missing key to Settings), so + # its own error line leaves it out and only Review lists it + add = lambda step, message, shown=False: errors.append({"step": STEP[step], "message": message, **({"shown": True} if shown else {})}) out = {"errors": errors, "notes": notes, "review": [], "jobs": [], "confirm": "", "script": "", "parts": [], "model": "", "served_models": {}} name = str(recipe.get("name") or "") @@ -561,7 +563,7 @@ def compile(recipe: dict, defs: Optional[Dict[str, List[dict]]] = None, *, elif backend == "boat" and targets != ["local"]: add("where", "Hosts and Boat sandboxes do not mix: choose Hosts, or Sandboxes alone.") elif backend == "boat" and boat_unusable is not None and (why := boat_unusable(True)): - add("where", f"Boat cannot run: {why}.") + add("where", f"Boat cannot run: {why}.", shown=not boat.key()) elif backend == "boat" and boat_size_problem is not None and str(recipe.get("boat_size") or boat.SIZE) in boat.SIZES: why = boat_size_problem(str(recipe.get("boat_size") or boat.SIZE)) if why: @@ -585,7 +587,7 @@ def compile(recipe: dict, defs: Optional[Dict[str, List[dict]]] = None, *, elsewhere = [definitions.setup_label(b, "original") if p.get("setup") else p["o"]["label"] for p in picks if not whole and (p["control"] or p.get("setup") or (computer and side == "agent"))] if backend == "boat" and elsewhere: - add("where", f"{', '.join(elsewhere)} cannot run in a Boat VM yet: choose Hosts.") + add("where", f"{', '.join(elsewhere)} cannot run in a Boat VM: choose Hosts.") # a job that calls no model (a control of a benchmark with no judge) spends nothing and takes no share spends = lambda p: not (p["control"] and not (b.get("score") or {}).get("judge") and not needs["embeddings"] and not needs["reranker"]) paying = len(dss) * sum(1 for p in picks if spends(p)) * len(targets or [None]) diff --git a/app/static/builder/command-builder.js b/app/static/builder/command-builder.js index 1269034d..b78ecbd7 100644 --- a/app/static/builder/command-builder.js +++ b/app/static/builder/command-builder.js @@ -488,9 +488,6 @@ const web = agentRun && Object.values((b || {}).environments || {}).some(e => e.network); // an agent's public web proxy // a VM benchmark's provider of one value goes on the fixed line; several are its cards (benchOptions) const provider = vms && Object.values(b.options || {}).find(o => o.step === 'where' && o.values && o.values.length === 1 && Object.values(o.needs || {}).some(n => n && n.vm)); - // what a sandbox cannot run (recipe.py): a setup or a check runs on a machine; the computer port's socket is on this one - // a benchmark booting VMs of its own runs each unit whole in a VM, with a relay container in each VM (boat_units) - const outside = !sandboxes ? [] : selected.filter(o => !vms && (o.setup || o.control || ((b.needs || []).some(p => p.startsWith('agent.computer/')) && b.family === 'agent'))).map(o => o.label); let sizes = ''; if (sandboxes && !here.boat) { const offered = boatSizes(rec, b), fit = offered.find(z => !z.why); @@ -502,7 +499,7 @@ } return '

Where does it run?

' + `
${kind('hosts', 'Hosts')}${kind('boat', 'Sandboxes', here.boatKey ? here.boat || '' : '')}
` - + (sandboxes ? `
BoatOne VM per ${esc(noun)}${here.boatSlots ? `${here.boatSlots} at once on this account` : ''}${here.boat ? (here.boatKey ? `${esc(here.boat)}` : button('Add a Boat API key in Settings', 'data-href="/settings#sandbox"', 'nb-inlinebutton std-boat-key')) : ''}
` + sizes + + (sandboxes ? `
BoatOne VM per ${esc(noun)}${here.boatSlots ? `${here.boatSlots} at once on this account` : ''}${here.boat ? (here.boatKey ? `${esc(here.boat)}` : button('Add a Boat API key in Settings', 'data-href="/settings#sandbox-boat-key"', 'nb-inlinebutton std-boat-key')) : ''}
` + sizes : `
${machine('local', 'This machine', 'Runs here')}${H.map(h => machine(h.entry, h.label, 'Over SSH')).join('')}
` + (list.some(w => w !== 'local') ? button('Test connection', 'id="nb-test-host"') + ' ' : '')) + '

Isolation

' @@ -514,7 +511,6 @@ : 'Sandboxed: each unit in a container whose only way out is its relay.', containerWhy) + '') + (b ? benchOptions(rec, b, 'where') : '') + (agentRun && backend === 'local' ? consentBox(rec) : '') - + (outside.length ? `

${esc(outside.join(', '))} cannot run in a Boat VM yet: choose Hosts.

` : '') + (dockerOnly.length && backend !== 'container' && agentRun ? `

${esc(dockerOnly.join(', '))}: ${dockerOnly.length > 1 ? 'these environments need' : 'this environment needs'} a container - ${sandboxes ? 'in a Boat VM' : 'on local processes'} their units are recorded as not run.

` : '') + (sandboxes ? '' : hostSetup(rec)); } @@ -941,7 +937,7 @@ const out=runnerOut||{errors:[],notes:[]}; compiled={errors:out.errors||[],notes:out.notes||[]}; }else{compiled=C.compile(rec);} - $('#nb-localerrors').textContent=compiled.errors.filter(e=>e.step===step).map(e=>e.message).join(' '); + $('#nb-localerrors').textContent=compiled.errors.filter(e=>e.step===step&&!e.shown).map(e=>e.message).join(' '); const errors=$('#nb-errors'); if(errors){ errors.hidden=!compiled.errors.length; @@ -1087,7 +1083,9 @@ if(d.pickCat!==undefined){pickOf().cat=d.pickCat;applyPick();return;} if(d.pickFam!==undefined){pickOf().fam=d.pickFam;applyPick();return;} if(d.agent){const on=r().agents.includes(d.agent);r().agents=on?r().agents.filter(id=>id!==d.agent):[...r().agents,d.agent];renderForm();refreshPlan();return;} - else if(d.href){location.href=d.href;return;} + // Settings opens as its popup over the builder; closed, the builder opens again to read what changed, from its + // draft (saved on every render), so without the query that would replace the recipe and step with a fresh one + else if(d.href){if(window.nulliusOpenSettings?.(d.href,b)){saveDraft();document.getElementById('settings-modal').addEventListener('close',()=>location.replace(location.pathname),{once:true});}else location.href=d.href;return;} else if(b.id==='nb-add-custom-agent'){r().customAgents.push('');r().agents.push('custom-'+(r().customAgents.length-1));renderForm();refreshPlan();root.querySelector('[data-custom-agent="'+(r().customAgents.length-1)+'"]')?.focus();return;} else if(d.removeCustomAgent!==undefined){const i=Number(d.removeCustomAgent),rec=r(),kept=rec.agents.filter(id=>id.startsWith('custom-')&&id!=='custom-'+i).map(id=>Number(id.slice(7)));rec.customAgents.splice(i,1);rec.agents=rec.agents.filter(id=>!id.startsWith('custom-')).concat(kept.map(k=>'custom-'+(k>i?k-1:k)));renderForm();refreshPlan();return;} // The Harbor panel (Runner step): a release or a repository, a ref of it, installed and asked for its agents. diff --git a/app/static/settings/modal.js b/app/static/settings/modal.js index 9df3d5b5..b9896c72 100644 --- a/app/static/settings/modal.js +++ b/app/static/settings/modal.js @@ -72,13 +72,12 @@ proxy.remove(); }); }); - document.addEventListener('click', event => { - const link = event.target.closest('a[href]'); - if (!link || event.defaultPrevented || event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || link.target || link.download) return; - const url = new URL(link.href, location.href); - if (url.origin !== location.origin || url.pathname !== '/settings' || location.pathname === '/settings') return; - event.preventDefault(); - opener = link; + // Settings opens here from any page but its own: a link to /settings, or a script with nulliusOpenSettings(href, opener) + // (the builder's Settings buttons); false when it does not, so the caller navigates instead. + function open(href, from) { + const url = new URL(href, location.href); + if (url.origin !== location.origin || url.pathname !== '/settings' || location.pathname === '/settings') return false; + opener = from; baseline = ''; closing = false; closeButton.disabled = false; @@ -87,5 +86,12 @@ frame.src = url.href; modal.showModal(); document.getElementById('settings-modal-title').focus(); + return true; + } + window.nulliusOpenSettings = open; + document.addEventListener('click', event => { + const link = event.target.closest('a[href]'); + if (!link || event.defaultPrevented || event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || link.target || link.download) return; + if (open(link.href, link)) event.preventDefault(); }); })(); diff --git a/app/static/settings/sandbox.js b/app/static/settings/sandbox.js index 465a1993..47099624 100644 --- a/app/static/settings/sandbox.js +++ b/app/static/settings/sandbox.js @@ -53,7 +53,11 @@ section.querySelectorAll('button').forEach(b => { b.disabled = false; }); } }; - if (edit) edit.addEventListener('click', () => { editing = true; render(); form.querySelector('input').focus(); }); + const open = () => { editing = true; render(); form.querySelector('input').focus(); }; + if (edit) edit.addEventListener('click', open); + // #sandbox-boat-key (the builder's link when Boat has no key) opens the key's form, as a provider's field does + const fromHash = () => { if (form && location.hash === '#sandbox-boat-key') open(); }; + window.addEventListener('hashchange', fromHash); if (cancel) cancel.addEventListener('click', () => { form.reset(); editing = false; render(); edit.focus(); }); if (form) form.addEventListener('submit', e => { e.preventDefault(); change('save'); }); if (remove) remove.addEventListener('click', () => asking(removeAsk.hidden)); @@ -65,4 +69,5 @@ const ask = () => { if (!asked && !section.hidden) load(); }; new MutationObserver(ask).observe(section, {attributes: true, attributeFilter: ['hidden']}); ask(); + fromHash(); })(); diff --git a/app/tests/test_standard_boat.py b/app/tests/test_standard_boat.py index 404ff0fd..6e26fc85 100644 --- a/app/tests/test_standard_boat.py +++ b/app/tests/test_standard_boat.py @@ -590,7 +590,7 @@ def test_a_benchmark_booting_its_own_vms_wants_a_size_that_holds_them_and_never_ small = errors(backend="boat", boat_size="small") self.assertIn("A Small VM is too small for OSWorld2, whose units boot a 4 GB VM: choose a larger size.", small) # Model-calling setups and controls use a relay container inside each whole-task VM. - self.assertNotIn("Original cannot run in a Boat VM yet: choose Hosts.", small) + self.assertNotIn("Original cannot run in a Boat VM: choose Hosts.", small) self.assertEqual(errors(backend="boat", boat_size="default", others=["original", "nop"]), []) self.assertFalse([m for m in errors(backend="boat", boat_size="default") if "too small" in m]) self.assertIn("OSWorld2 starts each unit's VM on the machine: choose local processes.", errors(backend="container")) @@ -602,6 +602,11 @@ def test_without_its_key_the_where_step_says_so(self): out = recipe.compile(a_recipe(backend="boat"), defs(), boat_unusable=lambda here=True: "no Boat API key: set it in Settings → Sandbox") self.assertEqual([e["step"] for e in out["errors"]], [recipe.STEP["where"]]) self.assertIn("Settings → Sandbox", out["errors"][0]["message"]) + # the Where step's Boat card links to Settings, so its own error line leaves the key out; Review lists it + for saved, shown in ((None, True), ("k", False)): + with mock.patch.object(boat, "key", return_value=saved): + out = recipe.compile(a_recipe(backend="boat"), defs(), boat_unusable=lambda here=True: "missing") + self.assertEqual(out["errors"][0].get("shown", False), shown) def test_a_conformance_check_on_boat_says_its_backend(self): agent = definitions.load("agent", ROOT)[0][0] diff --git a/app/ui_tests/test_builder_where.py b/app/ui_tests/test_builder_where.py index 0445fbdd..8567892f 100644 --- a/app/ui_tests/test_builder_where.py +++ b/app/ui_tests/test_builder_where.py @@ -62,7 +62,7 @@ def test_hosts_or_sandboxes_never_both_and_a_sandbox_is_its_own_isolation(self): gone = self.draw(None, backends=("boat",), boat="no Boat API key: set it in Settings → Sandbox")["gsm8k boat"] self.assertNotIn("disabled", card(gone, "boat")) # no key: still chosen, and its card links to Settings self.assertNotIn("data-std-boat-size", gone) - self.assertIn('class="nb-inlinebutton std-boat-key" data-href="/settings#sandbox">Add a Boat API key in Settings', gone) + self.assertIn('class="nb-inlinebutton std-boat-key" data-href="/settings#sandbox-boat-key">Add a Boat API key in Settings', gone) missing = self.draw(None, "schema.standardHere.boatKey=true;", backends=("boat",), boat="missing on this machine: ssh")["gsm8k boat"] self.assertIn('missing on this machine: ssh', missing) # not a key: nothing in Settings fixes it self.assertNotIn("std-boat-key", missing) From 434635becd6491ec14b8b0542df034a5e392ec36 Mon Sep 17 00:00:00 2001 From: Etienne Filhol Date: Fri, 20 Nov 2026 10:29:15 +0100 Subject: [PATCH 5/8] fix(builder): reload the builder whenever Settings closes, drop the Boat card's descriptions, and name its link Add API Key --- app/static/builder/command-builder.js | 11 +++++++---- app/ui_tests/test_builder_where.py | 5 ++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app/static/builder/command-builder.js b/app/static/builder/command-builder.js index b78ecbd7..db47dcd7 100644 --- a/app/static/builder/command-builder.js +++ b/app/static/builder/command-builder.js @@ -117,6 +117,10 @@ // An unsupported draft opens nothing; its rejection is shown as a toast. else { let d = null; try { d = C.unpackDraft(localStorage.getItem(draftKey), query); } catch {} if (d && d.recipe) { recipe = d.recipe; step = d.step; tab = d.tab; savedId = d.saved; } else if (d && d.gone) opened = d.gone; } const saveDraft = () => { try { localStorage.setItem(draftKey, C.packDraft({recipe, step, tab, saved: savedId})); } catch {} }; + // Settings closed, however it was opened (a builder link, the rail): the builder opens again to read what changed + // (a key added or removed), from its draft, so without the query that would replace the recipe and step with a fresh one + // (the popup comes after this script in the page, and its close does not bubble: caught on the way down) + document.addEventListener('close', e => { if (e.target.id === 'settings-modal') { saveDraft(); location.replace(location.pathname); } }, true); let compiled, pendingDirs, dirsSequence = 0; const r = () => recipe; const store = recipeStore({request: (...a) => nulliusFetch(...a), csrf: schema.csrf, storage: (() => { try { return localStorage; } catch { return {length: 0}; } })()}); @@ -499,7 +503,7 @@ } return '

Where does it run?

' + `
${kind('hosts', 'Hosts')}${kind('boat', 'Sandboxes', here.boatKey ? here.boat || '' : '')}
` - + (sandboxes ? `
BoatOne VM per ${esc(noun)}${here.boatSlots ? `${here.boatSlots} at once on this account` : ''}${here.boat ? (here.boatKey ? `${esc(here.boat)}` : button('Add a Boat API key in Settings', 'data-href="/settings#sandbox-boat-key"', 'nb-inlinebutton std-boat-key')) : ''}
` + sizes + + (sandboxes ? `
Boat${here.boat ? (here.boatKey ? `${esc(here.boat)}` : button('Add API Key', 'data-href="/settings#sandbox-boat-key"', 'nb-inlinebutton std-boat-key')) : ''}
` + sizes : `
${machine('local', 'This machine', 'Runs here')}${H.map(h => machine(h.entry, h.label, 'Over SSH')).join('')}
` + (list.some(w => w !== 'local') ? button('Test connection', 'id="nb-test-host"') + ' ' : '')) + '

Isolation

' @@ -1083,9 +1087,8 @@ if(d.pickCat!==undefined){pickOf().cat=d.pickCat;applyPick();return;} if(d.pickFam!==undefined){pickOf().fam=d.pickFam;applyPick();return;} if(d.agent){const on=r().agents.includes(d.agent);r().agents=on?r().agents.filter(id=>id!==d.agent):[...r().agents,d.agent];renderForm();refreshPlan();return;} - // Settings opens as its popup over the builder; closed, the builder opens again to read what changed, from its - // draft (saved on every render), so without the query that would replace the recipe and step with a fresh one - else if(d.href){if(window.nulliusOpenSettings?.(d.href,b)){saveDraft();document.getElementById('settings-modal').addEventListener('close',()=>location.replace(location.pathname),{once:true});}else location.href=d.href;return;} + // Settings opens as its popup over the builder (its close reloads the builder: below) + else if(d.href){if(!window.nulliusOpenSettings?.(d.href,b))location.href=d.href;return;} else if(b.id==='nb-add-custom-agent'){r().customAgents.push('');r().agents.push('custom-'+(r().customAgents.length-1));renderForm();refreshPlan();root.querySelector('[data-custom-agent="'+(r().customAgents.length-1)+'"]')?.focus();return;} else if(d.removeCustomAgent!==undefined){const i=Number(d.removeCustomAgent),rec=r(),kept=rec.agents.filter(id=>id.startsWith('custom-')&&id!=='custom-'+i).map(id=>Number(id.slice(7)));rec.customAgents.splice(i,1);rec.agents=rec.agents.filter(id=>!id.startsWith('custom-')).concat(kept.map(k=>'custom-'+(k>i?k-1:k)));renderForm();refreshPlan();return;} // The Harbor panel (Runner step): a release or a repository, a ref of it, installed and asked for its agents. diff --git a/app/ui_tests/test_builder_where.py b/app/ui_tests/test_builder_where.py index 8567892f..3ce3a10b 100644 --- a/app/ui_tests/test_builder_where.py +++ b/app/ui_tests/test_builder_where.py @@ -39,7 +39,7 @@ def test_hosts_or_sandboxes_never_both_and_a_sandbox_is_its_own_isolation(self): self.assertIn('aria-pressed="true"', card(html, "boat")) self.assertIn('aria-pressed="false"', card(html, "hosts")) self.assertIn(">Sandboxes", html) - self.assertIn("2 at once on this account", html) # the account's VMs at once, from its API + self.assertNotIn("at once", html) # the account's VMs at once: Limits' concurrency says it self.assertNotIn("data-std-where", html) # no host to add to a sandbox run self.assertNotIn("data-std-backend", html) # nothing to choose: the VM is the sandbox self.assertNotIn("not sandboxed", html.lower()) @@ -58,11 +58,10 @@ def test_hosts_or_sandboxes_never_both_and_a_sandbox_is_its_own_isolation(self): self.assertIn('src="/static/brand/boat.svg"', ordinary) # Boat's mark, one per theme self.assertIn('src="/static/brand/boat-dark.svg"', ordinary) self.assertNotIn("shards, merged", ordinary) - self.assertNotIn("at once", self.draw(None, backends=("boat",), slots=None)["gsm8k boat"]) # the API said nothing: no number gone = self.draw(None, backends=("boat",), boat="no Boat API key: set it in Settings → Sandbox")["gsm8k boat"] self.assertNotIn("disabled", card(gone, "boat")) # no key: still chosen, and its card links to Settings self.assertNotIn("data-std-boat-size", gone) - self.assertIn('class="nb-inlinebutton std-boat-key" data-href="/settings#sandbox-boat-key">Add a Boat API key in Settings', gone) + self.assertIn('class="nb-inlinebutton std-boat-key" data-href="/settings#sandbox-boat-key">Add API Key', gone) missing = self.draw(None, "schema.standardHere.boatKey=true;", backends=("boat",), boat="missing on this machine: ssh")["gsm8k boat"] self.assertIn('missing on this machine: ssh', missing) # not a key: nothing in Settings fixes it self.assertNotIn("std-boat-key", missing) From 70829e6c6b59d22e641e577a73d940526420b0ba Mon Sep 17 00:00:00 2001 From: Etienne Filhol Date: Fri, 20 Nov 2026 10:39:08 +0100 Subject: [PATCH 6/8] fix(builder): give the Where step's machines more room below the Hosts and Sandboxes switch --- app/static/builder/command-builder.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/static/builder/command-builder.css b/app/static/builder/command-builder.css index e3532717..d1a92921 100644 --- a/app/static/builder/command-builder.css +++ b/app/static/builder/command-builder.css @@ -281,14 +281,14 @@ #nullius-builder .std-machines button[aria-pressed=true] { background: var(--nb-tint); } #nullius-builder .std-machines button:focus-visible { outline: 2px solid var(--nb-blue); outline-offset: 2px; } #nullius-builder .std-machines button:disabled { opacity: .45; cursor: not-allowed; } -#nullius-builder .std-boat-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: fit-content; max-width: 100%; min-width: 190px; margin-top: 12px; padding: 12px 14px; border: 1px solid var(--nb-blue); border-radius: 10px; background: var(--nb-tint); } +#nullius-builder .std-boat-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: fit-content; max-width: 100%; min-width: 190px; margin-top: 20px; padding: 12px 14px; border: 1px solid var(--nb-blue); border-radius: 10px; background: var(--nb-tint); } #nullius-builder .std-boat-card strong { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; } #nullius-builder .std-boat-logo { width: 20px; height: 20px; flex: none; } #nullius-builder .std-boat-card > span { font-size: 13px; color: var(--nb-muted); } #nullius-builder .std-boat-card.off { border-color: var(--nb-line); background: transparent; cursor: not-allowed; } /* cannot run here: not chosen, only its link works */ #nullius-builder .std-boat-card.off > :not(.std-boat-key) { opacity: .5; } #nullius-builder .std-boat-card.off .std-boat-key { cursor: pointer; } -#nullius-builder .std-hosts { margin-top: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 240px)); } +#nullius-builder .std-hosts { margin-top: 20px; grid-template-columns: repeat(auto-fill, minmax(190px, 240px)); } #nullius-builder .std-isolation { padding: 12px 14px; border: 1px solid var(--nb-line); border-radius: 10px; background: var(--nb-soft); } #nullius-builder .std-isolation small { display: block; margin-top: 4px; font-size: 13px; color: var(--nb-muted); } #nullius-builder .std-isolation small:empty { display: none; } From d22bd48bbd26bc04b23e4215aca3e83a8ea52ce2 Mon Sep 17 00:00:00 2001 From: Etienne Filhol Date: Fri, 20 Nov 2026 10:53:36 +0100 Subject: [PATCH 7/8] fix(settings): drop the Engine card from Sandbox: this machine's Docker or Podman is under Hosts --- AGENTS.md | 2 +- app/nullius/sandbox.py | 18 ++---------------- app/static/settings/sandbox.js | 7 ++----- app/templates/settings/settings.html | 7 ++----- app/tests/test_sandbox.py | 5 ----- app/ui_tests/test_settings_page.py | 9 ++++----- app/web/settings.py | 5 ++--- docs/settings/sandbox.md | 6 ++---- 8 files changed, 15 insertions(+), 44 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 6ba4ab10..3c241962 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -78,7 +78,7 @@ and its resources. The source layout stays under `app/`. `cli` and `__main__` (the unified `nullius` and `python -m nullius` commands), `paths` (user config, data and cache locations), `prices` (the user's model price list: fetched on request and before a capped run; what a cost is estimated from), `migrate` (explicit copying of legacy checkout storage), `settings`, `hosts`, `constraints` (what Nullius may use on each machine: one table, the container and systemd scope probes, the warnings), `execution`, `progress` (what a run is doing, one line per stage), `prerequisites` (what a recipe needs of each machine it runs on, asked before Run and again as it starts), `onboarding` (the Getting started checklist: what this machine says is done, and where each step is done), `gitrefs` (a repository's branches and tags, - by `git ls-remote`), `secrets` (a benchmark's licences, kept per benchmark outside the repository, and the Hugging Face token of Data providers), `sandbox` (Docker's state, and the Docker Hub login Data providers uses), `charts` (categorical charts, bars, dots and a scatter, and their style registry: Compare's Chart view) and `redact` at the top. + by `git ls-remote`), `secrets` (a benchmark's licences, kept per benchmark outside the repository, and the Hugging Face token of Data providers), `sandbox` (the Docker Hub login Data providers uses), `charts` (categorical charts, bars, dots and a scatter, and their style registry: Compare's Chart view) and `redact` at the top. - `app/templates/`, `app/static/` — the interface, grouped by the same capability names (`runs/`, `traces/`, `builder/`, …; `base.html`, `style.css` and the fonts at the top), including the command builder's JavaScript, which owns the generated recipes. `app/templates/_tables.html` and diff --git a/app/nullius/sandbox.py b/app/nullius/sandbox.py index a491268f..e2de12a5 100644 --- a/app/nullius/sandbox.py +++ b/app/nullius/sandbox.py @@ -1,10 +1,6 @@ -"""The Settings page's Sandbox: the container backend's engine on this machine, -docker or podman (``container.DOCKER``), and its Docker Hub login under Data -providers. +"""The container engine's Docker Hub login, under Data providers: docker or +podman (``container.DOCKER``). -Two things, each something a user acts on: - -- **Engine**: whether it answers, and its name and version (``container.unusable``). - **Registry login**: Docker Hub limits anonymous pulls, which stops a benchmark with an image per unit part-way. The username and an access token go to ``docker login --password-stdin`` (``podman login ... docker.io``) @@ -30,16 +26,6 @@ _TOKEN_MAX = 4096 -def docker_state() -> dict: - """{ok, version} when the engine answers - its name and version, ``podman - 6.1.4`` - else {ok: False, error}.""" - why = container.unusable() - if why: - return {"ok": False, "error": why} - r = container._docker(["version", "--format", "{{.Server.Version}}"], timeout=30, check=False) - return {"ok": True, "version": f"{container.DOCKER} {r.stdout.strip()}"} - - def _config_dir() -> str: return os.environ.get("DOCKER_CONFIG") or os.path.join(os.path.expanduser("~"), ".docker") diff --git a/app/static/settings/sandbox.js b/app/static/settings/sandbox.js index 47099624..1290e329 100644 --- a/app/static/settings/sandbox.js +++ b/app/static/settings/sandbox.js @@ -1,4 +1,4 @@ -// The Sandbox section: docker's state and whether a Boat key is saved, asked once when the section is first shown. +// The Sandbox section: whether a Boat key is saved, asked once when the section is first shown. (() => { const section = document.getElementById('sandbox'); if (!section) return; @@ -26,10 +26,7 @@ const load = async () => { asked = true; let j; - try { j = await (await nulliusFetch(section.dataset.sandbox)).json(); } catch (err) { j = {docker: {ok: false, error: String(err)}, boat: {set: false, env: false}}; } - const docker = $('[data-docker-state]'); - docker.textContent = j.docker.ok ? '✓ ' + j.docker.version : '✕ ' + j.docker.error; - docker.className = 'st-row-value ' + (j.docker.ok ? 'ok' : 'bad'); + try { j = await (await nulliusFetch(section.dataset.sandbox)).json(); } catch (err) { j = {boat: {set: false, env: false}}; } boat = j.boat || {set: false, env: false}; render(); }; diff --git a/app/templates/settings/settings.html b/app/templates/settings/settings.html index 36eca7e0..9378286c 100644 --- a/app/templates/settings/settings.html +++ b/app/templates/settings/settings.html @@ -86,7 +86,7 @@
Execution
{{ section_link('hosts', 'Hosts', 'server', 'ssh remote machines server hosts') }} - {{ section_link('sandbox', 'Sandbox', 'kit', 'docker container boat vm') }} + {{ section_link('sandbox', 'Sandbox', 'kit', 'boat vm') }}
Application
@@ -391,12 +391,9 @@

Judges

{% endfor %}{% endfor %}
{% endif %} {% include 'settings/data_providers.html' %} - {# the container backend's engine on this machine, outside the form: asked when the section opens (sandbox.js) #} + {# its providers' keys, outside the form: asked when the section opens (sandbox.js) #}

Sandbox

Where agents run, apart from this machine.

-
-
EngineChecking…
-

Boat

Checking…

{% if writable %}{% endif %}
{% if writable %} diff --git a/app/tests/test_sandbox.py b/app/tests/test_sandbox.py index 1baa8207..de4771c8 100644 --- a/app/tests/test_sandbox.py +++ b/app/tests/test_sandbox.py @@ -52,11 +52,6 @@ def test_podman_logs_in_to_docker_hub_by_name_and_says_who(self): with mock.patch.object(container, "_docker", side_effect=container.Unavailable("podman is not installed on this machine")): self.assertIsNone(sandbox.login_user()) # the page still answers - def test_the_engine_is_named_with_its_version(self): - with mock.patch.object(container, "DOCKER", "podman"), mock.patch.object(container, "unusable", return_value=None), \ - mock.patch.object(container, "_docker", return_value=done(out="6.1.4\n")): - self.assertEqual(sandbox.docker_state(), {"ok": True, "version": "podman 6.1.4"}) - def test_a_bad_username_or_empty_token_asks_docker_nothing(self): with mock.patch.object(container, "_docker", lambda *a, **kw: self.fail("docker asked")): self.assertFalse(sandbox.login("", "t")["ok"]) diff --git a/app/ui_tests/test_settings_page.py b/app/ui_tests/test_settings_page.py index 135ae26e..f3e5eac4 100644 --- a/app/ui_tests/test_settings_page.py +++ b/app/ui_tests/test_settings_page.py @@ -1108,10 +1108,10 @@ def test_the_sandbox_is_asked_when_shown_and_a_login_goes_to_docker_only(self): self.assertIn('

Docker Hub

', providers) self.assertIn('

Hugging Face

', providers) self.assertIn('name="token" type="password"', providers) - with patch.object(sandbox, "docker_state", lambda: {"ok": True, "version": "29.0"}), \ - patch.object(sandbox, "login_user", lambda: self.fail("asked")): + self.assertNotIn("data-docker-state", section) # this machine's engine: under Hosts + with patch.object(sandbox, "login_user", lambda: self.fail("asked")): r = self.client.get("/settings/sandbox"); self.addCleanup(r.close) - self.assertEqual(r.json, {"docker": {"ok": True, "version": "29.0"}, "boat": {"set": False, "env": False}}) + self.assertEqual(r.json, {"boat": {"set": False, "env": False}}) seen = [] headers = {"Origin": "http://localhost", "X-CSRF-Token": self.token()} with patch.object(sandbox, "login", lambda u, t: seen.append((u, t)) or {"ok": True, "user": u}): @@ -1140,8 +1140,7 @@ def test_the_boat_key_is_saved_from_this_machines_browser_and_never_echoed(self) self.assertNotIn("boat_synthetic", response.get_data(as_text=True)) self.assertEqual(secrets.value(boat.STORE, boat.NAME), b"boat_synthetic") self.assertEqual(boat.key({}), "boat_synthetic") - with patch.object(sandbox, "docker_state", lambda: {"ok": True, "version": "29.0"}): - state = self.client.get("/settings/sandbox").json + state = self.client.get("/settings/sandbox").json self.assertEqual(state["boat"], {"set": True, "env": False}) self.assertNotIn("boat_synthetic", json.dumps(state)) self.assertIsNone(self.file()) diff --git a/app/web/settings.py b/app/web/settings.py index b74eb2ba..7df0ebb2 100644 --- a/app/web/settings.py +++ b/app/web/settings.py @@ -249,9 +249,8 @@ def settings_host_enrol(): @app.route("/settings/sandbox") def settings_sandbox(): - """The Sandbox section's state, asked when the section opens: docker's, and whether a boat key is - set (never the key).""" - return jsonify(docker=sandbox.docker_state(), boat={"set": bool(secrets.status(boat.STORE).get(boat.NAME, {}).get("set")), + """The Sandbox section's state, asked when the section opens: whether a boat key is set (never the key).""" + return jsonify(boat={"set": bool(secrets.status(boat.STORE).get(boat.NAME, {}).get("set")), "env": bool(os.environ.get(boat.NAME))}) diff --git a/docs/settings/sandbox.md b/docs/settings/sandbox.md index fd375adf..0e40e437 100644 --- a/docs/settings/sandbox.md +++ b/docs/settings/sandbox.md @@ -1,13 +1,11 @@ # Sandbox -Where agents run apart from this machine: Docker or Podman here, and Boat VMs. Under **Execution**. +Where agents run apart from this machine: Boat VMs. Under **Execution**. This machine's Docker or Podman is under [Hosts](run-hosts.md). | Card | Does | | --- | --- | -| Engine | Docker or Podman: whether it answers, its name and version; why not when it does not | | Boat | The [Boat backend](../standard.md#the-boat-backend)'s API key, never shown again. `BOAT_API_KEY` wins | | Rule | | | --- | --- | -| Hosts | This machine only; a host keeps its own login and images | -| Code | `app/nullius/sandbox.py`, `app/nullius/standard/boat.py` | +| Code | `app/nullius/standard/boat.py` | From 7ae990cfefcd967ea15a3018713e12ebb8d77242 Mon Sep 17 00:00:00 2001 From: Etienne Filhol Date: Fri, 20 Nov 2026 11:42:13 +0100 Subject: [PATCH 8/8] chore(builder): trim the comments this change added, and the Sandbox page's pointer to Hosts --- app/nullius/standard/recipe.py | 4 +--- app/static/builder/command-builder.css | 2 +- app/static/builder/command-builder.js | 5 +---- app/static/settings/modal.js | 2 -- app/static/settings/sandbox.js | 1 - app/templates/settings/settings.html | 1 - app/tests/test_standard_boat.py | 1 - app/ui_tests/test_builder_where.py | 10 +++++----- app/ui_tests/test_settings_page.py | 2 +- docs/settings/sandbox.md | 2 +- 10 files changed, 10 insertions(+), 20 deletions(-) diff --git a/app/nullius/standard/recipe.py b/app/nullius/standard/recipe.py index 6288a4ab..08abc363 100644 --- a/app/nullius/standard/recipe.py +++ b/app/nullius/standard/recipe.py @@ -337,9 +337,7 @@ def compile(recipe: dict, defs: Optional[Dict[str, List[dict]]] = None, *, the run sends it as.""" d = defs or _all() errors, notes = [], [] - # each problem once: several picks of one kind (a benchmark's own agents) can each find it. shown: the step - # already says it where it is fixed (Where's Boat card links a missing key to Settings), so its own error line - # leaves it out and only Review lists it + # each problem once; shown: the step already says it elsewhere, so only Review lists it def add(step, message, shown=False): if not any(e["step"] == STEP[step] and e["message"] == message for e in errors): errors.append({"step": STEP[step], "message": message, **({"shown": True} if shown else {})}) diff --git a/app/static/builder/command-builder.css b/app/static/builder/command-builder.css index d1a92921..1f779e19 100644 --- a/app/static/builder/command-builder.css +++ b/app/static/builder/command-builder.css @@ -285,7 +285,7 @@ #nullius-builder .std-boat-card strong { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; } #nullius-builder .std-boat-logo { width: 20px; height: 20px; flex: none; } #nullius-builder .std-boat-card > span { font-size: 13px; color: var(--nb-muted); } -#nullius-builder .std-boat-card.off { border-color: var(--nb-line); background: transparent; cursor: not-allowed; } /* cannot run here: not chosen, only its link works */ +#nullius-builder .std-boat-card.off { border-color: var(--nb-line); background: transparent; cursor: not-allowed; } #nullius-builder .std-boat-card.off > :not(.std-boat-key) { opacity: .5; } #nullius-builder .std-boat-card.off .std-boat-key { cursor: pointer; } #nullius-builder .std-hosts { margin-top: 20px; grid-template-columns: repeat(auto-fill, minmax(190px, 240px)); } diff --git a/app/static/builder/command-builder.js b/app/static/builder/command-builder.js index fa3ce1b2..96943faf 100644 --- a/app/static/builder/command-builder.js +++ b/app/static/builder/command-builder.js @@ -117,9 +117,7 @@ // An unsupported draft opens nothing; its rejection is shown as a toast. else { let d = null; try { d = C.unpackDraft(localStorage.getItem(draftKey), query); } catch {} if (d && d.recipe) { recipe = d.recipe; step = d.step; tab = d.tab; savedId = d.saved; } else if (d && d.gone) opened = d.gone; } const saveDraft = () => { try { localStorage.setItem(draftKey, C.packDraft({recipe, step, tab, saved: savedId})); } catch {} }; - // Settings closed, however it was opened (a builder link, the rail): the builder opens again to read what changed - // (a key added or removed), from its draft, so without the query that would replace the recipe and step with a fresh one - // (the popup comes after this script in the page, and its close does not bubble: caught on the way down) + // Settings closed: reload from the draft to read what changed document.addEventListener('close', e => { if (e.target.id === 'settings-modal') { saveDraft(); location.replace(location.pathname); } }, true); let compiled, pendingDirs, dirsSequence = 0; const r = () => recipe; @@ -1099,7 +1097,6 @@ if(d.pickFam!==undefined){pickOf().fam=d.pickFam;applyPick();return;} if(d.pickElsewhere!==undefined){pickOf().hide=!pickOf().hide;applyPick();return;} if(d.agent){const on=r().agents.includes(d.agent);r().agents=on?r().agents.filter(id=>id!==d.agent):[...r().agents,d.agent];renderForm();refreshPlan();return;} - // Settings opens as its popup over the builder (its close reloads the builder: below) else if(d.href){if(!window.nulliusOpenSettings?.(d.href,b))location.href=d.href;return;} else if(b.id==='nb-add-custom-agent'){r().customAgents.push('');r().agents.push('custom-'+(r().customAgents.length-1));renderForm();refreshPlan();root.querySelector('[data-custom-agent="'+(r().customAgents.length-1)+'"]')?.focus();return;} else if(d.removeCustomAgent!==undefined){const i=Number(d.removeCustomAgent),rec=r(),kept=rec.agents.filter(id=>id.startsWith('custom-')&&id!=='custom-'+i).map(id=>Number(id.slice(7)));rec.customAgents.splice(i,1);rec.agents=rec.agents.filter(id=>!id.startsWith('custom-')).concat(kept.map(k=>'custom-'+(k>i?k-1:k)));renderForm();refreshPlan();return;} diff --git a/app/static/settings/modal.js b/app/static/settings/modal.js index b9896c72..936c0189 100644 --- a/app/static/settings/modal.js +++ b/app/static/settings/modal.js @@ -72,8 +72,6 @@ proxy.remove(); }); }); - // Settings opens here from any page but its own: a link to /settings, or a script with nulliusOpenSettings(href, opener) - // (the builder's Settings buttons); false when it does not, so the caller navigates instead. function open(href, from) { const url = new URL(href, location.href); if (url.origin !== location.origin || url.pathname !== '/settings' || location.pathname === '/settings') return false; diff --git a/app/static/settings/sandbox.js b/app/static/settings/sandbox.js index 1290e329..d656bcb9 100644 --- a/app/static/settings/sandbox.js +++ b/app/static/settings/sandbox.js @@ -52,7 +52,6 @@ }; const open = () => { editing = true; render(); form.querySelector('input').focus(); }; if (edit) edit.addEventListener('click', open); - // #sandbox-boat-key (the builder's link when Boat has no key) opens the key's form, as a provider's field does const fromHash = () => { if (form && location.hash === '#sandbox-boat-key') open(); }; window.addEventListener('hashchange', fromHash); if (cancel) cancel.addEventListener('click', () => { form.reset(); editing = false; render(); edit.focus(); }); diff --git a/app/templates/settings/settings.html b/app/templates/settings/settings.html index 9378286c..b83f2ca7 100644 --- a/app/templates/settings/settings.html +++ b/app/templates/settings/settings.html @@ -391,7 +391,6 @@

Judges

{% endfor %}{% endfor %}
{% endif %} {% include 'settings/data_providers.html' %} - {# its providers' keys, outside the form: asked when the section opens (sandbox.js) #}

Sandbox

Where agents run, apart from this machine.

diff --git a/app/tests/test_standard_boat.py b/app/tests/test_standard_boat.py index 6e26fc85..cf106a93 100644 --- a/app/tests/test_standard_boat.py +++ b/app/tests/test_standard_boat.py @@ -602,7 +602,6 @@ def test_without_its_key_the_where_step_says_so(self): out = recipe.compile(a_recipe(backend="boat"), defs(), boat_unusable=lambda here=True: "no Boat API key: set it in Settings → Sandbox") self.assertEqual([e["step"] for e in out["errors"]], [recipe.STEP["where"]]) self.assertIn("Settings → Sandbox", out["errors"][0]["message"]) - # the Where step's Boat card links to Settings, so its own error line leaves the key out; Review lists it for saved, shown in ((None, True), ("k", False)): with mock.patch.object(boat, "key", return_value=saved): out = recipe.compile(a_recipe(backend="boat"), defs(), boat_unusable=lambda here=True: "missing") diff --git a/app/ui_tests/test_builder_where.py b/app/ui_tests/test_builder_where.py index 9eda38ba..de9f575c 100644 --- a/app/ui_tests/test_builder_where.py +++ b/app/ui_tests/test_builder_where.py @@ -39,7 +39,7 @@ def test_hosts_or_sandboxes_never_both_and_a_sandbox_is_its_own_isolation(self): self.assertIn('aria-pressed="true"', card(html, "boat")) self.assertIn('aria-pressed="false"', card(html, "hosts")) self.assertIn(">Sandboxes", html) - self.assertNotIn("at once", html) # the account's VMs at once: Limits' concurrency says it + self.assertNotIn("at once", html) self.assertNotIn("data-std-where", html) # no host to add to a sandbox run self.assertNotIn("data-std-backend", html) # nothing to choose: the VM is the sandbox self.assertNotIn("not sandboxed", html.lower()) @@ -54,16 +54,16 @@ def test_hosts_or_sandboxes_never_both_and_a_sandbox_is_its_own_isolation(self): self.assertIn("The agent alone in each problem's VM", ordinary) self.assertIn("Answers and keys stay on this machine", ordinary) self.assertIn('class="std-boat-card"', ordinary) - self.assertIn('class="std-boat-card off"', self.draw(None, backends=("boat",), boat="no Boat API key")["gsm8k boat"]) # cannot run: drawn as not chosen - self.assertIn('src="/static/brand/boat.svg"', ordinary) # Boat's mark, one per theme + self.assertIn('class="std-boat-card off"', self.draw(None, backends=("boat",), boat="no Boat API key")["gsm8k boat"]) + self.assertIn('src="/static/brand/boat.svg"', ordinary) self.assertIn('src="/static/brand/boat-dark.svg"', ordinary) self.assertNotIn("shards, merged", ordinary) gone = self.draw(None, backends=("boat",), boat="no Boat API key: set it in Settings → Sandbox")["gsm8k boat"] - self.assertNotIn("disabled", card(gone, "boat")) # no key: still chosen, and its card links to Settings + self.assertNotIn("disabled", card(gone, "boat")) self.assertNotIn("data-std-boat-size", gone) self.assertIn('class="nb-inlinebutton std-boat-key" data-href="/settings#sandbox-boat-key">Add API Key', gone) missing = self.draw(None, "schema.standardHere.boatKey=true;", backends=("boat",), boat="missing on this machine: ssh")["gsm8k boat"] - self.assertIn('missing on this machine: ssh', missing) # not a key: nothing in Settings fixes it + self.assertIn('missing on this machine: ssh', missing) self.assertNotIn("std-boat-key", missing) self.assertIn('disabled aria-disabled="true" title="missing on this machine: ssh"', card(missing, "boat")) diff --git a/app/ui_tests/test_settings_page.py b/app/ui_tests/test_settings_page.py index f3e5eac4..e2bb92db 100644 --- a/app/ui_tests/test_settings_page.py +++ b/app/ui_tests/test_settings_page.py @@ -1108,7 +1108,7 @@ def test_the_sandbox_is_asked_when_shown_and_a_login_goes_to_docker_only(self): self.assertIn('

Docker Hub

', providers) self.assertIn('

Hugging Face

', providers) self.assertIn('name="token" type="password"', providers) - self.assertNotIn("data-docker-state", section) # this machine's engine: under Hosts + self.assertNotIn("data-docker-state", section) with patch.object(sandbox, "login_user", lambda: self.fail("asked")): r = self.client.get("/settings/sandbox"); self.addCleanup(r.close) self.assertEqual(r.json, {"boat": {"set": False, "env": False}}) diff --git a/docs/settings/sandbox.md b/docs/settings/sandbox.md index 0e40e437..5c58244a 100644 --- a/docs/settings/sandbox.md +++ b/docs/settings/sandbox.md @@ -1,6 +1,6 @@ # Sandbox -Where agents run apart from this machine: Boat VMs. Under **Execution**. This machine's Docker or Podman is under [Hosts](run-hosts.md). +Where agents run apart from this machine: Boat VMs. Under **Execution**. | Card | Does | | --- | --- |