From 2695d5595f80ef69c958ebac20f5ef8e32c3bf8f Mon Sep 17 00:00:00 2001 From: Etienne Filhol Date: Mon, 30 Nov 2026 11:38:06 +0100 Subject: [PATCH] chore(catalogue): remove the Example agent --- .agents/skills/import-agent/SKILL.md | 4 +- .../catalogue/agents/reference/agent.json | 27 --- .../catalogue/agents/reference/agent.py | 209 ------------------ .../catalogue/agents/reference/proofs.json | 63 ------ app/nullius/standard/cli.py | 4 +- app/nullius/standard/pages/recipe.py | 2 +- app/templates/agents/standard.html | 2 +- app/tests/test_execution.py | 4 +- app/tests/test_provider_registry.py | 4 +- app/tests/test_standard_definitions.py | 2 +- app/tests/test_standard_payload.py | 42 ++-- app/ui_tests/test_api.py | 4 +- app/ui_tests/test_builder_agents.py | 5 +- app/ui_tests/test_run_routes.py | 6 +- app/ui_tests/test_runs_by_launch.py | 6 +- app/ui_tests/test_use_bundled.py | 2 +- app/web/agents.py | 3 +- docs/agents/supported/README.md | 3 - docs/cli/run.md | 4 +- docs/cli/task-sets.md | 2 +- docs/standard.md | 2 +- 21 files changed, 48 insertions(+), 352 deletions(-) delete mode 100644 app/nullius/catalogue/agents/reference/agent.json delete mode 100644 app/nullius/catalogue/agents/reference/agent.py delete mode 100644 app/nullius/catalogue/agents/reference/proofs.json diff --git a/.agents/skills/import-agent/SKILL.md b/.agents/skills/import-agent/SKILL.md index 84137c98a..f134f49bb 100644 --- a/.agents/skills/import-agent/SKILL.md +++ b/.agents/skills/import-agent/SKILL.md @@ -63,9 +63,7 @@ repository gates below. CLI mutations protect the bundled tree in either layout. - **Run the agent as its vendor ships it.** Its own ACP, or a maintained ACP adapter (the vendor's first), or its own non-interactive command. Never an - agent loop, tool set, prompt or model client of ours. The reference agent - in the catalogue is Nullius's own test agent, not a template for wrapping a - real one. + agent loop, tool set, prompt or model client of ours. - **Its dependencies are its own.** Installed by its `install` block into its own folder, pinned; never into the app (Flask only). - **Our code is glue.** At most a thin start-up wrapper beside the definition diff --git a/app/nullius/catalogue/agents/reference/agent.json b/app/nullius/catalogue/agents/reference/agent.json deleted file mode 100644 index 17bc89d3c..000000000 --- a/app/nullius/catalogue/agents/reference/agent.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "schema": "nullius.agent/v1", - "key": "reference", - "label": "Example agent", - "example": true, - "summary": "Nullius's example of the protocol, to read or copy.", - "upstream": { - "version": "1", - "license": "same as Nullius" - }, - "start": { - "acp": [ - "python3", - "{here}/agent.py" - ] - }, - "model": { - "apis": [ - "chat" - ], - "env": { - "OPENAI_BASE_URL": "{base_url}", - "OPENAI_API_KEY": "{key}", - "REFERENCE_MODEL": "{model}" - } - } -} diff --git a/app/nullius/catalogue/agents/reference/agent.py b/app/nullius/catalogue/agents/reference/agent.py deleted file mode 100644 index 1703d45b3..000000000 --- a/app/nullius/catalogue/agents/reference/agent.py +++ /dev/null @@ -1,209 +0,0 @@ -"""The reference agent: the smallest complete agent in the Nullius standard. - -Python's standard library only, so it is also the one to copy. It speaks ACP -on stdin and stdout, keeps one conversation per session, and works in a loop: -ask the model (OpenAI Chat Completions at $OPENAI_BASE_URL), run the tools it -asks for, give it their results, until it answers without a tool. Its tools -are four of its own, working in the session's directory - read_file, -write_file, list_files, run - and every tool of the MCP servers the session -was given, named ``__``. - -Every step is told to the client as it happens: the model's text as -``agent_message_chunk``, each tool call as ``tool_call`` then -``tool_call_update`` with its result. -""" -import json -import os -import subprocess -import sys -import threading -import urllib.error -import urllib.request - -MAX_STEPS = int(os.environ.get("REFERENCE_MAX_STEPS") or 30) -OUT_LIMIT = 8000 -SYSTEM = ("You are a careful software agent working in the directory {cwd}. Use the tools to inspect and change files " - "and to run commands there. When the task is done, reply with a short final message and no tool call. " - "If the task asks for a specific reply, give exactly that reply as your final message.") -OWN_TOOLS = [ - {"type": "function", "function": {"name": "read_file", "description": "Read a text file in the working directory.", - "parameters": {"type": "object", "properties": {"path": {"type": "string"}}, "required": ["path"]}}}, - {"type": "function", "function": {"name": "write_file", "description": "Write a whole text file in the working directory.", - "parameters": {"type": "object", "properties": {"path": {"type": "string"}, "content": {"type": "string"}}, - "required": ["path", "content"]}}}, - {"type": "function", "function": {"name": "list_files", "description": "List the files under a folder of the working directory.", - "parameters": {"type": "object", "properties": {"path": {"type": "string"}}}}}, - {"type": "function", "function": {"name": "run", "description": "Run a shell command in the working directory (60 s at most).", - "parameters": {"type": "object", "properties": {"command": {"type": "string"}}, "required": ["command"]}}}, -] - -lock = threading.Lock() -sessions = {} - - -def send(msg): - with lock: - sys.stdout.write(json.dumps(msg) + "\n") - sys.stdout.flush() - - -def update(sid, u): - send({"jsonrpc": "2.0", "method": "session/update", "params": {"sessionId": sid, "update": u}}) - - -class Mcp: - """A stdio MCP server the session was given: started once, asked for its - tools, called by name.""" - - def __init__(self, spec, cwd): - env = dict(os.environ, **{e["name"]: e["value"] for e in spec.get("env") or []}) - self.name = spec["name"] - self.p = subprocess.Popen([spec["command"]] + list(spec.get("args") or []), cwd=cwd, env=env, stdin=subprocess.PIPE, - stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, text=True, bufsize=1) - self.n = 0 - self.ask("initialize", {"protocolVersion": "2025-06-18", "capabilities": {}, "clientInfo": {"name": "reference", "version": "1"}}) - self.p.stdin.write(json.dumps({"jsonrpc": "2.0", "method": "notifications/initialized"}) + "\n") - self.p.stdin.flush() - self.tools = self.ask("tools/list", {}).get("tools") or [] - - def ask(self, method, params): - self.n += 1 - self.p.stdin.write(json.dumps({"jsonrpc": "2.0", "id": self.n, "method": method, "params": params}) + "\n") - self.p.stdin.flush() - for line in self.p.stdout: - m = json.loads(line) - if m.get("id") == self.n: - if "error" in m: - raise RuntimeError(m["error"].get("message")) - return m.get("result") or {} - raise RuntimeError(f"MCP server {self.name} ended") - - def call(self, tool, args): - r = self.ask("tools/call", {"name": tool, "arguments": args}) - text = "\n".join(c.get("text") or json.dumps(c) for c in r.get("content") or []) - return ("Error: " if r.get("isError") else "") + text - - -def inside(cwd, path): - p = os.path.realpath(os.path.join(cwd, path or ".")) - if p != os.path.realpath(cwd) and not p.startswith(os.path.realpath(cwd) + os.sep): - raise ValueError(f"{path} is outside the working directory") - return p - - -def run_tool(s, name, args): - cwd = s["cwd"] - if name == "read_file": - with open(inside(cwd, args["path"]), errors="replace") as f: - return f.read()[:OUT_LIMIT] - if name == "write_file": - p = inside(cwd, args["path"]) - os.makedirs(os.path.dirname(p), exist_ok=True) - with open(p, "w") as f: - f.write(args.get("content") or "") - return f"wrote {len(args.get('content') or '')} characters to {args['path']}" - if name == "list_files": - base = inside(cwd, args.get("path") or ".") - out = [] - for root, dirs, files in os.walk(base): - dirs[:] = [d for d in dirs if not d.startswith(".")] - out += [os.path.relpath(os.path.join(root, f), cwd) for f in files] - return "\n".join(sorted(out)[:500]) or "(empty)" - if name == "run": - try: - r = subprocess.run(args["command"], shell=True, cwd=cwd, capture_output=True, text=True, timeout=60) - out = (r.stdout + r.stderr)[-OUT_LIMIT:] - return f"exit {r.returncode}\n{out}" - except subprocess.TimeoutExpired: - return "Error: the command did not end in 60 s" - server, _, tool = name.partition("__") - for m in s["mcp"]: - if m.name == server: - return m.call(tool, args) - raise ValueError(f"no tool {name}") - - -def model(messages, tools): - body = {"model": os.environ.get("REFERENCE_MODEL") or "default", "messages": messages, "tools": tools} - req = urllib.request.Request(os.environ["OPENAI_BASE_URL"].rstrip("/") + "/chat/completions", data=json.dumps(body).encode(), - headers={"Content-Type": "application/json", "Authorization": "Bearer " + os.environ.get("OPENAI_API_KEY", "")}) - with urllib.request.urlopen(req, timeout=600) as r: - return json.loads(r.read())["choices"][0]["message"] - - -def turn(rid, sid, text): - s = sessions[sid] - s["messages"].append({"role": "user", "content": text}) - tools = OWN_TOOLS + [{"type": "function", "function": {"name": f"{m.name}__{t['name']}", "description": t.get("description") or "", - "parameters": t.get("inputSchema") or {"type": "object", "properties": {}}}} - for m in s["mcp"] for t in m.tools] - try: - for step in range(MAX_STEPS): - if s["cancelled"]: - send({"jsonrpc": "2.0", "id": rid, "result": {"stopReason": "cancelled"}}) - return - msg = model(s["messages"], tools) - calls = msg.get("tool_calls") or [] - s["messages"].append({k: v for k, v in msg.items() if k in ("role", "content", "tool_calls")}) - if msg.get("content"): - update(sid, {"sessionUpdate": "agent_message_chunk", "content": {"type": "text", "text": msg["content"]}}) - if not calls: - send({"jsonrpc": "2.0", "id": rid, "result": {"stopReason": "end_turn"}}) - return - for c in calls: - name = c["function"]["name"] - try: - args = json.loads(c["function"].get("arguments") or "{}") - except ValueError: - args = {} - kind = {"read_file": "read", "write_file": "edit", "list_files": "search", "run": "execute"}.get(name, "other") - update(sid, {"sessionUpdate": "tool_call", "toolCallId": c["id"], "title": name, "kind": kind, - "status": "in_progress", "rawInput": args}) - try: - out, status = run_tool(s, name, args), "completed" - except Exception as e: - out, status = f"Error: {e}", "failed" - update(sid, {"sessionUpdate": "tool_call_update", "toolCallId": c["id"], "status": status, - "content": [{"type": "content", "content": {"type": "text", "text": out}}]}) - s["messages"].append({"role": "tool", "tool_call_id": c["id"], "content": out}) - send({"jsonrpc": "2.0", "id": rid, "result": {"stopReason": "max_turn_requests"}}) - except urllib.error.HTTPError as e: - send({"jsonrpc": "2.0", "id": rid, "error": {"code": -32000, "message": f"model: HTTP {e.code}: {e.read()[:300].decode('utf-8', 'replace')}"}}) - except Exception as e: - send({"jsonrpc": "2.0", "id": rid, "error": {"code": -32000, "message": f"{type(e).__name__}: {e}"}}) - - -def main(): - for line in sys.stdin: - try: - m = json.loads(line) - except ValueError: - continue - method, params, rid = m.get("method"), m.get("params") or {}, m.get("id") - if method == "initialize": - send({"jsonrpc": "2.0", "id": rid, "result": {"protocolVersion": 1, "agentCapabilities": { - "loadSession": False, "promptCapabilities": {"image": False, "audio": False, "embeddedContext": False}}, - "agentInfo": {"name": "reference", "version": "1"}}}) - elif method == "session/new": - sid = f"ref-{len(sessions) + 1}" - try: - servers = [Mcp(x, params["cwd"]) for x in params.get("mcpServers") or []] - except Exception as e: - send({"jsonrpc": "2.0", "id": rid, "error": {"code": -32000, "message": f"MCP server: {e}"}}) - continue - sessions[sid] = {"cwd": params["cwd"], "mcp": servers, "cancelled": False, - "messages": [{"role": "system", "content": SYSTEM.format(cwd=params["cwd"])}]} - send({"jsonrpc": "2.0", "id": rid, "result": {"sessionId": sid}}) - elif method == "session/prompt": - text = "\n".join(c.get("text") or "" for c in params.get("prompt") or [] if c.get("type") == "text") - sessions[params["sessionId"]]["cancelled"] = False - threading.Thread(target=turn, args=(rid, params["sessionId"], text), daemon=True).start() - elif method == "session/cancel": - if params.get("sessionId") in sessions: - sessions[params["sessionId"]]["cancelled"] = True - elif rid is not None and method: - send({"jsonrpc": "2.0", "id": rid, "error": {"code": -32601, "message": f"{method} is not supported"}}) - - -if __name__ == "__main__": - main() diff --git a/app/nullius/catalogue/agents/reference/proofs.json b/app/nullius/catalogue/agents/reference/proofs.json deleted file mode 100644 index ccaab3764..000000000 --- a/app/nullius/catalogue/agents/reference/proofs.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "schema": "nullius.proofs/v1", - "kind": "agent", - "key": "reference", - "versions": { - "1": { - "offers": [ - "agent.task/v1", - "agent.workspace/v1", - "agent.tools/v1", - "agent.conversation/v1" - ], - "proven": { - "agent.task/v1": { - "passed": "3/3", - "model": "openai/gpt-5-mini", - "provider": "openrouter", - "version": "1", - "kit_version": 1, - "backend": "docker" - }, - "agent.workspace/v1": { - "passed": "2/2", - "model": "openai/gpt-5-mini", - "provider": "openrouter", - "version": "1", - "kit_version": 1, - "backend": "docker" - }, - "agent.tools/v1": { - "passed": "2/2", - "model": "openai/gpt-5-mini", - "provider": "openrouter", - "version": "1", - "kit_version": 2, - "backend": "docker", - "skills": { - "decoys": { - "passed": "1/1", - "ok": true - }, - "chain": { - "passed": "1/1", - "ok": true - }, - "retry": { - "passed": "1/1", - "ok": true - } - } - }, - "agent.conversation/v1": { - "passed": "2/2", - "model": "openai/gpt-5-mini", - "provider": "openrouter", - "version": "1", - "kit_version": 1, - "backend": "docker" - } - } - } - } -} diff --git a/app/nullius/standard/cli.py b/app/nullius/standard/cli.py index 7e9e2d01b..77d1291c5 100644 --- a/app/nullius/standard/cli.py +++ b/app/nullius/standard/cli.py @@ -473,7 +473,7 @@ def cmd_new(a): f.write(text + ("\n" if not text.endswith("\n") else "")) print("wrote", path) if kind == "benchmark": - then = f"cli run {key} reference --model gpt-5-mini --limit 2 --unsandboxed" + then = f"cli run {key} goose --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": @@ -778,7 +778,7 @@ def cmd_merge(a): nullius standard set show humaneval first-ten --json nullius standard set rename humaneval misses "misses of June" nullius standard set delete humaneval misses-of-june - nullius standard run humaneval reference --model M --set first-ten --unsandboxed + nullius standard run humaneval goose --model M --set first-ten --unsandboxed exit codes: 0 done diff --git a/app/nullius/standard/pages/recipe.py b/app/nullius/standard/pages/recipe.py index 8cd5dd78e..88848d3a7 100644 --- a/app/nullius/standard/pages/recipe.py +++ b/app/nullius/standard/pages/recipe.py @@ -353,7 +353,7 @@ def choices() -> dict: # one entry per benchmark, its default version, which lists the others (``versions``); the fits cover every version defaults = [b for b in d["benchmark"] if b.get("_version") == b.get("_default")] return {"benchmarks": [_with_versions(b) for b in defaults], - # an example (the reference agent, the example memory) is there to read or copy, never to choose + # an example (the example memory) is there to read or copy, never to choose "agents": [_other_page(o) for o in d["agent"] + definitions.benchmark_agents(d["benchmark"]) if not o.get("example")], "capabilities": [_other_page(o) for o in d["capability"] if not o.get("example")], "fits": match.table(d["benchmark"], d["agent"], d["capability"]), diff --git a/app/templates/agents/standard.html b/app/templates/agents/standard.html index 24350d45e..260248fac 100644 --- a/app/templates/agents/standard.html +++ b/app/templates/agents/standard.html @@ -28,7 +28,7 @@ {% endfor %} -

The whole contract: docs/standard.md in the source checkout. A bundled example to read: {{ example_dir }}.

+

The whole contract: docs/standard.md in the source checkout.{% if example_dir %} A bundled example to read: {{ example_dir }}.{% endif %}

{% endcall %} {% if problems %}
Not offered: a definition with problems
    {% for p in problems %}
  • {{ p }}
  • {% endfor %}
{% endif %} diff --git a/app/tests/test_execution.py b/app/tests/test_execution.py index 11486e32c..14118b3e5 100644 --- a/app/tests/test_execution.py +++ b/app/tests/test_execution.py @@ -899,7 +899,7 @@ def test_what_it_does_is_said_in_stages_its_own_and_the_cli_s(self): self.plan.docker = True self.part_log = "".join(progress.line(*a, **kw) + "\n" for a, kw in [ (("plan",), {"stages": "image,install,units"}), (("image", "start"), {"detail": "building nullius/base:abc (first time on this machine)"}), - (("image", "done"), {"seconds": 95}), (("install", "cached"), {"agent": "reference"}), + (("image", "done"), {"seconds": 95}), (("install", "cached"), {"agent": "goose"}), (("units", "start"), {"n": 2, "noun": "problems"}), (("unit", "done"), {"i": 1, "of": 2, "unit": "p/1", "outcome": "passed", "reward": 1.0})]) ex = self.run_it() self.assertEqual(ex.state, "done", ex.lines) @@ -908,7 +908,7 @@ def test_what_it_does_is_said_in_stages_its_own_and_the_cli_s(self): [("plan", None), ("connect", "start"), ("connect", "done"), ("uv", "cached"), ("app", "start"), ("app", "done")]) got = ex.summary()["stages"] self.assertEqual([(s["key"], s["state"]) for s in got["stages"]], - [("connect", "done"), ("uv", "cached"), ("app", "done"), ("image", "done"), ("install:reference", "cached"), ("units", "done")]) + [("connect", "done"), ("uv", "cached"), ("app", "done"), ("image", "done"), ("install:goose", "cached"), ("units", "done")]) self.assertIsNone(got["current"]) self.assertEqual((got["units"]["n"], got["units"]["done"], got["units"]["passed"]), (2, 1, 1)) back = execution.Execution(self.plan, root=str(self.tmp / "runs"), run=self.answer, diff --git a/app/tests/test_provider_registry.py b/app/tests/test_provider_registry.py index 131c4d87c..0d304e0b3 100644 --- a/app/tests/test_provider_registry.py +++ b/app/tests/test_provider_registry.py @@ -109,8 +109,8 @@ def test_a_consumer_gets_the_providers_that_may_serve_its_protocol(self): self.assertEqual(providers.protocol_for("anthropic", ["chat", "messages"], env), "messages") self.assertEqual(run.key_header("anthropic", {"model": {"apis": ["messages"]}}, env), "x-api-key") self.assertEqual(run.key_header("openrouter", {"model": {"apis": ["chat"]}}, env), "authorization") - with self.assertRaisesRegex(run.Refused, "Anthropic does not serve what reference speaks"): - run.key_header("anthropic", {"key": "reference", "model": {"apis": ["chat"]}}, env) # as recipe.compile refuses it + with self.assertRaisesRegex(run.Refused, "Anthropic does not serve what chat-agent speaks"): + run.key_header("anthropic", {"key": "chat-agent", "model": {"apis": ["chat"]}}, env) # as recipe.compile refuses it def test_each_judge_setting_takes_only_a_provider_that_judge_can_use(self): s1, llm = settings.BY_NAME["DECISION_PROVIDER"].validate, settings.BY_NAME["LLM_JUDGE_PROVIDER"].validate diff --git a/app/tests/test_standard_definitions.py b/app/tests/test_standard_definitions.py index 6d9e2cbd1..4ed505bd5 100644 --- a/app/tests/test_standard_definitions.py +++ b/app/tests/test_standard_definitions.py @@ -116,7 +116,7 @@ def test_an_example_is_marked_true_or_false_on_an_agent_or_a_feature(self): self.assertEqual(definitions.problems(dict(AGENT, example=True), "agent"), []) self.bad(AGENT, "agent", lambda d: d.update(example="yes"), "example: true or false") self.bad(BENCH, "benchmark", lambda d: d.update(example=True), "example: true or false") - self.assertIs(definitions.get("agent", "reference", definitions.CATALOGUE).get("example"), True) + self.assertIs(definitions.get("capability", "keyword-memory", definitions.CATALOGUE).get("example"), True) def test_task_parts_require_distinct_names_and_task_prefixes(self): part = {"id": "office", "label": "Office tasks", "prefixes": ["writer__"]} diff --git a/app/tests/test_standard_payload.py b/app/tests/test_standard_payload.py index edc459543..47cf31800 100644 --- a/app/tests/test_standard_payload.py +++ b/app/tests/test_standard_payload.py @@ -271,19 +271,19 @@ def test_an_altered_or_contaminated_cached_snapshot_is_never_reused(self): self.build() def test_real_runtime_snapshot_loads_user_definition_from_an_unrelated_directory(self): - source = payload.PACKAGE / "catalogue/agents/reference" - entry = self.catalogue / "agents/reference" + source = payload.PACKAGE / "catalogue/agents/goose" + entry = self.catalogue / "agents/goose" shutil.copytree(source, entry) definition = definitions.read_document(str(entry / "agent.json"), "agent") - definition["label"] = "User reference" + definition["label"] = "User Goose" self.write(entry / "proofs.json", proofs.document(definition, "agent")) self.write(entry / "agent.json", proofs.strip(definition)) - expected = definitions.get("agent", "reference", root=str(self.catalogue)) + expected = definitions.get("agent", "goose", root=str(self.catalogue)) key, here = payload.build(str(self.cache)) self.assertFalse((Path(here) / "app/.env").exists()) other = self.tmp / "elsewhere"; other.mkdir() ran = subprocess.run([sys.executable, "-c", "import json; from nullius.standard.contract import definitions; " - "d = definitions.get('agent', 'reference'); " + "d = definitions.get('agent', 'goose'); " "print(json.dumps({k: d[k] for k in ('label', 'offers', 'proven')}))"], cwd=other, env=dict(os.environ, PYTHONPATH=str(Path(here) / "app"), NULLIUS_CATALOGUE=str(Path(here) / "app/nullius/catalogue")), @@ -292,37 +292,37 @@ def test_real_runtime_snapshot_loads_user_definition_from_an_unrelated_directory self.assertEqual(json.loads(ran.stdout), {k: expected[k] for k in ("label", "offers", "proven")}) def test_proof_metadata_saves_to_the_selected_catalogue_without_mutating_the_snapshot(self): - source = payload.PACKAGE / "catalogue/agents/reference" - local = self.catalogue / "agents/reference" + source = payload.PACKAGE / "catalogue/agents/goose" + local = self.catalogue / "agents/goose" shutil.copytree(source, local) definition = json.loads((local / "agent.json").read_text()) - definition["label"] = "Selected reference" + definition["label"] = "Selected Goose" self.write(local / "agent.json", definition) key, here = payload.build(str(self.cache)) frozen = Path(here) / "app/nullius/catalogue" snapshot_before = {p.relative_to(here): p.read_bytes() for p in Path(here).rglob("*") if p.is_file()} remote = self.tmp / "remote-run/catalogue" shutil.copytree(frozen, remote) - ambient = self.tmp / "host-profile/data/catalogue/agents/reference" + ambient = self.tmp / "host-profile/data/catalogue/agents/goose" shutil.copytree(source, ambient) untouched = (ambient / "agent.json").read_bytes() other = self.tmp / "elsewhere"; other.mkdir() for selected in (self.catalogue, remote): with self.subTest(selected=selected): - authored = selected / "agents/reference/agent.json" + authored = selected / "agents/goose/agent.json" before = authored.read_bytes() ran = subprocess.run([sys.executable, "-c", "from nullius.standard.contract import definitions; " - "d = definitions.get('agent', 'reference'); " - "assert d['label'] == 'Selected reference'; " + "d = definitions.get('agent', 'goose'); " + "assert d['label'] == 'Selected Goose'; " "d.setdefault('proven', {})['fixture-proof'] = {'job': 'fixture-evidence'}; " "definitions.save(d); print(d['_here'])"], cwd=other, env=dict(os.environ, PYTHONPATH=str(Path(here) / "app"), PYTHONDONTWRITEBYTECODE="1", NULLIUS_HOME=str(self.tmp / "host-profile"), NULLIUS_CATALOGUE=str(selected)), capture_output=True, text=True) self.assertEqual(ran.returncode, 0, ran.stderr) - self.assertEqual(ran.stdout.strip(), str(selected / "agents/reference")) - saved = json.loads((selected / "agents/reference/proofs.json").read_text()) + self.assertEqual(ran.stdout.strip(), str(selected / "agents/goose")) + saved = json.loads((selected / "agents/goose/proofs.json").read_text()) version = definitions.versions(definition)[0] self.assertEqual(saved["versions"][version]["proven"]["fixture-proof"], {"job": "fixture-evidence"}) self.assertEqual(authored.read_bytes(), before) @@ -347,13 +347,13 @@ def test_installed_local_execution_has_one_backend_provider_and_keeps_helpers_an env=env, capture_output=True, text=True, check=True).stdout.strip() installed = Path(site) / "nullius" shutil.copytree(payload.PACKAGE, installed, ignore=shutil.ignore_patterns("__pycache__")) - shutil.copytree(installed / "catalogue/agents/reference", self.catalogue / "agents/reference") + shutil.copytree(installed / "catalogue/agents/goose", self.catalogue / "agents/goose") self.write(installed / "standard/cli.py", '''import json, os, pathlib, sys import nullius from nullius.standard.contract import definitions providers = sorted({str((pathlib.Path(p or os.getcwd()) / "nullius").resolve()) for p in sys.path if (pathlib.Path(p or os.getcwd()) / "nullius").is_dir()}) -definition = definitions.get("agent", "reference") +definition = definitions.get("agent", "goose") if "--no-proof" not in sys.argv: definition.setdefault("proven", {})["fixture-proof"] = {"job": "fixture-evidence"} definitions.save(definition) @@ -417,15 +417,15 @@ def inventory(): self.assertEqual((probe["isolated"], probe["no_site"]), (1, 1)) self.assertTrue(probe["no_bytecode"]) self.assertTrue(probe["helper_exists"]) - self.assertEqual(probe["catalogue_entry"], str(self.catalogue / "agents/reference")) + self.assertEqual(probe["catalogue_entry"], str(self.catalogue / "agents/goose")) self.assertEqual(probe["args"], ["probe", "--from-run"]) - saved = json.loads((self.catalogue / "agents/reference/proofs.json").read_text()) - authored = self.catalogue / "agents/reference/agent.json" + saved = json.loads((self.catalogue / "agents/goose/proofs.json").read_text()) + authored = self.catalogue / "agents/goose/agent.json" version = definitions.versions(json.loads(authored.read_text()))[0] self.assertEqual(saved["versions"][version]["proven"]["fixture-proof"], {"job": "fixture-evidence"}) - self.assertEqual(authored.read_bytes(), (installed / "catalogue/agents/reference/agent.json").read_bytes()) + self.assertEqual(authored.read_bytes(), (installed / "catalogue/agents/goose/agent.json").read_bytes()) for root in (installed, snapshot / "app/nullius"): - untouched = definitions.read_document(str(root / "catalogue/agents/reference/agent.json"), "agent") + untouched = definitions.read_document(str(root / "catalogue/agents/goose/agent.json"), "agent") self.assertNotIn("fixture-proof", untouched.get("proven", {})) diff --git a/app/ui_tests/test_api.py b/app/ui_tests/test_api.py index a32fa4d82..10cfe4f63 100644 --- a/app/ui_tests/test_api.py +++ b/app/ui_tests/test_api.py @@ -304,8 +304,8 @@ def test_the_catalogue_names_what_a_recipe_names(self): got = self.get("/catalogue").json g = next(b for b in got["benchmarks"] if b["key"] == "gsm8k") self.assertEqual((g["runners"], [d["id"] for d in g["datasets"]]), (["standard"], ["test", "platinum"])) - self.assertIn("reference", g["fits"]) - self.assertIn("reference", [a["ref"] for a in got["agents"]]) + self.assertIn("goose", g["fits"]) + self.assertIn("goose", [a["ref"] for a in got["agents"]]) self.assertTrue(all(sorted(c) == ["key", "label", "offers", "ref", "summary"] for c in got["capabilities"])) self.assertTrue(all(sorted(c) == ["key", "label", "offers", "origin", "ref", "summary"] for c in got["agents"])) self.assertLessEqual({x["origin"] for x in got["benchmarks"] + got["agents"]}, set(catalog.ORIGINS)) diff --git a/app/ui_tests/test_builder_agents.py b/app/ui_tests/test_builder_agents.py index ac214d8c3..69a0486c9 100644 --- a/app/ui_tests/test_builder_agents.py +++ b/app/ui_tests/test_builder_agents.py @@ -49,8 +49,9 @@ def test_the_version_procedure_is_the_first_card_and_other_benchmarks_agents_are self.assertIn(">LoCoMo · full", cards["original"]) # the version's, no commit for c in cards.values(): # origin, protocol, source: filters self.assertNotIn("origin-tag", c); self.assertNotIn("bench-harness", c); self.assertNotIn("std-tag", c) - html, _ = self.grid("gsm8k") - self.assertNotIn('data-value="reference"', html) + html, mem = self.grid("longmemeval") + self.assertIn("mem0", mem) + self.assertNotIn("keyword-memory", html) # an example, there to read, never to choose for k, c in cards.items(): if k.startswith("osworld"): self.assertIn(" disabled", c) diff --git a/app/ui_tests/test_run_routes.py b/app/ui_tests/test_run_routes.py index a456c9b4e..6caa65561 100644 --- a/app/ui_tests/test_run_routes.py +++ b/app/ui_tests/test_run_routes.py @@ -205,7 +205,7 @@ def test_the_run_s_page_shows_its_stages_and_its_units(self): that follows it and in what the page polls.""" from nullius import progress lines = [progress.line("plan", stages="image,install,units"), progress.line("image", "done", seconds=41), - progress.line("install", "cached", agent="reference"), progress.line("units", "start", n=10, noun="problems"), + progress.line("install", "cached", agent="goose"), progress.line("units", "start", n=10, noun="problems"), progress.line("unit", "done", i=1, of=10, unit="p/1", outcome="passed", reward=1.0), progress.line("unit", "done", i=2, of=10, unit="p/2", outcome="failed", reward=0.0)] script = "".join(f"printf '%s\\n' {shlex.quote(l)}\n" for l in lines) + "sleep 30\n" @@ -217,12 +217,12 @@ def test_the_run_s_page_shows_its_stages_and_its_units(self): time.sleep(0.02) s = self.client.get(f"/run/{r.json['id']}"); self.addCleanup(s.close) got = s.json["stages"] - self.assertEqual([(st["key"], st["state"]) for st in got["stages"]], [("image", "done"), ("install:reference", "cached"), ("units", "running")]) + self.assertEqual([(st["key"], st["state"]) for st in got["stages"]], [("image", "done"), ("install:goose", "cached"), ("units", "running")]) self.assertEqual((got["units"]["done"], got["units"]["n"], got["units"]["passed"], got["units"]["failed"]), (2, 10, 1, 1)) page = self.client.get("/job/std-x"); self.addCleanup(page.close) html = page.get_data(as_text=True) self.assertIn('
  • Base image41.00s', html) - self.assertIn('