From 456440eabd1f1d8a9929437a2164eca41e17d14d Mon Sep 17 00:00:00 2001 From: Harenome Ranaivoarivony-Razanajato Date: Fri, 20 Nov 2026 16:03:17 +0100 Subject: [PATCH 1/6] refactor(web): move the icon sprite into its own template, grouped by use base.html includes app/templates/_icons.svg, one symbol per line in commented groups. The rendered pages are unchanged apart from the order and whitespace inside . The wheel ships the new template. --- app/templates/_icons.svg | 76 ++++++++++++++++++++++++++++++++++++++++ app/templates/base.html | 70 +----------------------------------- pyproject.toml | 2 +- 3 files changed, 78 insertions(+), 70 deletions(-) create mode 100644 app/templates/_icons.svg diff --git a/app/templates/_icons.svg b/app/templates/_icons.svg new file mode 100644 index 00000000..4f4fd743 --- /dev/null +++ b/app/templates/_icons.svg @@ -0,0 +1,76 @@ +{#- The interface's icons, included by base.html: one symbol each, referenced by . + Hand-drawn on a 24-grid, stroke only, so they take the item's colour and weight (`.ic` in style.css). #} + diff --git a/app/templates/base.html b/app/templates/base.html index 77df93e9..aaa24685 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -37,75 +37,7 @@ -{# ---- icons: one symbol each, referenced by . Hand-drawn on a 24-grid, - stroke only, so they take the item's colour and weight. ---- #} - +{% include "_icons.svg" %}
{% set ep = request.endpoint or '' %} diff --git a/pyproject.toml b/pyproject.toml index 712019be..dd09b371 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,4 +56,4 @@ dependencies = {file = ["app/requirements.txt"]} "nullius.catalogue" = ["agents/*/*.json", "agents/*/*.py", "agents/*/*.toml", "agents/*/*.yaml", "benchmarks/*/env/*", "benchmarks/*/*.json", "benchmarks/*/*.py", "benchmarks/*/*.yml", "benchmarks/*/startup/*.py", "capabilities/*/*.json", "capabilities/*/*.py"] "nullius.standard" = ["kits/*/*.json", "kits/*/*.py", "kits/*/*.Dockerfile", "kits/*/*.txt"] "nullius.judge" = ["floors.json"] -_nullius_app = ["templates/**/*.html", "static/**/*.css", "static/**/*.js", "static/**/*.svg", "static/**/*.png", "static/**/*.json", "static/**/*.woff2", "static/**/*.ttf", "static/**/*.txt", "static/**/*.md", "requirements.txt", ".env.example"] +_nullius_app = ["templates/**/*.html", "templates/*.svg", "static/**/*.css", "static/**/*.js", "static/**/*.svg", "static/**/*.png", "static/**/*.json", "static/**/*.woff2", "static/**/*.ttf", "static/**/*.txt", "static/**/*.md", "requirements.txt", ".env.example"] From 4cc0cdb8d797ff9e3e38a38e91e558ab98f3692b Mon Sep 17 00:00:00 2001 From: Harenome Ranaivoarivony-Razanajato Date: Fri, 20 Nov 2026 16:03:48 +0100 Subject: [PATCH 2/6] refactor(web): redraw the wrench icon on the sprite's 24 grid It had a 16 grid and its own stroke width and joins. It now takes the stroke from .ic like every other symbol. --- app/templates/_icons.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/templates/_icons.svg b/app/templates/_icons.svg index 4f4fd743..ad13b0c7 100644 --- a/app/templates/_icons.svg +++ b/app/templates/_icons.svg @@ -41,7 +41,7 @@ - + {#- Run states and notices #} From 18e0f1e7d86de35789bb4133c792fe9c3439594f Mon Sep 17 00:00:00 2001 From: Harenome Ranaivoarivony-Razanajato Date: Fri, 20 Nov 2026 16:04:25 +0100 Subject: [PATCH 3/6] refactor(web): draw the dialog close, custom key and retry marks from the sprite The two dialog close buttons use i-x, the custom keys card i-key and the retried attempt mark i-refresh, instead of inline SVGs drawn on their own grids. The retry mark keeps its stroke weight at 12px. --- app/static/builder/recipes.js | 2 +- app/static/catalogue/catalogue.css | 1 - app/static/style.css | 2 +- app/templates/catalogue/add_dialog.html | 2 +- app/templates/settings/custom_keys.html | 2 +- app/templates/traces/_attempts.html | 2 +- 6 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/static/builder/recipes.js b/app/static/builder/recipes.js index 500101db..08f3eeb2 100644 --- a/app/static/builder/recipes.js +++ b/app/static/builder/recipes.js @@ -54,7 +54,7 @@ const r = dialog.getBoundingClientRect(); if (e.target === dialog && (e.clientX < r.left || e.clientX > r.right || e.clientY < r.top || e.clientY > r.bottom)) dialog.close(); }); - const head = (t, x) => `

${esc(t)}

${x ? '' : ''}
`; + const head = (t, x) => `

${esc(t)}

${x ? '' : ''}
`; function details(item) { const d = info[item.id], shown = STEPS.map(k => C.STEP[k]); const warn = d.problems.length ? `
    ${d.problems.map(([s, m]) => `
  • ${esc(C.STEPS[s])} ${esc(m)}
  • `).join('')}
` : ''; diff --git a/app/static/catalogue/catalogue.css b/app/static/catalogue/catalogue.css index 4793c013..d64a1009 100644 --- a/app/static/catalogue/catalogue.css +++ b/app/static/catalogue/catalogue.css @@ -344,7 +344,6 @@ dialog.std-how::backdrop { background: rgba(0, 0, 0, .45); } .std-how-x { flex: none; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: transparent; color: var(--text-dim); cursor: pointer; } .std-how-x:hover { color: var(--text); border-color: var(--text-dim); } .std-how-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; } -.std-how-x svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; } /* The Add a benchmark dialog, by hand: the three routes, each its bubble, what it is and where to start. */ .std-routes { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; } .std-routes li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: start; padding: 14px; border: 1px solid var(--border-soft); border-radius: 10px; } diff --git a/app/static/style.css b/app/static/style.css index 7bf7d7bf..eaaded6b 100644 --- a/app/static/style.css +++ b/app/static/style.css @@ -1068,7 +1068,7 @@ tr.control-row td { color: var(--text-dim); } .attempt-tab:hover { color: var(--text); border-color: var(--text-faint); } .attempt-tab[aria-current] { color: var(--text); background: var(--accent-soft); border-color: var(--accent); font-weight: 600; } .attempt-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; } -.attempt-retried { width: 12px; height: 12px; margin-left: -.15rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; } +.attempt-retried { width: 12px; height: 12px; margin-left: -.15rem; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; } /* an attempt's tries, when its runner kept the ones before its last: tabs of their own under the attempt's, underlined, the last the one that counts */ .try-tabs { display: flex; flex-wrap: wrap; gap: 0 1.2rem; width: fit-content; max-width: 100%; margin-top: .6rem; padding-right: .4rem; border-bottom: 1px solid var(--border); } diff --git a/app/templates/catalogue/add_dialog.html b/app/templates/catalogue/add_dialog.html index 5ff1f21b..e7f59911 100644 --- a/app/templates/catalogue/add_dialog.html +++ b/app/templates/catalogue/add_dialog.html @@ -3,7 +3,7 @@ hand: what the caller puts in. docs/standard.md, "Import by hand" and "With an assistant". -#} {% macro add_dialog(a, prompts, kind) -%} -

Add to catalogue

+

Add to catalogue

diff --git a/app/templates/settings/custom_keys.html b/app/templates/settings/custom_keys.html index da5e6095..849b0e23 100644 --- a/app/templates/settings/custom_keys.html +++ b/app/templates/settings/custom_keys.html @@ -1,6 +1,6 @@ {% macro key_summary(name, state, editor) %}
- +

{{ name }}

{{ {'saved': 'Saved', 'missing': 'Not set', 'expired': 'Expired'}[state] }} diff --git a/app/templates/traces/_attempts.html b/app/templates/traces/_attempts.html index a35aaee6..cd804eae 100644 --- a/app/templates/traces/_attempts.html +++ b/app/templates/traces/_attempts.html @@ -10,7 +10,7 @@ {{ ('Attempt ' if attempts.n <= 4 else '') ~ loop.index }} - {%- if a.n_retries %}{% endif %} + {%- if a.n_retries %}{% endif %} {%- endfor %} All attempts From c1dd91d60de1256c3ace487d1372978ca7f358d8 Mon Sep 17 00:00:00 2001 From: Harenome Ranaivoarivony-Razanajato Date: Fri, 20 Nov 2026 16:04:25 +0100 Subject: [PATCH 4/6] refactor(web): draw the builder's task source tiles from the sprite The folder tile uses i-folder and the generator tile a new i-wand symbol, instead of paths passed inline. --- app/static/builder/command-builder.js | 5 ++--- app/templates/_icons.svg | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/static/builder/command-builder.js b/app/static/builder/command-builder.js index f6110117..f815f023 100644 --- a/app/static/builder/command-builder.js +++ b/app/static/builder/command-builder.js @@ -378,10 +378,9 @@ // Harbor's own mark where Harbor fetches the tasks; a plain icon where no one's mark belongs. Square tiles, so // a mark is never read as a second radio button. const HARBOR_MARK = ''; - const iconTile = d => ``; + const iconTile = name => ``; const SOURCE_MARK = { hub: HARBOR_MARK, registry: HARBOR_MARK, - local: iconTile('M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'), - generate: iconTile('M15 4V2M15 16v-2M8 9h2M20 9h2M17.8 11.8 19 13M15 9h.01M17.8 6.2 19 5M3 21l9-9M12.2 6.2 11 5') }; + local: iconTile('folder'), generate: iconTile('wand') }; const SOURCE_HINT = { hub: 'Harbor fetches the tasks when the run starts.', registry: 'Harbor fetches the tasks when the run starts.', local: 'Task folders already on disk. A run on a host is sent them.', generate: "Built first with the benchmark's own generator, into a folder you name." }; const segmented = (name, label, segments) => `
${segments}
`; diff --git a/app/templates/_icons.svg b/app/templates/_icons.svg index ad13b0c7..adf75c87 100644 --- a/app/templates/_icons.svg +++ b/app/templates/_icons.svg @@ -69,6 +69,7 @@ {#- Where a dataset's tasks come from #} + {#- Themes #} From 54e744b6fd7e50055397aff70819d466822f0582 Mon Sep 17 00:00:00 2001 From: Harenome Ranaivoarivony-Razanajato Date: Fri, 20 Nov 2026 16:06:53 +0100 Subject: [PATCH 5/6] test(web): check that every icon a page names is a symbol of the sprite test_icons.py reads the templates, scripts and Python sources. Literal #i-name references must be symbols. Each place that builds an id from a value is listed with where its values are written, and those values must be quoted names of symbols; an unlisted place or an unresolvable value fails. Symbols must use the 24 grid, carry no stroke or fill of their own and have unique ids. The builder's machine tile now names both icons literally so the test can read them. --- app/static/builder/command-builder.js | 2 +- app/tests/test_icons.py | 95 +++++++++++++++++++++++++++ 2 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 app/tests/test_icons.py diff --git a/app/static/builder/command-builder.js b/app/static/builder/command-builder.js index f815f023..8a69b81f 100644 --- a/app/static/builder/command-builder.js +++ b/app/static/builder/command-builder.js @@ -625,7 +625,7 @@ + (t.meta || t.foot ? `${t.meta ? `${esc(t.meta)}` : ''}${t.foot || ''}` : '') + ''; // a machine to run on: this one or a host, its connection state filled in by Test connection const icon = name => ``; - const machineTile = (attr, v, t, sub, on) => tile({attr, key: v, on, mark: icon(v === 'local' ? 'machine' : 'network'), title: t, tip: sub, + const machineTile = (attr, v, t, sub, on) => tile({attr, key: v, on, mark: v === 'local' ? icon('machine') : icon('network'), title: t, tip: sub, foot: v !== 'local' ? `` : ''}); // The grids drawn by the server and run by the card toolkit (tables.js): the Benchmark step's (/new-run/benchmarks, // one choice) and the standard's Agent step's for its benchmark (/new-run/agents, from the Agents page's entries). diff --git a/app/tests/test_icons.py b/app/tests/test_icons.py new file mode 100644 index 00000000..db47765e --- /dev/null +++ b/app/tests/test_icons.py @@ -0,0 +1,95 @@ +"""Every icon a page names is a symbol of the sprite, app/templates/_icons.svg, drawn the sprite's way.""" +from __future__ import annotations + +import re +import unittest +import xml.etree.ElementTree as ET +from pathlib import Path + +APP = Path(__file__).resolve().parent.parent +SPRITE = APP / "templates" / "_icons.svg" +SOURCES = [p for p in [*(APP / "templates").rglob("*"), *(APP / "static").rglob("*")] + if p.suffix in (".html", ".js", ".css") and p != SPRITE] + [*(APP / "web").glob("*.py"), *(APP / "nullius").rglob("*.py")] +# Symbols drawn their own way, each with its reason. +STYLE_EXCEPTIONS: dict[str, str] = {} + +ICON_KWARG = ("templates/**/*.html", r"\bicon=(?!true\b|false\b)([^,)\s]+)") # card fields, greyed() +# Each place that builds a symbol id from a value: (file, the expression after "#i-") -> where its values are +# written, as (files, pattern, inner pattern). A pattern captures an argument as written; it must be a quoted name. +SINKS = { + ("templates/base.html", "icon"): [("templates/base.html", r"for kind, label, list_ep, entry_ep, icon in \[(.*?)\] %\}", r",\s*([^,()]+)\)")], + ("templates/_cards.html", "f.icon"): [ICON_KWARG], + ("templates/_tables.html", "key"): [("templates/_tables.html", r"for key, name in \((.*?)\) %\}", r"\(([^,()]+),")], + ("templates/_tables.html", "c.filter_icon"): [("templates/**/*.html", r"\bfilter_icon=([^,)\s]+)")], + ("templates/_tables.html", "icon"): [ICON_KWARG], + ("templates/runs/launches.html", "icon[state]"): [("templates/runs/launches.html", r"set icon = \{(.*?)\} %\}", r":\s*([^,}]+)")], + ("templates/settings/settings.html", "icon"): [ + ("templates/settings/settings.html", r"(? str: + return path.read_text(encoding="utf-8") + + +def sprite() -> ET.Element: + return ET.fromstring(re.sub(r"\{#.*?#\}", "", text(SPRITE), flags=re.S)) + + +def symbols() -> list[ET.Element]: + return sprite().findall("./defs/symbol") + + +class Icons(unittest.TestCase): + names = frozenset(s.get("id", "").removeprefix("i-") for s in symbols()) + + def assertKnown(self, name: str, where: str): + self.assertIn(name, self.names, f"{where}: no symbol i-{name} in {SPRITE.name}") + + def test_every_literal_reference_is_a_symbol(self): + for path in SOURCES: + for name in re.findall(r"#i-([a-z0-9]+(?:-[a-z0-9]+)*)", text(path)): + self.assertKnown(name, str(path.relative_to(APP))) + + def test_every_name_passed_as_data_is_a_symbol(self): + seen = set() + for path in SOURCES: + where = path.relative_to(APP).as_posix() + for expr in re.findall(r"#i-(?:\{\{\s*(.*?)\s*\}\}|\$\{(.*?)\}|(['\"`]))", text(path)): + sink = (where, next(e for e in expr if e)) + self.assertIn(sink, SINKS, f"{where}: a symbol id built from {sink[1]!r}: list where its values come from in SINKS") + seen.add(sink) + self.assertEqual(seen, set(SINKS), "a sink in SINKS is no longer in the code") + for sink, sites in SINKS.items(): + for files, pattern, *inner in sites: + written = [arg for path in APP.glob(files) for m in re.finditer(pattern, text(path), re.S) + for arg in (re.findall(inner[0], m.group(1)) if inner else [m.group(1)])] + self.assertTrue(written, f"{sink}: {pattern!r} finds nothing") + for arg in written: + literal = re.fullmatch(r"\s*(['\"])([a-z0-9-]+)\1\s*", arg) + self.assertTrue(literal, f"{sink}: cannot resolve {arg.strip()!r} to an icon name") + self.assertKnown(literal.group(2), f"{sink[0]} via {files}") + for path in [*(APP / "web").glob("*.py"), *(APP / "nullius").rglob("*.py")]: # bare names built in Python + for name in re.findall(r"""['"](?:filter_)?icon['"]\s*:\s*['"]([a-z0-9-]+)['"]|\b(?:filter_)?icon=['"]([a-z0-9-]+)['"]""", text(path)): + self.assertKnown(next(n for n in name if n), str(path.relative_to(APP))) + + def test_symbols_take_their_style_from_the_page(self): + for symbol in symbols(): + name = symbol.get("id") + if name in STYLE_EXCEPTIONS: + continue + self.assertEqual(symbol.get("viewBox"), "0 0 24 24", name) + for part in symbol.iter(): + self.assertFalse({"stroke", "stroke-width", "fill"} & set(part.attrib), f"{name}: {part.attrib}") + + def test_symbol_ids_are_unique(self): + ids = [s.get("id") for s in symbols()] + self.assertEqual(sorted(i for i in set(ids) if ids.count(i) > 1), []) + self.assertTrue(all(i and i.startswith("i-") for i in ids), ids) + + +if __name__ == "__main__": + unittest.main() From afabe644960f588c52ccd3227edbe1e4417dc5c2 Mon Sep 17 00:00:00 2001 From: Harenome Ranaivoarivony-Razanajato Date: Mon, 23 Nov 2026 10:19:22 +0100 Subject: [PATCH 6/6] docs: point the interface rules and the map at the icon sprite --- .claude/rules/ui.md | 4 +++- AGENTS.md | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.claude/rules/ui.md b/.claude/rules/ui.md index b968af0b..403f9450 100644 --- a/.claude/rules/ui.md +++ b/.claude/rules/ui.md @@ -48,6 +48,8 @@ also supports `--only KEY` for a focused benchmark check. `app/static/disclosures.js`; navigation groups use the same animation. Respect reduced motion and keyboard activation. Filter menus and popovers are separate. - **One icon, one meaning.** A new kind of thing gets its own icon, never a - neighbour's. + neighbour's. Icons are symbols of `app/templates/_icons.svg`, drawn on its + 24 grid without their own stroke or fill, and used with + ``. A page draws no icon of its own. - Catalogue Add actions share one dialog with the entry type preselected from the page. Keep generated prompts short and refer to import skills instead of duplicating their instructions. diff --git a/AGENTS.md b/AGENTS.md index addc492a..57779619 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -90,6 +90,7 @@ and its resources. builder's JavaScript, which owns the generated recipes. `app/templates/_tables.html` and `app/static/tables.js` are the table toolkit: one column list builds a table's headers, cells and controls. `app/templates/_cards.html` lays the same field list out as cards, one slot per field. + `app/templates/_icons.svg` is the icon sprite, checked by `app/tests/test_icons.py`. - `app/tests/`, `app/ui_tests/` — the backend suite and the route suite. Beside the backend tests sit scripts run by hand: `app/tests/field_contract.py`, which refreshes the `field_contract.json` the