Skip to content
Open
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
11 changes: 10 additions & 1 deletion app/nullius/catalogue/benchmarks/locomo/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,15 @@ def units(dataset, setup=None):
return {"units": out}


def describe(dataset, **_):
out = {}
for unit in units(dataset)["units"]:
q = question(unit)[1]
text = q["question"]
out[unit] = {"title": text, "text": text, "categories": {"category": str(q["category"])}}
return {"units": out}


# What goes into the memory for each session: the run's ``rag_mode`` option, LoCoMo's --rag-mode - dialog
# (the conversation), or the authors' own released extractions, observation (facts per speaker) and
# summary (one per session). How a fact or a summary is put as a turn is ours: a fact is its speaker's
Expand Down Expand Up @@ -259,7 +268,7 @@ def oracle(unit, dir):
return {"answer": gold(q)}


HANDLERS = {"units": units, "setup": setup, "produce": produce, "score": score, "oracle": oracle, "answer": answer}
HANDLERS = {"describe": describe, "units": units, "setup": setup, "produce": produce, "score": score, "oracle": oracle, "answer": answer}
for line in sys.stdin:
try:
req = json.loads(line)
Expand Down
1 change: 1 addition & 0 deletions app/nullius/catalogue/benchmarks/locomo/standard.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"license": "CC-BY-NC-4.0"
},
"driver": {
"describe": true,
"command": [
"{install}/.venv/bin/python",
"{here}/driver.py"
Expand Down
11 changes: 10 additions & 1 deletion app/nullius/catalogue/benchmarks/longmemeval/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,15 @@ def units(dataset, setup=None):
return {"units": [q for q in index() if kind == "all" or TYPES[q] == kind]}


def describe(dataset, **_):
out = {}
for unit in units(dataset)["units"]:
q = entry(unit)
text = q["question"]
out[unit] = {"title": text, "text": text, "categories": {"question_type": str(q["question_type"])}}
return {"units": out}


def setup(unit, dir):
q = entry(unit)
dates = q.get("haystack_dates") or [""] * len(q["haystack_session_ids"])
Expand Down Expand Up @@ -373,7 +382,7 @@ def score_setup(unit, dir, judge):
("expansion_join", "separate"), ("gen_length", "upstream"))}}}


HANDLERS = {"units": units, "setup": setup, "produce": produce, "score": score, "oracle": oracle, "answer": answer}
HANDLERS = {"describe": describe, "units": units, "setup": setup, "produce": produce, "score": score, "oracle": oracle, "answer": answer}
for line in sys.stdin:
try:
req = json.loads(line)
Expand Down
1 change: 1 addition & 0 deletions app/nullius/catalogue/benchmarks/longmemeval/standard.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"license": "MIT"
},
"driver": {
"describe": true,
"command": [
"{install}/.venv/bin/python",
"{here}/driver.py"
Expand Down
18 changes: 17 additions & 1 deletion app/nullius/catalogue/benchmarks/osworld1/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

units - every task of the dataset (one of the upstream's
evaluation_examples/test_*.json), as domain__id, in the file's order
describe - each task's instruction (its title the first words) and its domain,
from the task's file alone
setup - the task's instruction, for the null control. For an agent
(participant "agent", which the definition's driver.participant
asks Nullius to send): runner.py started in the trial's
Expand Down Expand Up @@ -164,6 +166,19 @@ def units(dataset=None, setup=None):
return {"units": [f"{d}__{e}" for d, ids in meta.items() for e in ids]}


def describe(dataset=None, **_):
"""Each task of the dataset from its file alone: the instruction as its text (its title the first words),
its domain as a category."""
out = {}
for unit in units()["units"]:
domain, _eid, example = _task(unit)
text = str(example.get("instruction") or "")
line = " ".join(text.split())
title = line if len(line) <= 100 else line[:100].rsplit(" ", 1)[0] + " ..."
out[unit] = {"title": title, "text": text, "categories": {"domain": domain}}
return {"units": out}


def setup(unit, dir, participant=None, **_):
until = time.time() + SETUP_SECONDS - REAP_SECONDS - REMOVE_SECONDS - ANSWER_SECONDS # an agent's setup's own
instruction = _task(unit)[2]["instruction"]
Expand Down Expand Up @@ -856,7 +871,8 @@ def score(unit, dir, transcript=None, answer=None, setup=None, **_):
return _scored(where, "nop.py, DesktopEnv.evaluate")


HANDLERS = {"units": units, "setup": setup, "task_given": task_given, "answer": answer, "score": score, "end": end}
HANDLERS = {"units": units, "describe": describe, "setup": setup, "task_given": task_given, "answer": answer,
"score": score, "end": end}


def main():
Expand Down
22 changes: 22 additions & 0 deletions app/nullius/catalogue/benchmarks/osworld1/standard.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@
},
"participant": true,
"unit_end": true,
"describe": true,
"list_command": [
"python3",
"{here}/driver.py",
"{here}/agents.json",
"{here}/nop.py",
"{here}/runner.py"
],
"task_given": true
},
"mcp_servers": {
Expand All @@ -50,6 +58,7 @@
{
"id": "test_nogdrive",
"label": "Without Google Drive",
"subset_of": "test_all",
"summary": "The upstream's test_nogdrive.json: every task but the 8 that need a Google account's credentials.",
"path": "evaluation_examples/test_nogdrive.json",
"sha256": "fcb9497e93a8986407345d3012c872c9c2fed253420730fbea64ccfcace67dbb",
Expand All @@ -66,6 +75,7 @@
{
"id": "test_small",
"label": "Small",
"subset_of": "test_all",
"summary": "The upstream's test_small.json: a few tasks of each domain.",
"path": "evaluation_examples/test_small.json",
"sha256": "bb29275171b78728d71825b125af311d74e66bb2a6d693c45c497d380b1fc640",
Expand All @@ -74,6 +84,7 @@
{
"id": "test_infeasible",
"label": "Infeasible",
"subset_of": "test_all",
"summary": "The upstream's test_infeasible.json: tasks that cannot be done, passed by answering FAIL.",
"path": "evaluation_examples/test_infeasible.json",
"sha256": "1b447d0462b1bdac4b660e0dd6e6add6d01c17a9e684702c701abcffda409abb",
Expand Down Expand Up @@ -264,6 +275,7 @@
{
"id": "test_nogdrive",
"label": "Without Google Drive",
"subset_of": "test_all",
"summary": "The upstream's test_nogdrive.json: every task but the 8 that need a Google account's credentials. The live MBTA booking task is retired at this release.",
"path": "evaluation_examples/test_nogdrive.json",
"sha256": "9270c11fe809eb4c4e35a78a47cdb50717ea76557c1b9164c183e8e8b8d9ce91",
Expand All @@ -280,6 +292,7 @@
{
"id": "test_small",
"label": "Small",
"subset_of": "test_all",
"summary": "The upstream's test_small.json: a few tasks of each domain.",
"path": "evaluation_examples/test_small.json",
"sha256": "bb29275171b78728d71825b125af311d74e66bb2a6d693c45c497d380b1fc640",
Expand All @@ -288,6 +301,7 @@
{
"id": "test_infeasible",
"label": "Infeasible",
"subset_of": "test_all",
"summary": "The upstream's test_infeasible.json: tasks that cannot be done, passed by answering FAIL.",
"path": "evaluation_examples/test_infeasible.json",
"sha256": "1b447d0462b1bdac4b660e0dd6e6add6d01c17a9e684702c701abcffda409abb",
Expand All @@ -310,6 +324,14 @@
},
"participant": true,
"unit_end": true,
"describe": true,
"list_command": [
"python3",
"{here}/driver.py",
"{here}/agents.json",
"{here}/nop.py",
"{here}/runner.py"
],
"task_given": true
},
"setups": {
Expand Down
6 changes: 4 additions & 2 deletions app/nullius/execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -1140,10 +1140,12 @@ def _app_here(self) -> Optional[tuple]:

The exact code imported here travels, including source edits, so
installed wheels and editable checkouts have the same behaviour.
Configuration and credential stores are not payload inputs.
Configuration and credential stores are not payload inputs; the
task sets the recipe runs are, from the user catalogue.
"""
try:
return standard_payload.build(app_root(self.root), catalogue=self._catalogue)
return standard_payload.build(app_root(self.root), catalogue=self._catalogue,
sets=standard_payload.recipe_sets(self.plan.recipe))
except (OSError, ValueError) as e:
self._fail("app", "the standard runner could not be packed: " + str(e)[-300:])
return None
Expand Down
2 changes: 1 addition & 1 deletion app/nullius/migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def add(dest, data, mode=0o600):
bundled = Path(__file__).resolve().parent / "catalogue"
source_catalogue = checkout / "app" / "nullius" / "catalogue"
pending.catalogue_snapshot = source_catalogue.resolve() == bundled.resolve()
for kind in ("benchmarks", "agents", "features", "capabilities"):
for kind in ("benchmarks", "agents", "features", "capabilities", "sets"):
parent = source_catalogue / kind
_no_symlinks(parent)
if not parent.exists():
Expand Down
10 changes: 9 additions & 1 deletion app/nullius/runs/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
# The shape this module produces. A workspace caches parsed Jobs keyed on it,
# so bump it when a Trial or Job field is added, renamed or means something
# new — otherwise a cache written by the old parse is read back as current.
SCHEMA = "19"
SCHEMA = "20"

# What a rate-limit record in `agent/gateway.log` looks like. The agent's SDK
# retries a 429 below the harness, so a limit the run survived leaves nothing in result.json —
Expand Down Expand Up @@ -452,6 +452,9 @@ class Job:
launch_id: str = ""
# Source job names explicitly recorded by standard merge.
merged_from: list[str] = field(default_factory=list)
# The task set a Nullius standard job ran (config ``standard.task_set``): its name, its label (its name for a
# job from before labels) and id, its benchmark, and ``units``, its number of ids. {} for every other job.
task_set: dict = field(default_factory=dict)
# How the job was launched, as its config.json recorded it with Harbor's
# defaults filled in (launch_of). Empty when config.json is absent.
launch: dict = field(default_factory=dict)
Expand Down Expand Up @@ -1198,6 +1201,11 @@ def parse_job(job_dir: str, reuse=None, trials: bool = True) -> Job:
job.launch_id = str(std.get("launch") or "")
merged = std.get("merged_from")
job.merged_from = [s["job"] for s in merged if isinstance(s, dict) and isinstance(s.get("job"), str) and s["job"]] if isinstance(merged, list) else []
ts = std.get("task_set") if isinstance(std.get("task_set"), dict) else {}
job.task_set = ({"name": str(ts["name"]), "label": str(ts.get("label") or ts["name"]),
"id": str(ts.get("id") or ""), "benchmark": str(std.get("benchmark") or ""),
"units": len(ts["units"]) if isinstance(ts.get("units"), list) else 0}
if isinstance(ts.get("name"), str) and ts["name"] else {})
job.budget = _budget(res.get("budget"))
job.identity = identity_of(cfg, res, job.agent_version)
job.standard = bool(std)
Expand Down
Loading
Loading