From 136ba763c3286d2df6898c2c1870804536ee754c Mon Sep 17 00:00:00 2001 From: Etienne Filhol Date: Wed, 25 Nov 2026 17:02:37 +0100 Subject: [PATCH] feat(catalogue): mark each version official or experiment --- .agents/skills/import-benchmark/SKILL.md | 2 +- .agents/skills/import-standard/SKILL.md | 2 +- .../catalogue/agents/digitalmate/agent.json | 1 + app/nullius/catalogue/catalog.py | 21 +++++++---- app/nullius/catalogue/harbor_entry.py | 3 +- app/nullius/standard/cli.py | 14 ++++++-- app/nullius/standard/contract/definitions.py | 35 ++++++++++++++++--- app/nullius/standard/pages/recipe.py | 12 +++++-- app/static/builder/command-builder.js | 2 +- app/static/catalogue/catalogue.css | 8 ++--- app/static/catalogue/new.js | 5 +++ app/static/style.css | 16 +++++---- app/templates/agents/entry.html | 3 +- app/templates/agents/standard.html | 3 +- app/templates/builder/agents.html | 4 +-- app/templates/builder/benchmarks.html | 4 +-- app/templates/catalogue/benchmark.html | 4 +-- app/templates/catalogue/benchmarks.html | 8 ++--- app/templates/catalogue/new.html | 4 +-- app/tests/catalogue_docs.py | 2 +- app/tests/test_catalog.py | 10 +++--- app/tests/test_harbor_entry.py | 6 ++-- app/tests/test_standard_versions.py | 5 +++ app/ui_tests/test_agents.py | 22 ++++++------ app/ui_tests/test_benchmark_new.py | 2 +- app/ui_tests/test_builder_benchmarks.py | 2 +- app/ui_tests/test_catalogue_routes.py | 6 ++-- app/ui_tests/test_routes.py | 2 +- app/web/agents.py | 33 ++++++++++++----- app/web/builder.py | 10 +++--- app/web/catalogue.py | 5 +-- docs/examples/new-benchmark/README.md | 2 +- docs/standard.md | 1 + 33 files changed, 173 insertions(+), 86 deletions(-) diff --git a/.agents/skills/import-benchmark/SKILL.md b/.agents/skills/import-benchmark/SKILL.md index 3677f84e..f46b8856 100644 --- a/.agents/skills/import-benchmark/SKILL.md +++ b/.agents/skills/import-benchmark/SKILL.md @@ -138,7 +138,7 @@ When they do, write it locally: above, named after the key, mirroring an existing Harbor benchmark's: `harness: ["harbor"]`, its `origin` per the docstring of `app/nullius/catalogue/catalog.py` (`official`, the publisher's benchmark, - or `community`, adapted by the community), its `scoring` in two or three words (the + or `experiment`, another source or someone's fixes), its `scoring` in two or three words (the card's tag: `Tests`, `Lean compiler`), and its `datasets` nested in it, one by registry or Hub name (or local path) with its task count, `official` link, and `verifier` - and its `citation` and `citation_source`. The builder takes a benchmark's first dataset as its default: a second diff --git a/.agents/skills/import-standard/SKILL.md b/.agents/skills/import-standard/SKILL.md index 82283c8f..bda6166b 100644 --- a/.agents/skills/import-standard/SKILL.md +++ b/.agents/skills/import-standard/SKILL.md @@ -284,7 +284,7 @@ prints the writable folder under the active user catalogue. Work there, then: commit, any repository (a private one is fetched with this machine's git credentials) - is an Experiment version, never a second folder and never a patch of ours: `cli new version KEY NAME`, then `versions.NAME.upstream` = - `{repository, tag?, tested}` (a branch pinned by its commit). Fetch it into + `{repository, tag?, tested, origin: "experiment"}` (a branch pinned by its commit). Fetch it into the scratchpad, diff it against the pinned upstream (`git diff .. --stat`, then what changed in the code the driver calls) and say what the fork changes; hash each dataset again (its own diff --git a/app/nullius/catalogue/agents/digitalmate/agent.json b/app/nullius/catalogue/agents/digitalmate/agent.json index d5b17c23..01928a1b 100644 --- a/app/nullius/catalogue/agents/digitalmate/agent.json +++ b/app/nullius/catalogue/agents/digitalmate/agent.json @@ -97,6 +97,7 @@ "upstream": { "repository": "https://github.com/aitianshi/DigitalMate", "branch": "nullius/v0.1.13", + "origin": "experiment", "tested": "5a2a3b9fb539978accc4e37fc5e6e81d824c58f7", "license": "Apache-2.0", "core": "Bundled WorkSwarm 0d6857507236d1299276caf0f6fe09e5baaa4c23 and agent-core 8f9f112698d5580b749158b21b1a89a54e16a8f9, verified and installed by the release installer", diff --git a/app/nullius/catalogue/catalog.py b/app/nullius/catalogue/catalog.py index 1222ce61..1da9eede 100644 --- a/app/nullius/catalogue/catalog.py +++ b/app/nullius/catalogue/catalog.py @@ -25,8 +25,9 @@ benchmark headline only; every dataset keeps its own count. Every entry says where it comes from (``origin``): ``official``, the -publisher's own benchmark, or -``community``, adapted by the community. +publisher's own benchmark, or ``experiment``, another source or someone's +fixes. It is the origin of its default version and of every version on the +standard that does not say its own (``definitions.origin_of``). Routes: a benchmark reaches a run through a harness, and ``Benchmark.routes`` says, for each harness in ``HARNESSES``, whether that route is usable here. @@ -44,7 +45,7 @@ from nullius import paths from . import storage -ORIGINS = ("official", "community") +ORIGINS = ("official", "experiment") ROOT = os.path.dirname(os.path.abspath(__file__)) BENCHMARKS = "benchmarks" ENTRY = "benchmark.json" @@ -92,7 +93,7 @@ class Benchmark: #: agent_run, verify) as recorded from a real run; empty when no run has #: recorded them timeouts: dict = field(default_factory=dict) - #: the publisher's benchmark or a community adaptation (ORIGINS) + #: the publisher's benchmark, or an experiment (ORIGINS) origin: str = "official" #: how it runs as published when Harbor runs it: the upstream's own agent, by #: the name Harbor registers it (``agent``), and why it is the published one @@ -354,14 +355,20 @@ def load(root: str | None = None) -> Catalog: ) +def origin_of(entry: dict) -> str: + """An entry's origin as written, its older words (``community``, an ``experiment`` flag) read as ``experiment``.""" + if entry.get("experiment") or entry.get("origin") == "community": + return "experiment" + return entry.get("origin") or "official" + + def _entry(path: str, name: str) -> tuple: """(Benchmark, [Dataset]) of one ``benchmark.json``; ValueError or TypeError when it is not JSON, not an object or lacks a field.""" entry = _read(path) if not isinstance(entry, dict): raise ValueError("not a JSON object") - if entry.get("experiment") or entry.get("origin") == "experiment": - entry = {**entry, "origin": "official"} + entry = {**entry, "origin": origin_of(entry)} nested = [d for d in entry.get("datasets", []) if isinstance(d, dict)] return (_pick(Benchmark, {**entry, "datasets": [d.get("key") for d in nested]}), [_pick(Dataset, {**d, "benchmark": name}) for d in nested]) @@ -426,7 +433,7 @@ def validate(cat: Catalog) -> list: claimed.setdefault(s.strip().lower(), b.key) for b in cat.benchmarks: if b.origin not in ORIGINS: - bad.append(f"{b.key}: origin is official or community") + bad.append(f"{b.key}: origin is official or experiment") if b.task_count is not None: if type(b.task_count) is not int or b.task_count < 1: bad.append(f"{b.key}: task_count must be a positive integer") diff --git a/app/nullius/catalogue/harbor_entry.py b/app/nullius/catalogue/harbor_entry.py index ed3400da..1841eae4 100644 --- a/app/nullius/catalogue/harbor_entry.py +++ b/app/nullius/catalogue/harbor_entry.py @@ -268,8 +268,7 @@ def values_of(entry: dict) -> dict: t = entry.get("timeouts") or {} values = {"key": entry.get("key", ""), "title": entry.get("title", ""), "category": entry.get("category", ""), "domain": entry.get("domain", ""), "scoring": entry.get("scoring", ""), - "origin": "official" if entry.get("experiment") or entry.get("origin") == "experiment" - else entry.get("origin", "official"), "upstream_limitations": "\n".join(entry.get("upstream_limitations") or []), + "origin": catalog.origin_of(entry), "upstream_limitations": "\n".join(entry.get("upstream_limitations") or []), "limitations": "\n".join(entry.get("limitations") or []), "citation": entry.get("citation", ""), "citation_source": entry.get("citation_source", ""), diff --git a/app/nullius/standard/cli.py b/app/nullius/standard/cli.py index eaf5d3d9..52a76db0 100644 --- a/app/nullius/standard/cli.py +++ b/app/nullius/standard/cli.py @@ -193,7 +193,8 @@ def cmd_list(a): print(definitions.KINDS[kind]["dir"] + ":") for d in got[kind]: side = d.get("needs") if kind == "benchmark" else d.get("offers") - print(f" {d.get('_ref') or d['key']:<18} {('needs ' if kind == 'benchmark' else 'offers ') + ', '.join(side or []) or 'nothing proven yet'}") + print(f" {d.get('_ref') or d['key']:<18} {('needs ' if kind == 'benchmark' else 'offers ') + ', '.join(side or []) or 'nothing proven yet'}" + + (f" · {definitions.origin_of(d).capitalize()}" if kind != "capability" else "")) up = d.get("upstream") or {} if up.get("repository"): print(f" {'':<18} upstream {up['repository'].removeprefix('https://')} @ " @@ -223,8 +224,11 @@ def catalogue_problems(benches) -> list: bad.append(f"benchmark {b['key']}: no benchmark.json beside standard.json (the catalogue's entry)") continue with open(entry) as f: - if "standard" not in (json.load(f).get("harness") or []): - bad.append(f"benchmark {b['key']}: benchmark.json does not name 'standard' in harness") + said = json.load(f) + if "standard" not in (said.get("harness") or []): + bad.append(f"benchmark {b['key']}: benchmark.json does not name 'standard' in harness") + if b.get("_version") == b.get("_default") and catalog.origin_of(said) != definitions.origin_of(b): + bad.append(f"benchmark {b['key']}: benchmark.json says origin {catalog.origin_of(said)}, its default version is {definitions.origin_of(b)}") # each benchmark's settings inventory, against every version of it (definitions.settings_problems) every = definitions.load("benchmark", every=True)[0] for key in dict.fromkeys(b["key"] for b in benches): @@ -414,6 +418,8 @@ def check(d): proofs.write(folder, evidence) ondisk.write_whole(path, json.dumps(d, indent=2) + "\n") print(f"wrote {path}: {key}@{version} beside {', '.join(v for v in d['versions'] if v != version)} (default still {old})") + if kind != "capability": + print('a fork, or someone\'s fixes: say "origin": "experiment" in its upstream') if kind == "benchmark": print(f"next: say what differs in it (upstream, datasets, driver, score, limits, controls, environments), then: " f"cli check, and cli prove {key}@{version} --limit 3; make it the default by setting \"default\": \"{version}\"") @@ -460,6 +466,8 @@ def cmd_new(a): then = f"cli run {key} reference --model gpt-5-mini --limit 2 --unsandboxed" else: then = f"cli conform {key} --model gpt-5-mini" + (" --unsandboxed" if kind == "agent" else "") + if kind != "capability": + print("recommended: an official version first (a tag, branch or commit of the official source), an experiment after it") print(f"next: fill in the CAPITALS{', add benchmark.json beside it (the catalogue entry)' if kind == 'benchmark' else ''}, " f"then: cli check, and {then}") return 0 diff --git a/app/nullius/standard/contract/definitions.py b/app/nullius/standard/contract/definitions.py index ad5f8918..b46b623f 100644 --- a/app/nullius/standard/contract/definitions.py +++ b/app/nullius/standard/contract/definitions.py @@ -20,6 +20,9 @@ version offers exactly the ports it has proven. A file without ``versions`` is one version, its ``upstream.version``. +Each version is official or an experiment (:func:`origin_of`): another +source, or someone's fixes (``upstream.origin``, ``upstream.fixes``). + The conformance kits are benchmarks too, kept inside this package (``standard/kits//standard.json``), so a kit is run the way any benchmark is. @@ -100,7 +103,7 @@ from nullius.standard.contract import ports from nullius import ondisk, paths -from nullius.catalogue import storage +from nullius.catalogue import catalog, storage from . import names, proofs STANDARD = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # the standard's folder, which holds this one @@ -237,8 +240,9 @@ def resolve(d: dict, version: Optional[str] = None) -> Optional[dict]: out["proven"] = dict(block.get("proven") or {}) if not bench: # a benchmark offers nothing: it needs out["offers"] = [p for p in ports.PORTS if p in out["proven"]] - labels = {x: version_label({"upstream": _version_upstream(d, x), "_version": x}) for x in vs if isinstance(vs[x], dict)} - return dict(out, _version=v, _versions=list(vs), _default=d.get("default"), _ref=f"{d.get('key')}@{v}", _labels=labels) + every = {x: dict(d, upstream=_version_upstream(d, x), _version=x) for x in vs if isinstance(vs[x], dict)} + return dict(out, _version=v, _versions=list(vs), _default=d.get("default"), _ref=f"{d.get('key')}@{v}", + _labels={x: version_label(e) for x, e in every.items()}, _origins={x: origin_of(e) for x, e in every.items()}) def _version_upstream(d: dict, v: str) -> dict: @@ -247,9 +251,18 @@ def _version_upstream(d: dict, v: str) -> dict: own = (d["versions"][v] or {}).get("upstream") or {} if ("repository" in own or "tested" in own) and "tag" not in own: up.pop("tag", None) # another repository or commit: the shared tag is not its + if own.get("repository", up.get("repository")) != up.get("repository") and "repository" in up: + up["origin"] = "experiment" # another source, unless it says its own origin return dict(up, **own, version=v) +def origin_of(d: dict) -> str: + """Where a resolved version comes from (``catalog.ORIGINS``): what its ``upstream.origin`` says, else + ``experiment`` when its upstream lists ``fixes``, else its entry's (a benchmark's ``benchmark.json``), else official.""" + up = d.get("upstream") or {} + return up.get("origin") or ("experiment" if up.get("fixes") else d.get("_origin") or "official") + + def version_label(d: dict) -> str: """A version as a reader names it: its release tag, else its branch and short commit (``main (044bc33)``), else its key.""" @@ -798,6 +811,8 @@ def _upstream(u) -> List[str]: bad.append("upstream.tag: a tag of upstream.repository, which is not set") if "branch" in u and (not tag_ok(u["branch"]) or "tag" in u or "repository" not in u): bad.append("upstream.branch: the branch an untagged tested commit is on (main), with upstream.repository and no tag") + if "origin" in u and u["origin"] not in catalog.ORIGINS: + bad.append(f"upstream.origin: one of {catalog.ORIGINS}") if not u.get("license"): bad.append("upstream.license: say it, or 'unknown'") return bad @@ -1423,7 +1438,7 @@ def _own_entry(bench: dict, key: str, e: dict) -> dict: benchmark it runs derived from its folder.""" return dict(e, schema=KINDS["agent"]["schema"], only_for=[bench.get("key")], benchmark=bench.get("key"), benchmark_label=bench.get("label"), _kind="agent", _here=bench.get("_here", ""), - _ref=f"{bench.get('key')}:{key}", _version="", _versions=[""], _default="", **{"from": "benchmark"}) + _ref=f"{bench.get('key')}:{key}", _version="", _versions=[""], _default="", _origin=origin_of(bench), **{"from": "benchmark"}) def own_agents(bench: dict) -> List[dict]: @@ -1750,12 +1765,24 @@ def _read(path: str, kind: str, key: str) -> Tuple[Optional[dict], List[str]]: if bad: return None, bad d = dict(d, _here=os.path.dirname(path), _kind=kind) + if kind == "benchmark": + d["_origin"] = _entry_origin(os.path.dirname(path)) if kind == "agent": # where it comes from: the user's catalogue, or the bundle user = os.path.realpath(paths.catalogue_dir()) d["from"] = "yours" if os.path.realpath(path).startswith(user + os.sep) else "bundled" return d, [] +def _entry_origin(folder: str) -> str: + """The origin a benchmark's catalogue entry says; official without one that reads.""" + try: + with open(os.path.join(folder, catalog.ENTRY)) as f: + origin = catalog.origin_of(json.load(f)) + except (OSError, ValueError, AttributeError): + return "official" + return origin if origin in catalog.ORIGINS else "official" + + def load(kind: str, root: Optional[str] = None, every: bool = False) -> Tuple[List[dict], List[str]]: """Every definition of ``kind``, in folder order, and errors in those left out. With no root the user catalogue overlays the bundle, by whole folder; diff --git a/app/nullius/standard/pages/recipe.py b/app/nullius/standard/pages/recipe.py index e227668a..af163bfb 100644 --- a/app/nullius/standard/pages/recipe.py +++ b/app/nullius/standard/pages/recipe.py @@ -124,7 +124,8 @@ def benchmarks(cat) -> List[dict]: entries (``Catalog.listed_benchmarks``, whichever runner runs it) as ``b``, with its ``datasets``, its ``tasks`` and their ``unit`` (``Catalog.tasks_of``), what some of its options need of a machine (``host``, by label, None for nothing), what it is run with: ``family`` agent or capability (a benchmark only Harbor runs runs agents) and, for a - capability, its ``kind``; and ``versions``, another version's tasks and unit by version.""" + capability, its ``kind``; ``versions``, another version's tasks and unit by version; and ``origins``, its versions' + origins, each once, the default version's first.""" defs = {d["key"]: d for d in definitions.load("benchmark")[0]} out = [] for b in cat.listed_benchmarks: @@ -133,11 +134,18 @@ def benchmarks(cat) -> List[dict]: out.append({"b": b, "datasets": cat.datasets_of(b), "tasks": tasks, "unit": unit, "host": [hostreq.label(d, n) for n in sorted(d["host"])] if d.get("host") else None, "family": d.get("family") or "agent", "kind": _capability_kind(d), + "origins": origins(d) if d else [b.origin], # another version's tasks, when its datasets count differently (``Catalog.in_version``) "versions": {v: cat.tasks_of(b, cat.in_version(b, v)[1]) for v in b.versions}}) return out +def origins(d: dict) -> List[str]: + """The origins of a definition's versions, each once, its default version's first.""" + every = d.get("_origins") or {} + return list(dict.fromkeys([every.get(d["_default"]) or definitions.origin_of(d), *every.values()])) + + def _bench_page(b: dict) -> dict: """A benchmark as a page shows it. ``controls``: the ones it declares, each with who wrote it and where it comes from - what the builder offers @@ -153,7 +161,7 @@ def _bench_page(b: dict) -> dict: "version": b["_version"] if versioned else "", # its versions, each by the ref a recipe names it with (the bare key: the default) "versions": [{"ref": b["key"] if v == b.get("_default") else f"{b['key']}@{v}", "version": v, "default": v == b.get("_default"), - "label": (b.get("_labels") or {}).get(v) or v} + "label": (b.get("_labels") or {}).get(v) or v, "origin": (b.get("_origins") or {}).get(v) or "official"} for v in b.get("_versions") or []] if versioned else [], "environments": {n: {"summary": e.get("summary", ""), "local_ok": bool(e.get("local_ok")), "network": e.get("network"), "needs_secrets": [{"name": s["name"], "to": s["to"], "kind": s.get("kind") or "value", diff --git a/app/static/builder/command-builder.js b/app/static/builder/command-builder.js index d904f5af..754cd1f5 100644 --- a/app/static/builder/command-builder.js +++ b/app/static/builder/command-builder.js @@ -244,7 +244,7 @@ const benchmarkStep = rec => { const sb = C.standardBase(rec); const versions = C.isStandard(rec) && sb && (sb.versions || []).length > 1 - ? `` : ''; + ? `` : ''; return `

Choose a benchmark.

` + versions; }; // Put the recipe on a runner, keeping the one each runner had: the benchmark follows. diff --git a/app/static/catalogue/catalogue.css b/app/static/catalogue/catalogue.css index 4087a55b..6ee4b389 100644 --- a/app/static/catalogue/catalogue.css +++ b/app/static/catalogue/catalogue.css @@ -1,4 +1,4 @@ -/* Benchmarks: two shelves of cards, official then community. */ +/* Benchmarks: two shelves of cards, official then experiments. */ .bench-index, .bench-page { width: 100%; max-width: 1120px; margin: 0 auto; } .bench-index:not(.bench-new) { max-width: 1320px; } /* the cards' controls row, under the title */ @@ -7,7 +7,7 @@ .bench-shelf[hidden], .bench-card[hidden] { display: none; } .bench-shelf h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 13px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--text); } .shelf-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--status-color); } -.bench-shelf.st-community .shelf-dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--status-color); } +.bench-shelf.st-experiment .shelf-dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--status-color); } .shelf-n { color: var(--text-faint); font-weight: 500; } /* four cards a line on a wide screen, two on a narrower one, one on a phone */ .bench-grid { --n: 4; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 16px; } @@ -51,8 +51,8 @@ tr:has([data-pick]:not(:disabled)) { cursor: pointer; } /* the foot on a card's last line, wherever its badges or stats would put it */ .bench-card-foot:not(.bench-card-runs ~ *, .bench-stats ~ *) { margin-top: auto; } .bench-card-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; } -.bench-shelf.st-community .bench-card { background: transparent; border-style: dashed; border-color: var(--border); } -.bench-shelf.st-community .bench-card:hover { border-color: var(--accent); } +.bench-shelf.st-experiment .bench-card { background: transparent; border-style: dashed; border-color: var(--border); } +.bench-shelf.st-experiment .bench-card:hover { border-color: var(--accent); } .bench-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; line-height: 18px; min-height: 18px; } /* one height with or without a status glyph, so stats line up across a row */ .bench-card-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; } .bench-harness { font: 12px var(--mono); color: var(--text-faint); } diff --git a/app/static/catalogue/new.js b/app/static/catalogue/new.js index bd8b661b..0deb95c0 100644 --- a/app/static/catalogue/new.js +++ b/app/static/catalogue/new.js @@ -15,6 +15,11 @@ form.querySelectorAll('input[name=source]').forEach(r => r.addEventListener('change', placeholder)); placeholder(); + const adding = !form.hasAttribute('data-editing'); + form.querySelectorAll('input[name=origin]').forEach(r => r.addEventListener('change', () => { + if (adding && r.value === 'experiment') window.nulliusNotify('Recommended: add an official version first.', {key: 'origin'}); + })); + button.addEventListener('click', async () => { button.disabled = true; said.className = 'nb-said'; said.textContent = 'Asking Harbor…'; try { diff --git a/app/static/style.css b/app/static/style.css index 7f6b8ae3..c1546d59 100644 --- a/app/static/style.css +++ b/app/static/style.css @@ -1664,14 +1664,14 @@ a.chip { text-decoration: none; } .st-branch { --status-color: var(--patch_failed_tests); } .st-watch { --status-color: var(--text-faint); } .st-blocked { --status-color: var(--bad); } -.st-community { --status-color: var(--text-faint); } -.chip:is(.st-runs, .st-lane, .st-branch, .st-watch, .st-blocked, .st-community) { +.st-experiment { --status-color: var(--text-faint); } +.chip:is(.st-runs, .st-lane, .st-branch, .st-watch, .st-blocked, .st-experiment) { color: color-mix(in srgb, var(--status-color) 90%, var(--text)); background: color-mix(in srgb, var(--status-color) 10%, var(--surface)); border-color: color-mix(in srgb, var(--status-color) 35%, var(--border)); font-weight: 500; } -.chip:is(.st-runs, .st-lane, .st-branch, .st-watch, .st-blocked, .st-community)::before { +.chip:is(.st-runs, .st-lane, .st-branch, .st-watch, .st-blocked, .st-experiment)::before { width: 8px; height: 8px; flex: none; background: var(--status-color); } .chip.sm { font-size: .72rem; padding: .05rem .5rem; } @@ -1695,8 +1695,8 @@ a.pill:hover { color: var(--text); border-color: var(--text-faint); text-decorat .rubric-level.current { color: var(--text); font-weight: 500; } .rubric-level .mono { margin-right: .4rem; } pre.instruction { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 32rem; overflow: auto; } -/* Community entries use the secondary label color. */ -.tree-item.leaf.st-community .lbl { color: var(--text-faint); } +/* Experiments use the secondary label color. */ +.tree-item.leaf.st-experiment .lbl { color: var(--text-faint); } /* what a run is doing: a stepper of its stages, then its units. A step is a mark, the line to the next step, its name and its time; done reads filled and checked, the @@ -1738,13 +1738,15 @@ pre.instruction { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 32 .execution-progress { display: flex; align-items: center; gap: 10px; margin: 6px 0; } .execution-progress progress { flex: 1; max-width: 420px; height: 8px; accent-color: var(--accent); } -/* Where an entry comes from: the publisher's benchmark (Official), or adapted by the community (Community) - beside the category tag on benchmark cards and pages. */ +/* Where an entry comes from: the official source (Official), or another source or someone's fixes (Experiment). */ .origin-tag { display: inline-flex; align-items: center; font-size: .72rem; font-weight: 500; letter-spacing: .03em; padding: .12rem .55rem; border-radius: 5px; } .origin-tag.official { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); } -.origin-tag.community { color: var(--origin-community, #b8741a); background: color-mix(in srgb, var(--origin-community, #b8741a) 16%, transparent); } +.origin-tag.experiment { color: var(--origin-experiment, #b8741a); background: color-mix(in srgb, var(--origin-experiment, #b8741a) 16%, transparent); } + +.origin-tag.benchmark { color: var(--text-dim); background: color-mix(in srgb, var(--text-faint) 16%, transparent); } /* A notice (flash) as a toast at the bottom right, as the builder's. */ .toasts { position: fixed; inset: auto 16px 16px auto; margin: 0; padding: 0; border: 0; background: transparent; width: max-content; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: min(440px, calc(100vw - 32px)); } diff --git a/app/templates/agents/entry.html b/app/templates/agents/entry.html index cf845eb0..a2d7caa1 100644 --- a/app/templates/agents/entry.html +++ b/app/templates/agents/entry.html @@ -12,6 +12,7 @@ {% set tags %} {% if kind == 'capability' %}{{ d.kind }}{% endif %} {{ e.protocol }} + {% if kind == 'agent' %}{{ origin|capitalize }}{% endif %} {% if d.example %}example{% endif %} {% if versions %}{{ 'default version' if d._version == d._default else 'not the default version' }}{% endif %} {% endset %} @@ -24,7 +25,7 @@ {# Each version has its own pins and its own proofs: a new release is offered only once it has proven its ports. #} {% endif %} {% set upstream = d.get('upstream', {}) %} diff --git a/app/templates/agents/standard.html b/app/templates/agents/standard.html index d57948e0..bfe6b5c6 100644 --- a/app/templates/agents/standard.html +++ b/app/templates/agents/standard.html @@ -37,7 +37,8 @@ {#- A card's fields (web/agents.py `_card`), in the slots of the builder's Agent step (builder/agents.html). #} {% set cols = [dict(key='icon', label='Logo', card='icon', table=false, class='std-mark small'), dict(key='title', label='Name', card='title'), dict(key='kind', label='Kind', card='badge', class='cat-tag'), dict(key='protocol', label='Protocol', card='tag', class='std-tag'), - dict(key='uses', label='Uses', card='badge', class='std-tag', off=true), dict(key='from', label='From', card='meta'), dict(key='runs_on', label='Runs on', class='cat-tag', off=true), dict(key='models', label='Models', card='note', width='expand'), + dict(key='default_origin', label='Origin', card='badge', class='origin-tag', table=false), dict(key='origin', label='Origin', class='origin-tag', filter='dropdown', filter_icon='origin'), + dict(key='uses', label='Uses', card='badge', class='std-tag', off=true), dict(key='from', label='From', card='meta'), dict(key='runs_on', label='Runs on', class='cat-tag', off=true), dict(key='models', label='Models', card='note', width='expand', off=true), dict(key='proves', label='Proves', class='std-tag', off=true), dict(key='example', label='Example', card='badge', class='std-tag', off=true), dict(key='summary', label='Summary', card='text', class='std-clamp', width='expand', off=true), dict(key='ports', label='Ports proven', card='stat', type='num'), dict(key='runs', label='Benchmarks it runs', card='stat', type='num'), dict(key='installs', label='Installs', card='stat', class='word'), diff --git a/app/templates/builder/agents.html b/app/templates/builder/agents.html index dbd07b0e..813e3f88 100644 --- a/app/templates/builder/agents.html +++ b/app/templates/builder/agents.html @@ -3,10 +3,10 @@ {% from '_cards.html' import cards %} {% set noun = 'agents' if kind == 'agent' else 'capabilities' %} {#- the card's slots as the Agents page's (agents/standard.html); in a table, why not after the name, fit and proves - off until asked; Fit a menu of its own, on Can run it at first -#} + off until asked; Origin and Fit menus of their own, Fit on Can run it at first -#} {% set cols = [dict(key='icon', label='Logo', card='icon', table=false, class='std-mark small'), dict(key='title', label='Name', card='title', width='expand'), dict(key='alert', label='Why not', card='alert'), dict(key='protocol', label='Protocol', card='tag', class='std-tag'), - dict(key='published', label='Setup', card='tag', class='std-tag'), + dict(key='origin', label='Origin', card='badge', class='origin-tag', filter='dropdown', filter_icon='origin'), dict(key='published', label='Setup', card='tag', class='std-tag'), dict(key='ticks', label='Checks', card='badge', class='nb-tick'), dict(key='fit', label='Fit', filter='dropdown', filter_icon='puzzle', off=true), dict(key='from', label='From', card='meta'), dict(key='proves', label='Proves', class='std-tag', off=true)] %} {{ cards('nb-agents', cols, items, search='Search ' ~ noun, choices=choices, empty='No ' ~ kind ~ ' matches.', noun=noun, layout=layout, default='cards', only={'fit': 'fit'}) }} diff --git a/app/templates/builder/benchmarks.html b/app/templates/builder/benchmarks.html index 9284211d..472d26bd 100644 --- a/app/templates/builder/benchmarks.html +++ b/app/templates/builder/benchmarks.html @@ -2,10 +2,10 @@ (web/catalogue.py, benchmark_cards) as single-choice pick cards of the card toolkit (_cards.html), or its rows (`layout` 'table'), loaded by command-builder.js. -#} {% from '_cards.html' import cards %} -{#- the category a row of pills; what it evaluates (agents or capabilities) a menu of its own, beside Filter (runner) -#} +{#- the category a row of pills; what it evaluates (agents or capabilities) and the origin menus of their own, beside Filter (runner) -#} {% set cols = [dict(key='icon', label='Mark', card='icon', table=false, class='bench-mark'), dict(key='title', label='Name', card='title', width='expand'), dict(key='evaluates', label='Evaluates', card='badge', class='std-tag', filter='dropdown', filter_icon='target'), dict(key='tasks', label='Tasks', card='stat', type='num'), - dict(key='category', label='Category', card='tag', class='cat-tag', filter='pills'), dict(key='origin', label='Origin', card='tag', class='origin-tag'), + dict(key='category', label='Category', card='tag', class='cat-tag', filter='pills'), dict(key='origin', label='Origin', card='tag', class='origin-tag', filter='dropdown', filter_icon='origin'), dict(key='runs', label='Runner', class='run-tag'), dict(key='domain', label='Domain', off=true)] %} {{ cards('nb-benchmarks', cols, items, search='Search benchmarks', choices=choices, sort=['title', 'tasks'], empty='No benchmark matches.', noun='benchmarks', layout=layout, default='cards') }} diff --git a/app/templates/catalogue/benchmark.html b/app/templates/catalogue/benchmark.html index be84e2e4..1a6b943f 100644 --- a/app/templates/catalogue/benchmark.html +++ b/app/templates/catalogue/benchmark.html @@ -9,7 +9,7 @@ {% set ways = (['the Nullius standard'] if 'standard' in b.harness else []) + (['Harbor'] if 'harbor' in b.harness else []) %}{% set runs_with = ways|join(' or ') if ways else 'no harness here' %}
{% set mark %}{% endset %} - {% set tags %}{% if b.category %}{{ b.category }}{% endif %}{{ b.label }}{% endset %} + {% set tags %}{% if b.category %}{{ b.category }}{% endif %}{% for y in views %}{{ y.origin|capitalize }}{% endfor %}{% endset %} {% set actions %} {% if b.usable_routes %}Build a run {% endif %} {% if b.citation %}Cite{% endif %} @@ -36,7 +36,7 @@ {#- Each version is the whole page once: its pin, proofs, setup, options, tasks and limitations. A click swaps them in place. -#} {% endif %} {%- macro vattr(y, cls='') %} class="{{ (cls ~ ' std-version')|trim }}"{% if y.version %} data-version="{{ y.version }}"{% endif %}{% if not y.current %} hidden{% endif %}{% endmacro %} diff --git a/app/templates/catalogue/benchmarks.html b/app/templates/catalogue/benchmarks.html index 345ba44d..4872a612 100644 --- a/app/templates/catalogue/benchmarks.html +++ b/app/templates/catalogue/benchmarks.html @@ -26,16 +26,16 @@ {% endcall %} - {#- A card's fields (web/catalogue.py `_card`); the filters are the category's pills, and the origin and what runs it as dropdowns. #} + {#- A card's fields (web/catalogue.py `_card`); the filters are the category's pills, the origin and what runs it dropdowns; a card shows its default version's origin. #} {% set cols = [dict(key='icon', label='Mark', card='icon', table=false, class='bench-mark'), dict(key='title', label='Name', card='title'), - dict(key='category', label='Category', card='tag', class='cat-tag', filter='pills'), dict(key='origin', label='Origin', card='tag', class='origin-tag', filter='dropdown', filter_icon='origin'), + dict(key='category', label='Category', card='tag', class='cat-tag', filter='pills'), dict(key='default_origin', label='Origin', card='tag', class='origin-tag', table=false), dict(key='origin', label='Origin', class='origin-tag', filter='dropdown', filter_icon='origin'), dict(key='domain', label='Domain', card='text', off=true), dict(key='runs', label='Runs with', card='badge', class='run-tag', filter='dropdown', filter_icon='runner'), dict(key='tasks', label='Tasks', card='stat', type='num'), dict(key='datasets', label='Datasets', card='stat', type='num'), dict(key='scoring', label='Scored by', card='stat', class='word'), dict(key='needs', label='Needs', card='note', icon='wrench', off=true), dict(key='blocker', label='Blocker', card='alert')] %} - {#- Two shelves: the official benchmarks, then the community benchmarks; the table is one table in that order, its + {#- Two shelves: the official benchmarks, then the experiments; the table is one table in that order, its Origin the shelf. #} - {% set sort = ['title', 'tasks', 'datasets'] %}{% set shelves = [('official', 'Official'), ('community', 'Community')] %} + {% set sort = ['title', 'tasks', 'datasets'] %}{% set shelves = [('official', 'Official'), ('experiment', 'Experiment')] %} {% set rows = [] %}{% for state, _ in shelves %}{% set _ = rows.extend(items|selectattr('shelf', 'equalto', state)) %}{% endfor %} {% call cards('benchmarks', cols, rows, search='Name, category, dataset', choices=choices, sort=sort, empty='No benchmark matches.', noun='benchmarks', layout='table' if request.args.get('view') == 'table' else 'cards', default='cards') %} {% for state, heading in shelves %} diff --git a/app/templates/catalogue/new.html b/app/templates/catalogue/new.html index 5dc53616..5616f53a 100644 --- a/app/templates/catalogue/new.html +++ b/app/templates/catalogue/new.html @@ -25,7 +25,7 @@ {% endif %} -
+
@@ -77,7 +77,7 @@

2Catalogue entry

Origin
- {% for o in origins %}{{ radio('origin', o, o|capitalize, 'the publisher\'s benchmark' if o == 'official' else 'adapted by the community') }}{% endfor %} + {% for o in origins %}{{ radio('origin', o, o|capitalize, 'the publisher\'s benchmark' if o == 'official' else 'another source, or someone\'s fixes') }}{% endfor %}
diff --git a/app/tests/catalogue_docs.py b/app/tests/catalogue_docs.py index 1eba4092..46bbe641 100644 --- a/app/tests/catalogue_docs.py +++ b/app/tests/catalogue_docs.py @@ -400,7 +400,7 @@ def render_feature_page(versions: list) -> str: def _origin(entry) -> str: - """Official or Community, linked to the benchmark's own repository.""" + """Official or Experiment, linked to the benchmark's own repository.""" url = (entry.citation_source or "").strip() return f'{entry.label}' if url.startswith("http") else entry.label diff --git a/app/tests/test_catalog.py b/app/tests/test_catalog.py index 31e5a3cd..fd792c27 100644 --- a/app/tests/test_catalog.py +++ b/app/tests/test_catalog.py @@ -150,7 +150,7 @@ def test_bad_origin_is_named(self): benchmarks=[catalog.Benchmark(key="x", title="X", origin="maybe", datasets=["d"])], datasets=[]) bad = catalog.validate(cat) - self.assertIn("x: origin is official or community", bad) + self.assertIn("x: origin is official or experiment", bad) self.assertTrue(any("dataset 'd'" in m for m in bad)) def test_a_dataset_its_benchmark_does_not_list_is_named(self): @@ -255,7 +255,7 @@ def test_a_benchmark_on_both_names_both_usable_nullius_first(self): self.assertEqual(tb.blocker, "") def test_a_named_harness_that_is_here_is_usable_run_or_not(self): - b = self._bench(harness=["harbor"], origin="community") + b = self._bench(harness=["harbor"], origin="experiment") self.assertEqual([r.summary for r in b.routes], ["Harbor · runnable"]) self.assertEqual((b.route_case, b.blocker), ("harbor-only", "")) @@ -269,16 +269,16 @@ def test_no_usable_route_says_what_is_missing(self): self.assertTrue(any("harness 'docker'" in m for m in catalog.validate(cat))) self.assertEqual(cat.listed_benchmarks, []) - def test_legacy_experiments_become_official_and_community_stays_community(self): + def test_older_words_for_an_experiment_load_as_experiment(self): with tempfile.TemporaryDirectory() as root: for key, extra in (("old-exp", {"status": "blocked", "experiment": True}), - ("old-origin", {"origin": "experiment"}), ("community", {"origin": "community"})): + ("new", {"origin": "experiment"}), ("community", {"origin": "community"})): p = pathlib.Path(root, catalog.BENCHMARKS, key); p.mkdir(parents=True) (p / catalog.ENTRY).write_text(json.dumps( {"key": key, "title": key, "category": "Coding", "harness": ["harbor"], "datasets": [], **extra})) cat = catalog.load(root) self.assertEqual([(b.key, b.origin, b.blocker) for b in cat.benchmarks], - [("community", "community", ""), ("old-exp", "official", ""), ("old-origin", "official", "")]) + [("community", "experiment", ""), ("new", "experiment", ""), ("old-exp", "experiment", "")]) class Example(unittest.TestCase): diff --git a/app/tests/test_harbor_entry.py b/app/tests/test_harbor_entry.py index c97b0fef..c332b976 100644 --- a/app/tests/test_harbor_entry.py +++ b/app/tests/test_harbor_entry.py @@ -138,9 +138,9 @@ def test_an_edit_changes_what_the_form_shows_and_keeps_the_rest(self): self.assertEqual(h.entry_of("swe-bench-verified", self.root)["title"], "SWE-bench Verified (edited)") self.assertEqual(catalog.validate(catalog.load(self.root)), []) - def test_legacy_experiments_save_as_official_and_community_is_preserved(self): - for extra, expected in (({"experiment": True}, "official"), - ({"origin": "experiment"}, "official"), ({"origin": "community"}, "community")): + def test_older_words_for_an_experiment_save_as_experiment(self): + for extra, expected in (({"experiment": True}, "experiment"), + ({"origin": "experiment"}, "experiment"), ({"origin": "community"}, "experiment")): with self.subTest(extra=extra): old = {**h.build(form()), **extra} folder = os.path.join(self.root, "benchmarks", "code-bench") diff --git a/app/tests/test_standard_versions.py b/app/tests/test_standard_versions.py index cc604340..0cc98212 100644 --- a/app/tests/test_standard_versions.py +++ b/app/tests/test_standard_versions.py @@ -355,6 +355,11 @@ def test_a_fork_is_a_version_with_its_own_repository_and_commit_and_no_borrowed_ self.assertEqual((fork["upstream"]["repository"], fork["upstream"]["tested"]), (self.fork, self.fixed)) self.assertNotIn("tag", fork["upstream"]) # the published tag is not the fork's self.assertEqual(fork["_ref"], "toy@fork") + self.assertEqual(fork["_origins"], {"1": "official", "fork": "experiment"}) + for upstream, said in (({"origin": "official"}, "official"), ({"fixes": ["one"]}, "experiment"), ({}, "experiment")): + got = definitions.resolve(dict(self.bench({}, upstream), _origin="experiment"), "fork") # else its entry's + self.assertEqual(definitions.origin_of(got), said) + self.assertIn("upstream.origin: one of ('official', 'experiment')", definitions._upstream({"license": "MIT", "origin": "community"})) tagged = definitions.resolve(self.bench({"repository": self.upstream, "tag": "v1.0.0", "tested": self.published}, {"repository": self.fork, "tag": "fix-1", "tested": self.fixed}), "fork") self.assertEqual(tagged["upstream"]["tag"], "fix-1") diff --git a/app/ui_tests/test_agents.py b/app/ui_tests/test_agents.py index 459d2dd6..66833375 100644 --- a/app/ui_tests/test_agents.py +++ b/app/ui_tests/test_agents.py @@ -136,20 +136,20 @@ def test_agents_is_a_card_per_agent_that_opens_its_page(self): self.assertNotIn("agent.task/v1", card[card.index(">"):card.index("
")]) # the detail is on its page self.assertEqual(self.get("/agents/nope").status_code, 404) - def test_a_benchmarks_own_agents_are_listed_behind_the_from_filter(self): + def test_a_benchmarks_own_agents_are_listed_behind_the_origin_filter(self): with patch.object(definitions, "load", _LOAD): html = self.get("/agents").get_data(as_text=True) table = self.get("/agents?view=table").get_data(as_text=True) - menu = html[html.index('data-filter-menu="from"'):] + menu = html[html.index('data-filter-menu="origin"'):] menu = menu[:menu.index("")] - self.assertIn('data-value="bundled" checked> Nullius', menu) + self.assertIn('data-value="official" checked> Official', menu) self.assertIn('data-value="benchmark"> A benchmark's own', menu) # one click away, off by default card = html[html.index('id="osworld1-openai-cua"'):] card = card[:card.index("")] - self.assertIn('data-f-from="benchmark "', card) + self.assertIn('data-f-origin="benchmark "', card) self.assertIn('href="/benchmarks/osworld1"', card) self.assertIn('
computer-use-preview
', card) - self.assertIn('
Computer use
', card) + self.assertIn('
A benchmark's ownComputer use
', card) self.assertIn('
Its own script' 'OSWorld1
', card) # the builder's foot: its protocol, where it comes from self.assertNotIn("Ports proven", card) @@ -169,8 +169,8 @@ def test_runs_on_filters_by_the_benchmarks_each_agent_runs(self): "evocua", "autoglm", "autoglm-v", "mano", "muse-spark")])) self.assertNotIn("osworld1", dict(cards)["osworld2-m3"].split(" ")) # another benchmark's own runs it alone own = html[html.index('id="osworld1-m3"'):] - self.assertIn('data-unless-from="runs_on"', own[:own.index(">")]) # Runs on its benchmark shows it, whatever From says - self.assertNotIn("data-unless-from", html[html.index('id="codex"'):][:200]) + self.assertIn('data-unless-origin="runs_on"', own[:own.index(">")]) # Runs on its benchmark shows it, whatever Origin says + self.assertNotIn("data-unless-origin", html[html.index('id="codex"'):][:200]) # the count the card shows and the filter read one record card = html[html.index('id="codex"'):] n = card[:card.index(">")].split('data-f-runs_on="', 1)[1].split('"', 1)[0].count(" ") @@ -306,7 +306,7 @@ def versioned(self): d = json.loads(path.read_text()) proven = d.pop("proven"); d.pop("offers") d["default"], d["upstream"] = "1.0", {"license": "MIT"} - d["versions"] = {"2.0": {"install": {"npm": ["fake-acp@2.0"]}, "proven": {}}, + d["versions"] = {"2.0": {"upstream": {"origin": "experiment"}, "install": {"npm": ["fake-acp@2.0"]}, "proven": {}}, "1.0": {"install": {"npm": ["fake-acp@1.0"]}, "proven": proven}} path.write_text(json.dumps(d)) self.stack.enter_context(patch.object(definitions, "load", lambda kind, root_=None, every=False: _LOAD(kind, str(root), every=every))) @@ -327,14 +327,16 @@ def test_an_agent_with_versions_is_one_card_and_a_page_per_version(self): self.versioned() html = self.get("/agents").get_data(as_text=True) self.assertEqual(html.count('id="fake"'), 1) + self.assertIn('data-f-origin="official experiment "', html) + self.assertIn('data-filter-menu="origin"', html) self.assertIn('Fake agent 1.0', html) # its default version beside its name self.assertIn("v1.0 · 2 versions", self.get("/agents?view=table").get_data(as_text=True)) html = self.get("/agents/fake").get_data(as_text=True) # the default self.assertIn('