Skip to content
Merged
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
4 changes: 4 additions & 0 deletions .agents/skills/import-benchmark/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ ours: none | <file: what, why>
then one row per thing that cannot run or differs from the paper (skip /
local change / issue), and the questions, with the question tool.

An entry with a `standard.json`: hand over to `/label-benchmark` for its
Leaderboard labels, unless the user declines. A Harbor-only entry has no labels
yet: say so.

## Catalogue presentation

Keep the benchmark description and each option summary to a short sentence.
Expand Down
3 changes: 3 additions & 0 deletions .agents/skills/import-standard/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,9 @@ question tool. No account of what was read: a `checked:` list at most.
Every change is local first. Pull requests, issues and anything upstream are
asked about once it works, never by default.

A benchmark that fits: hand over to `/label-benchmark` for its Leaderboard
labels, unless the user declines.

## Catalogue presentation

Keep the benchmark description and each option summary to a short sentence.
Expand Down
203 changes: 203 additions & 0 deletions .agents/skills/label-benchmark/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
---
name: label-benchmark
description: Propose a benchmark's Leaderboard labels - which capabilities and domains each dataset and task counts for - as a labels.json for a person to accept. Use it after importing a benchmark (the import skills hand over to it), when a benchmark gets a new version, or when the user asks to label, tag or classify a benchmark's tasks for the Leaderboard, or to review or update its labels. Never runs the benchmark.
---

# Label a benchmark

Propose which Leaderboard axes each task of a benchmark counts for: what a field of the task's own data **declares**
(step 1), then **decision models** on every pair left (step 2). What is asked is never your choice: two runs give the
same proposal. You write it. A person accepts it.

- **Never run the benchmark.** Read its definition, README or paper, task listing and each task's input, expected
output or judge prompt. A first `units` listing may fetch the upstream and install its environment: say so first.
- **Never use the keys configured in Nullius.** They are for evaluations. Step 2's decisions go through
`SKILL/scripts/decide.py` alone, which has a key of its own: never through your own subagents, another model or
another route. Never read, print or pass `NULLIUS_LABEL_OPENROUTER_KEY`: the user sets it before starting you,
ideally a dedicated OpenRouter key with a low credit limit. Not set: ask, or stop after step 1.
- **Only the axes of `labels.AXES`** (`REPO/app/nullius/leaderboard/labels.py`), each defined in `definitions.json`.
A label outside them is reported as a proposal and never written.
- **Write only the format below.** The file is valid after any step: the user chooses how deep to go.
- **A reason never restates a task.** It states the evidence in general terms ("asks for confirmation before
paying"), never the task's question, its answer or its data. The same holds for the report.

Below, `REPO` is the absolute path of the checkout this skill is in, `SKILL` is `REPO/.agents/skills/label-benchmark`,
`KEY` the benchmark's key, `REF` the version labelled (`KEY` for its default or its only one, else `KEY@VERSION`) and
`WORK` a new folder outside the checkout, agreed with the user.

Choose the source entry first and keep it to the end: releases, prior labels, terms and tasks come from it alone. Only
a contribution the user asked for by name takes the bundled entry, even beside the user's own copy of `KEY`: each
`PYTHONPATH=` command then starts with the variable below, and `ENTRY` is `REPO/app/nullius/catalogue/benchmarks/KEY`.
Anything else takes the entry Nullius reads and never sets the variable.

A benchmark with no `standard.json` (a Harbor-only entry) cannot be labelled yet: say so and stop. The first command
prints where the entry, and a `labels.json` it already has, is read; the second, each release's identity and datasets.
Read `SKILL/definitions.json` whole first: its rules, and per axis its definition, when it holds (`in`) and when not
(`out`), which you and a person judge by, and the `questions` step 2 asks. A test not clearly met gives no label.
```bash
# a contribution: NULLIUS_CATALOGUE=REPO/app/nullius/catalogue before each PYTHONPATH=, here and below
PYTHONPATH=REPO/app python3 -c 'from nullius.catalogue import catalog; print(catalog.entry_dir("KEY"))'
PYTHONPATH=REPO/app python3 -c 'from nullius.standard.contract import definitions as d; [print(d.version_identity(b), [x["id"] for x in b.get("datasets") or []]) for b in d.load("benchmark", every=True)[0] if b["key"] == "KEY"]'
```

Never for a contribution, else last and only to write: this prints `ENTRY`, where the proposal goes, and copies a
bundled entry into user storage, where it replaces the bundled one. Say so first.
```bash
PYTHONPATH=REPO/app python3 -c 'from nullius.catalogue import catalog; print(catalog.writable_dir("KEY"))'
```

## The terms come first

Before any task text, read at the pinned commit and where the data is hosted: the code's and the data's licences
(`LICENSE*`, the README, the dataset card), a gate (terms or a form before the download), and a request against
resharing or training on the data (a canary line in the README, the card or the data files). Data kept in the code
repository with no card: each `LICENSE*` and README from the root down to the data's folder; a code licence silent on
the data is reported as that. Put each in the report, quoted, with its place, or `none found` with those searched.

Gated data, or data its authors ask not to reshare or to keep out of training: propose `units.redistribute: false` in
the benchmark's definition, as a ```diff block for the user. With it, proposed or already set, no task id goes anywhere:
not into `labels.json`, the report or a model. Skip both steps. Write dataset rules alone (no `tasks`), each from the
benchmark's own statement in its README, paper or dataset description: the one domain it defines the dataset as, or a
capability it says every task of the dataset is graded on. Never your reading of what a dataset is about. Such a rule
labels the dataset in every release the second command lists it in: the statement must hold for each. Then hand over.

## The format

`ENTRY/labels.json`:
```json
{"schema": 1, "labels": [
{"dataset": "retail", "checked": ["IDENTITY"], "tasks": ["17", "42"], "axes": ["Safety"]},
{"dataset": "retail", "checked": ["IDENTITY"], "tasks": ["42"], "not": ["Execution"]}
]}
```

- Under `units.redistribute: false`, dataset rules instead, never both: `{"dataset": "retail", "axes": ["Shopping"]}`.
- A rule selects the whole benchmark (no `dataset`), one dataset, or the listed `tasks` of one dataset. A task's axes
are the union of its rules' `axes`, minus their `not`. No other key, no prefix, no pattern.
- `dataset` is a dataset of the definition, never a cut of another (`subset_of`): name the dataset it is cut from.
- `tasks` are the exact ids `units` prints, never empty, and only on a rule with a `dataset`. Such a rule carries
`checked`, which a rule without `tasks` never does: the versions whose tasks you read, each by the identity a run
records for it, never a tag or a name read from the definition by hand:

```bash
PYTHONPATH=REPO/app python3 -c 'from nullius.standard.contract import definitions as d; print(d.version_identity(d.get("benchmark", "REF")))'
```
- A new version: add its identity, as the command above prints it for the new `REF`, to `checked` only for the tasks
whose bytes did not change, and only when the `policy` and whatever else a state is built from or a task is graded
by did not change either. Every other task goes through the steps.

## 1. Field rules

```bash
PYTHONPATH=REPO/app python3 -m nullius standard units REF --dataset D --json
PYTHONPATH=REPO/app python3 -m nullius standard units REF --dataset D --category FIELD=VALUE --json
PYTHONPATH=REPO/app python3 -c 'from nullius.standard.requirements import install; print(install.HOME)'
```

`units` prints each task's id, title and text, not its expected outcome or grading. Read those in the dataset's own
file: its `path` under `STANDARD/upstreams/KEY/TESTED/`, or under `STANDARD/datasets/` with a `url` (`STANDARD`: the
last command's output; `TESTED`: `upstream.tested` of `REF`). With neither: the upstream's own task loader there.

Labels cover the tasks `units` lists for each dataset with every option at its default. Those only another option
value lists (`--bench-option NAME=VALUE`, a split) go through the steps when the user asks; else the report names
those values. Two datasets with one task file (the same `path` and `sha256`) and the same assembled `policy` text, compared exactly (step 2): take one
through the steps and write its `tasks` rules for both. Either differs (a workflow variant's policy): both go through.

This step decides only a yes, and only from a field of the task's data that anyone can check again. A field whose
value, when present and not empty, is the axis's test gives a `tasks` rule over those tasks: a graded check that
lists what the agent must tell the user (Communication), a category the benchmark defines as one domain. A count, a
keyword, a tool's name or what the dataset is about is no such field. Show each field and its rule to the user.

## 2. Decision models

Decision models answer typed questions with a probability, without reasons. Write `WORK/tasks.jsonl`, a line per task:
a `state` of its own fields, as its data gives them. Every axis of `definitions.json` is asked, domain or capability,
but those in `skip`: the axes step 1 gave it, `[]` or left out for none. A line with `axes` is refused.
```json
{"dataset": "retail", "task": "42", "skip": ["Shopping"], "state": {"request": {...}, "checks": {...}, "given": {...}}}
```

- `request`: the task's input as the agent or the simulated person gets it, an object or a text. Required.
- `checks`: what the benchmark grades, and nothing else: where a task names the checks that count (a `reward_basis`,
a weight of zero), leave the others out. An empty value is evidence and stays: no action expected, an empty list.
- `policy`: the rules the agent actually receives for this dataset, whole, as the benchmark's driver assembles
them with each option at the `default` the definition gives it (a retrieval kind). Never a raw template.
- `given`: what the task hands the agent beyond those three: sources to consult, tools, by name, starting state,
earlier material (earlier sessions), who the person is (a profile, a history). From the task's own data: a
shared resource is named, not pasted; a per-task list wins over a benchmark-wide one. Never the answer or the grading: those stay in `checks`.
- `purpose`, `notes`, `ticket`: the task's own, when it has them. Any JSON, kept whole, under the data's own key
names. No other field. None is null itself (a field the task lacks is left out); a nested null stays.

One task of τ³-bench, a simulated-customer benchmark whose criteria hold a `reward_basis` and reference `actions`:

- `request`: the whole user scenario, persona and instructions, as the data nests them. The persona is not `given`.
- `checks`: the `reward_basis`, then only the criteria it names: what to tell the user under `COMMUNICATE`, the
assertions under `NL_ASSERTION` or `ENV_ASSERTION`. The reference `actions` go in when the basis grades the actions
(`ACTION`) or the state they lead to (`DB`): they define the target. Under neither, leave them out.
- `given`: `{"required_documents": [ids], "tools": {"agent": [names], "user": [names]}, "initial_state": {...}}`,
the tool names as the driver's environment lists them for the dataset: no schema, no database, no document text.

The state leaves the machine, to OpenRouter and to providers asked not to keep it. After the dry run, tell the user
how many tasks, pairs and calls, which models and the characters it counts: a dry run shows no cost. Its summary is
the last line of stderr; stdout, here `WORK/dryrun.jsonl`, holds every request whole and can reach tens of megabytes.
Wait for a yes. Without `--model`, the script asks `typesafe/jev-1.14`, `perplexity/pplx-decider-v1.2` and
`liquid/d1.3-ultra`; two or three others, from different makers, replace them.
```bash
python3 SKILL/scripts/decide.py --list-models
touch WORK/decisions.jsonl
python3 SKILL/scripts/decide.py WORK/tasks.jsonl --max-calls N --decided WORK/decisions.jsonl --dry-run > WORK/dryrun.jsonl
python3 SKILL/scripts/decide.py WORK/tasks.jsonl --max-calls N --decided WORK/decisions.jsonl >> WORK/decisions.jsonl
python3 SKILL/scripts/decide.py WORK/tasks.jsonl --decided WORK/decisions.jsonl --results > WORK/results.jsonl
```

One request per task and model, with every question of its axes. A model says `yes` to an axis when any of its
questions is above 0.7, `no` when all are below 0.3, else `unsure`; a refused question is neither, and a reply that
does not read is `unsure` on the task's axes. A pair decided in the `--decided` file, for the same definitions,
questions, models and state, is not asked again, nor is a model whose answers to a task are there, unreadable ones
included: after a failed call, the same commands ask only the models missing. N is a total over that file: the
answered calls it holds count (`calls_before`), failed ones do not, and the first whole tasks left that fit in the
rest are kept. A resumed run takes the same N, a further batch a larger one, each after its own preview and the user's
yes. Create the file first; give every command the same file and `--model`, the dry run and the send the same N: the
dry run then shows exactly what the send may send. The send first removes a last line cut short; a whole line that is
not JSON is refused by its number.

The send adds a line per pair: each model's answer and each question's `p`, then `agreed` (every model yes, or every
model no) or `disagreement`. Each answered call adds a line with its answers and its `cost_usd`, even when its task
gets no decision: the cost so far is the sum over `WORK/decisions.jsonl`. Stderr gets a line per task as it ends, then
this run's counts, with each `skipped` task's dataset, task, model and HTTP status. Exit 0 done, 2 usage, 3 no call
answered, 4 partial: a call failed or did not read, or `--max-calls` stopped the run or the dry run.

Each request carries `provider.data_collection: "deny"`: what a provider then keeps cannot be checked from here, say
so to the user, and never work around a refusal of that field. A call that gets HTTP 429 is sent again after 2, 4
and 8 seconds, then fails. A task with a failed call is skipped and reported, the run goes on, and only 401, 402, 403
and 404 stop it. On 402 the key is out of credit: stop, report the calls and cost so far, resume after a top-up.

Take results from `WORK/results.jsonl` alone, never from the last lines of `WORK/decisions.jsonl`: per pair, the last
decision for the current state, definitions, questions and models, else `pending`, which is asked or reported, never
labelled. An agreed `yes` proposes the label. An agreed `no` proposes none. A disagreement stays **unlabelled**.
Updating an existing `labels.json`: each result, step 1's field rules included, must also be what the file gives that
task at `REF`'s identity, all rules counted. Change only that task there; a rule that also holds others is split.

- A yes, from a field rule or agreed: add the task to a `tasks` rule with the axis, `checked` at the identity, and
take it out of every `tasks` rule whose `not` holds the axis there.
- Agreed `no`: take the task out of every `tasks` rule that gives the axis there. Still given by a rule without
`tasks`: add a `tasks` rule with the axis in `not`, `checked` at the identity.
- Disagreement: take the task out of every `tasks` rule that gives the axis there, add no `not`, report it unlabelled.
- A rule without `tasks` still in the way (its `not` over a yes, its axis over a disagreement) is never lifted:
report each such conflict to the user before presenting the proposal as complete.

## Hand over

This checks `ENTRY/labels.json` itself against `ENTRY`'s versions, fails without it, and prints `()` or what to fix:
```bash
PYTHONPATH=REPO/app python3 -c 'import json; from nullius.standard.contract import definitions as d; from nullius.leaderboard import labels; v = [b for b in d.load("benchmark", "ENTRY/../..", every=True)[0] if b["key"] == "KEY"]; print(labels.check(json.load(open("ENTRY/labels.json")), v).problems if v else exit("no KEY in ENTRY"))'
```

Then report in a few lines, in `WORK/report.md` and to the user:

- the terms read, and `units.redistribute` as proposed; calls and cost, every run counted;
- per rule: the step or statement that gave it, and for step 2 the models and how many pairs agreed;
- per axis: tasks labelled, disagreements left unlabelled, conflicts with a rule kept; the option values left out;
labels proposed outside `labels.AXES`, written nowhere.

Show the diff of `labels.json`, or the whole file when it is new: a person accepts it. Nothing is committed or sent upstream without the user's word.
Loading
Loading