Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# The application's two suites and installable package, on every non-draft PR
# The application's backend, route and browser suites and installable package, on every non-draft PR
# (again when a draft is marked ready) and by hand. There are no model calls
# or containers: the docker tier is the nightly docker-tests workflow. uv is a test tool; Flask
# is the app's only Python dependency.
#
# Nothing shared is installed, because nothing shared is imported: the backend
# is this repository's own code under app/nullius/ and imports only the
# standard library. The Harbor build tests invoke uv against offline fixtures;
# only the route suite needs Flask.
# the web suites need Flask; browser interactions also use test-only Playwright.
name: tests

on:
Expand Down Expand Up @@ -55,6 +55,11 @@ jobs:
- name: route suite
# Includes the recipe-compilation tests, which need Node.
run: python3 app/tests/parallel.py app/ui_tests
- name: Leaderboard browser interactions
run: |
uv run --no-project --with-requirements app/ui_tests/browser/requirements.txt python -m playwright install --with-deps chromium
uv run --no-project --with-requirements app/requirements.txt --with-requirements app/ui_tests/browser/requirements.txt python app/ui_tests/browser/leaderboard.py
uv run --no-project --with-requirements app/requirements.txt --with-requirements app/ui_tests/browser/requirements.txt python app/ui_tests/browser/mutations.py
- name: installed package
# Temporary installs only; no publication or stored artifact.
run: |
Expand Down
9 changes: 9 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ is: `grep -m1 '"""' app/nullius/*.py app/nullius/runs/*.py`.
| --- | --- |
| `app/nullius/` itself | What all share: settings, paths, providers, hosts, running a recipe |
| `app/nullius/runs/`, `traces/`, `compare/` | Reading one job tree, a trial's trace, several runs |
| `app/nullius/leaderboard/` | Composite scoring, selected task evidence and profile scoring documents |
| `app/nullius/catalogue/` | A folder per entry under `benchmarks/`, `agents/`, `capabilities/`: its definition and code |
| `app/nullius/recipes/`, `harbor/` | What the builder offers and saves; the Harbor a recipe pins |
| `app/nullius/importers/`, `judge/` | Foreign results in; questions to a judge model |
Expand All @@ -79,6 +80,14 @@ python3 app/tests/parallel.py
uv run --no-project --with-requirements app/requirements.txt \
python app/tests/parallel.py app/ui_tests

# real-browser interactions (test-only dependency; install Chromium once)
uv run --no-project --with-requirements app/ui_tests/browser/requirements.txt \
python -m playwright install chromium
uv run --no-project --with-requirements app/requirements.txt \
--with-requirements app/ui_tests/browser/requirements.txt python app/ui_tests/browser/leaderboard.py
uv run --no-project --with-requirements app/requirements.txt \
--with-requirements app/ui_tests/browser/requirements.txt python app/ui_tests/browser/mutations.py

# one module; a route module under uv as above, with -s app/ui_tests
NULLIUS_HOME=$(mktemp -d) python3 -m unittest discover -s app/tests -t app -p test_live.py

Expand Down
4 changes: 2 additions & 2 deletions app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
if __package__: # the wheel's private web namespace
from .web.core import app
from .web import shared
from .web import filters, runs, traces, compare, builder, catalogue, agents, settings, workspaces, execute, judge, feasibility, reconcile, judge_tasks, onboarding, failure
from .web import filters, runs, traces, compare, builder, catalogue, agents, settings, workspaces, execute, judge, feasibility, reconcile, judge_tasks, onboarding, failure, leaderboard
else: # python app/app.py, and the source route suite
from web.core import app
from web import shared
from web import filters, runs, traces, compare, builder, catalogue, agents, settings, workspaces, execute, judge, feasibility, reconcile, judge_tasks, onboarding, failure
from web import filters, runs, traces, compare, builder, catalogue, agents, settings, workspaces, execute, judge, feasibility, reconcile, judge_tasks, onboarding, failure, leaderboard
from nullius import execution, workspace # noqa: E402 - recorded runs, picked up again at start; the workspace left open


Expand Down
1 change: 1 addition & 0 deletions app/nullius/catalogue/agents/codex/agent.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"schema": "nullius.agent/v1",
"key": "codex",
"label": "Codex",
"company": "OpenAI",
"summary": "OpenAI's coding agent.",
"upstream": {
"license": "Apache-2.0"
Expand Down
1 change: 1 addition & 0 deletions app/nullius/catalogue/agents/digitalmate/agent.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"schema": "nullius.agent/v1",
"key": "digitalmate",
"label": "DigitalMate",
"company": "ThinkFlowLab",
"summary": "DigitalMate's Personal Agent service, run as Hive Home with its owned WorkSwarm runtimes.",
"model": {
"apis": [
Expand Down
1 change: 1 addition & 0 deletions app/nullius/catalogue/agents/goose/agent.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"schema": "nullius.agent/v1",
"key": "goose",
"label": "Goose",
"company": "Agentic AI Foundation",
"summary": "The AAIF's open-source agent, formerly Block's.",
"upstream": {
"package": "@aaif/goose-acp",
Expand Down
1 change: 1 addition & 0 deletions app/nullius/catalogue/agents/jiuwenswarm/agent.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"schema": "nullius.agent/v1",
"key": "jiuwenswarm",
"label": "JiuwenSwarm",
"company": "openJiuwen",
"summary": "openJiuwen's WorkSwarm agent.",
"start": {
"acp": [
Expand Down
1 change: 1 addition & 0 deletions app/nullius/catalogue/agents/mini-swe-agent/agent.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"schema": "nullius.agent/v1",
"key": "mini-swe-agent",
"label": "mini-swe-agent",
"company": "Princeton and Stanford",
"summary": "Princeton's 100-line agent, bash only.",
"upstream": {
"package": "mini-swe-agent",
Expand Down
1 change: 1 addition & 0 deletions app/nullius/catalogue/agents/opencode/agent.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"schema": "nullius.agent/v1",
"key": "opencode",
"label": "OpenCode",
"company": "Anomaly",
"summary": "The open-source terminal coding agent.",
"upstream": {
"package": "opencode-ai",
Expand Down
1 change: 1 addition & 0 deletions app/nullius/catalogue/agents/swe-agent/agent.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"schema": "nullius.agent/v1",
"key": "swe-agent",
"label": "SWE-agent",
"company": "Princeton and Stanford",
"summary": "Princeton\u2019s software engineering agent with its upstream tool bundles.",
"upstream": {
"repository": "https://github.com/SWE-agent/SWE-agent",
Expand Down
1 change: 1 addition & 0 deletions app/nullius/catalogue/agents/terminus-2/agent.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"schema": "nullius.agent/v1",
"key": "terminus-2",
"label": "Terminus 2",
"company": "Harbor",
"summary": "Harbor's terminal agent, used by Terminal-Bench.",
"upstream": {
"package": "harbor",
Expand Down
20 changes: 19 additions & 1 deletion app/nullius/catalogue/benchmarks/osworld1/standard.json
Original file line number Diff line number Diff line change
Expand Up @@ -367,5 +367,23 @@
"branch": "main"
}
}
}
},
"task_parts": [
{
"id": "os",
"label": "OS tasks",
"prefixes": [
"os__"
]
},
{
"id": "office",
"label": "Office tasks",
"prefixes": [
"libreoffice_calc__",
"libreoffice_impress__",
"libreoffice_writer__"
]
}
]
}
45 changes: 31 additions & 14 deletions app/nullius/charts.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class Value:
baseline: bool = False
tag: str = "" # a short name, where the full one does not fit (a scatter's dot)
series: int = 0 # its colour, 1 on, the same in every chart; 0 for none
key: str = ""

def cls(self, shape: str) -> str:
"""A mark's classes: its shape, its series (``s1`` to ``s<SERIES>``, cycling) and whether it is a check."""
Expand Down Expand Up @@ -105,6 +106,7 @@ class Mark:
y2: float = 0.0
cls: str = ""
title: str = ""
key: str = ""


@dataclass(frozen=True)
Expand All @@ -115,6 +117,7 @@ class Text:
anchor: str = "start"
cls: str = ""
leading: float = _LINE
key: str = ""


@dataclass(frozen=True)
Expand Down Expand Up @@ -256,24 +259,25 @@ def dot(v, scale, mid):
_TAG_W, _TAG_H = 7.5, 13.0 # a tag's width per character and its height, at the template's font size


def _tag_box(px: float, py: float, width: float, side: str) -> tuple:
def _tag_box(px: float, py: float, width: float, side: str, radius=_DOT, extra=0) -> tuple:
"""Where a tag ``width`` wide goes on ``side`` of a dot at (px, py): (x, baseline, anchor, box)."""
gap = _DOT + 3
gap = radius + 3
x, base, anchor = {"right": (px + gap, py + 4, "start"), "left": (px - gap, py + 4, "end"),
"above": (px, py - gap - 2, "middle"), "below": (px, py + gap + 10, "middle")}[side]
"above": (px, py - gap - 2 - extra, "middle"), "below": (px, py + gap + 10, "middle")}[side]
x0 = {"start": x, "end": x - width, "middle": x - width / 2}[anchor]
return x, base, anchor, (x0, base - _TAG_H + 3, x0 + width, base + 3)
return x, base, anchor, (x0, base - _TAG_H + 3, x0 + width, base + 3 + extra)


def _overlaps(a: tuple, b: tuple) -> bool:
return a[0] < b[2] and b[0] < a[2] and a[1] < b[3] and b[1] < a[3]


def scatter(x: Metric, y: Metric) -> Panel:
def scatter(x: Metric, y: Metric, *, tiles=False) -> Panel:
"""A dot per item at (x, y), and its tag (``Value.tag``, else its place in the order) beside it, spelled out in a
key under the plot. Every item keeps its own dot: items at one place are set in a ring around it, each tag outward
from its dot. Any other tag takes the first side of its dot inside the plot and clear of the dots and tags before
it."""
radius = 11 if tiles else _DOT
pairs = list(zip(x.values, y.values))
tags = [a.tag or str(i + 1) for i, (a, _) in enumerate(pairs)]
shown = [(t, a, b) for t, (a, b) in zip(tags, pairs) if a.value is not None and b.value is not None]
Expand All @@ -291,29 +295,42 @@ def scatter(x: Metric, y: Metric) -> Panel:
places.setdefault((sx(item[1].value), sy(item[2].value)), []).append(item)
dots = [] # (x, y, the tag's place on its ring or None, tag, x value, y value)
for (px, py), group in places.items():
ring = max(_DOT * 2, len(group) * (2 * _DOT + 4) / (2 * math.pi)) if len(group) > 1 else 0.0
ring = max(radius * 2, len(group) * (2 * radius + 4) / (2 * math.pi)) if len(group) > 1 else 0.0
for k, item in enumerate(group):
turn = 2 * math.pi * k / len(group) - math.pi / 2
at = (round(px + (ring + 11) * math.cos(turn), 2), round(py + (ring + 11) * math.sin(turn) + 4, 2)) if ring else None
dots.append((round(px + ring * math.cos(turn), 2), round(py + ring * math.sin(turn), 2), at, *item))
taken = [(px - _DOT, py - _DOT, px + _DOT, py + _DOT) for px, py, *_ in dots]
taken += [(tx - _TAG_W, ty - _TAG_H + 3, tx + _TAG_W, ty + 3) for _, _, (tx, ty), *_ in (d for d in dots if d[2])]
if tiles:
placed = []
for px, py, *rest in dots:
candidates = [(max(left + radius, min(right - radius, px + dx)),
max(top + radius, min(bottom - radius, py + dy)))
for distance in range(0, 100, 2)
for dx, dy in ((distance, 0), (-distance, 0), (0, distance), (0, -distance))]
px, py = next(((cx, cy) for cx, cy in candidates if all(math.hypot(cx-ox, cy-oy) >= 2*radius+2 for ox, oy, *_ in placed)), candidates[-1])
placed.append((px, py, *rest))
dots = placed
taken = [(px - radius, py - radius, px + radius, py + radius) for px, py, *_ in dots]
taken += [(tx - _TAG_W, ty - _TAG_H + 3, tx + _TAG_W, ty + 3) for _, _, (tx, ty), *_ in (d for d in dots if d[2] and not tiles)]
for px, py, at, tag, a, b in dots:
marks.append(Mark("circle", px, py, r=_DOT, cls=a.cls("dot"),
marks.append(Mark("tile" if tiles else "circle", px, py, r=radius, cls=a.cls("dot"), key=a.key,
title=f"{tag} {a.name}: {x.label} {a.reading}, {y.label} {b.reading}"))
if at: # on a ring, the tag sits outward from its dot
if at and not tiles: # on a ring, the tag sits outward from its dot
texts.append(Text(*at, (tag,), "middle", "tag"))
continue
width = _TAG_W * len(tag)
spots = [_tag_box(px, py, width, side) for side in ("right", "left", "above", "below")]
width = _TAG_W * max(len(tag), len(a.note) if tiles else 0)
extra = 15 if tiles and a.note else 0
offsets = [0] if not tiles else [0] + [sign*d for d in range(15, 211, 15) for sign in (1, -1)]
spots = [_tag_box(px, py + offset, width, side, radius, extra)
for offset in offsets for side in ("right", "left", "above", "below")]
inside = [s for s in spots if s[3][0] >= left and s[3][2] <= right and s[3][1] >= top and s[3][3] <= bottom]
tx, base, anchor, box = next((s for s in inside if not any(_overlaps(s[3], t) for t in taken)), (inside or spots)[0])
taken.append(box)
texts.append(Text(tx, base, (tag,), anchor, "tag"))
texts.append(Text(tx, base, (tag, a.note) if tiles and a.note else (tag,), anchor, "tag", key=a.key))
key_y = _S_HEIGHT + 8
key = _LEFT + (12 if any(a.series for a, _ in pairs) else 0)
drawn = {id(d[4]) for d in dots}
for tag, (a, _) in zip(tags, pairs):
for tag, (a, _) in ([] if tiles else zip(tags, pairs)):
# a name the caller numbered already (two runs of one agent) is not numbered twice
lines = tuple(textwrap.wrap(a.name if a.name.startswith(f"{tag}. ") else f"{tag}. {a.name}", _CHARS))
if a.series: # its colour beside its name
Expand Down
2 changes: 2 additions & 0 deletions app/nullius/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"serve": "open the web application",
"runs": "inspect run output",
"compare": "compare runs",
"leaderboard": "workspace composite agent scores",
"flags": "write a run's task flags",
"import": "import ATIF or OpenTelemetry output",
"standard": "inspect and run standard definitions",
Expand All @@ -26,6 +27,7 @@
MODULES = {
"runs": "nullius.runs.cli",
"compare": "nullius.compare.cli",
"leaderboard": "nullius.leaderboard.cli",
"flags": "nullius.runs.flags_cli",
"import": "nullius.importers.cli",
"standard": "nullius.standard.cli",
Expand Down
1 change: 1 addition & 0 deletions app/nullius/leaderboard/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Workspace agent scores and their selected task evidence."""
Loading