Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
38ae694
refactor(standard): sort the package into one folder per purpose
aitianshi Nov 16, 2026
e030e9d
refactor: write a file whole, lock it and digest it in one place
aitianshi Nov 16, 2026
177b069
refactor(traces): split the trace reader into five modules
aitianshi Nov 16, 2026
92c0d89
refactor(web): share the local-client guard and the run start
aitianshi Nov 16, 2026
e330956
test: hold both writers inside the write again
aitianshi Nov 16, 2026
4cabbae
test(web): pin the two refusals of the run start
aitianshi Nov 16, 2026
b38d809
Merge branch 'main' into refactor/standard-file-topology
aitianshi Nov 21, 2026
0c9a906
refactor(standard): place the five modules main added
aitianshi Nov 21, 2026
97652d3
fix(catalogue): give OSWorld1's runner the folder that holds the package
aitianshi Nov 22, 2026
95cea1c
fix: the shared file writer makes no folder and takes a name of any l…
aitianshi Nov 22, 2026
7b76dfd
test(web): hold the run start's refusal on the two pages that gained it
aitianshi Nov 22, 2026
732e5e7
docs(standard): give five comments the moved modules' addresses
aitianshi Nov 22, 2026
014a86e
test(standard): keep modules in folders and folders importing one way
aitianshi Nov 22, 2026
ba5dd2f
Merge branch 'main' into refactor/standard-file-topology
aitianshi Nov 22, 2026
0a671fd
Merge branch 'main' into refactor/standard-file-topology
aitianshi Nov 23, 2026
1638423
docs: cut this branch's comments to what changes what a reader does
aitianshi Nov 23, 2026
8a1814c
fix: the shared writer streams a function's text and stages where the…
aitianshi Nov 23, 2026
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: 2 additions & 2 deletions .claude/rules/traces.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Traces, as this application renders them

The reader itself — folding, grouping, normalisation — is
`app/nullius/traces/trace.py`.
The reader itself is `app/nullius/traces/trace.py`, with `spans.py` (the span tree,
grouping), `fold.py`, `breakdown.py` (time accounting) and `waterfall.py` (layout).

Four things about a rendered trace are load-bearing:

Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/docs-drift/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ or name the merge commit and diff its first parent.
| changed under | read these, asking "does this paragraph still describe the code?" |
| --- | --- |
| `pyproject.toml`, `app/nullius/cli.py`, `app/nullius/__main__.py`, `app/nullius/paths.py`, `app/nullius/migrate.py` | README Quickstart; `docs/getting-started.md` installation and migration; `docs/cli/README.md`; `docs/settings/README.md` storage and precedence; AGENTS installation and dependency rules; preserve source commands as well as installed commands |
| `app/nullius/catalogue/storage.py`, `app/nullius/standard/definitions.py`, `app/nullius/standard/payload.py` | `docs/standard.md`, `docs/builder.md`, `docs/how-it-works.md`; all import skills and manual-add guides: user overlays versus bundled contributions, whole-folder selection, and runtime snapshots sent to hosts; generated Supported pages use explicit bundled roots |
| `app/nullius/catalogue/storage.py`, `app/nullius/standard/contract/definitions.py`, `app/nullius/standard/runner/payload.py` | `docs/standard.md`, `docs/builder.md`, `docs/how-it-works.md`; all import skills and manual-add guides: user overlays versus bundled contributions, whole-folder selection, and runtime snapshots sent to hosts; generated Supported pages use explicit bundled roots |
| `app/nullius/runs/` | README "How to read a result"; `.claude/rules/running.md` "Interpreting results" and its runs-list paragraph (for `launches.py`); `docs/field-guide.md`, what each field it names means; `docs/how-it-works.md` "What you get back, page by page"; `docs/cli/` when a CLI changed |
| `app/nullius/traces/` | `.claude/rules/traces.md`; README "How to read a result" |
| `app/nullius/importers/` | README "Supported harnesses" (the table and the notes under it) and "Local by design"; `.claude/rules/running.md`, the import paragraph; `docs/cli/import.md`; the AGENTS map's `importers/` entry — the gate checks the registry's labels, you check the sentences |
Expand Down
5 changes: 3 additions & 2 deletions .claude/skills/import-agent/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ with `PYTHONPATH="$PWD/app"` from the checkout root:
"$NULLIUS_PY" - <<'PY'
from nullius import paths, settings
settings.load(paths.settings_file())
from nullius.standard import definitions, howto
from nullius.standard.contract import definitions
from nullius.standard.pages import howto
print("schema:", definitions.__file__)
print("examples:", howto.__file__)
print("catalogue:", paths.catalogue_dir())
Expand Down Expand Up @@ -132,7 +133,7 @@ See `docs/standard.md`, "Native capabilities and composition".
`cli new agent KEY` (lower case letters, digits, dashes) writes
`agents/KEY/agent.json` under the active user catalogue and prints its path.
Fill it in, starting from
the shape `app/nullius/standard/howto.py` shows (`AGENT_JSON`,
the shape `app/nullius/standard/pages/howto.py` shows (`AGENT_JSON`,
`AGENT_OPTIONS`) and the catalogue's agents (their shape, never their
contents):

Expand Down
7 changes: 4 additions & 3 deletions .claude/skills/import-capability/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ command below from the checkout root:
"$NULLIUS_PY" - <<'PY'
from nullius import paths, settings
settings.load(paths.settings_file())
from nullius.standard import definitions, howto, ports
from nullius.standard.contract import definitions, ports
from nullius.standard.pages import howto
for module in (definitions, howto, ports):
print(module.__name__, module.__file__)
print("catalogue:", paths.catalogue_dir())
Expand Down Expand Up @@ -76,7 +77,7 @@ below. CLI mutations protect bundled resources in source checkouts too.
why, and what it changes about what is measured; ask with the question
tool and write nothing of it before the yes. Without a way to ask (a
subagent), report it as an open question and leave it unwritten.
- **A kind with no port yet** (see `app/nullius/standard/ports.py`) is a generic change: a new port with a
- **A kind with no port yet** (see `app/nullius/standard/contract/ports.py`) is a generic change: a new port with a
kit, worded for every capability of its kind. Ask before adding it; this is a source contribution.

## 1. Read the input (minutes, no install)
Expand Down Expand Up @@ -134,7 +135,7 @@ See `docs/standard.md`, "Native capabilities and composition".
user catalogue, and a `capability.py` that already speaks `cap.memory/v1`.
Use the writable paths the command prints.
2. **Wrap** in `capability.py` (the shape `FEATURE_PY` in
`app/nullius/standard/howto.py` shows): `add` gets a session `{id, date,
`app/nullius/standard/pages/howto.py` shows): `add` gets a session `{id, date,
turns, text}` and stores it with the library's own call, replying `{}`;
`recall` gets the question and replies `{"memory": <text>}` from the
library's own search; an error replies `{"error": ...}`. Send the
Expand Down
5 changes: 3 additions & 2 deletions .claude/skills/import-standard/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ Python command below. Read module files, never edit an installed module:
"$NULLIUS_PY" - <<'PY'
from nullius import paths, settings
settings.load(paths.settings_file())
from nullius.standard import definitions, howto, ports
from nullius.standard.contract import definitions, ports
from nullius.standard.pages import howto
from nullius.catalogue import catalog
for module in (definitions, howto, ports, catalog):
print(module.__name__, module.__file__)
Expand Down Expand Up @@ -144,7 +145,7 @@ never a second key. Preserve both routes when it already runs through Harbor.
Only the final message matters: `agent.task/v1`. A port too many shuts out
agents for nothing; a port too few makes runs fail instead of being refused.
- **A port that does not exist yet is a generic change, not a special case.**
Propose it as a new port with a kit (`app/nullius/standard/ports.py` and
Propose it as a new port with a kit (`app/nullius/standard/contract/ports.py` and
`standard/kits/<name>/`), worded for every benchmark of its kind; never
shape it after the one at hand. Ask before adding it. This is a source contribution.
- **An agent or a capability never writes `offers` by hand.** `cli conform` does.
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/judge_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def criteria_of(body: str) -> tuple:
("low", ()),
]
MAJOR_FLOOR = ("app/nullius/standard/", "app/nullius/execution.py", "app/nullius/hosts.py", "app/nullius/secrets.py",
"app/nullius/runs/classify.py", "app/nullius/runs/parse.py", "app/nullius/standard/relay.py")
"app/nullius/runs/classify.py", "app/nullius/runs/parse.py", "app/nullius/standard/calls/relay.py")


def split_diff(diff: str) -> list:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: base image
# The standard's one base image, and the fixture own image's FROM.
run: |
PYTHONPATH=app python3 -c "from nullius.standard import container; print(container.base_image())"
PYTHONPATH=app python3 -c "from nullius.standard.backends import container; print(container.base_image())"
docker pull --quiet ubuntu:24.04
- name: backend suite with the docker tier
run: python3 app/tests/parallel.py --docker
20 changes: 14 additions & 6 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ and its resources.
Harbor job tree: `parse`, `classify`, `live`, `artifacts`,
`feasibility`, `launches`, `verifier` - a verifier's report read by its
benchmark's report block - `attempts`, a task's attempts in one job with
their pass count and pass@k, and the `cli`), `traces/` (`trace`, `trajectory`,
their pass count and pass@k, and the `cli`), `traces/` (`trace`, the reader, with its span tree `spans`,
`fold`, time accounting `breakdown` and layout `waterfall`; `trajectory`,
`conversation`, `charts`, `behavior`, `otel`), `compare/` (`comparison` and its `cli`),
`catalogue/` (`catalog`, which loads one folder per benchmark
under `catalogue/benchmarks/`, named by its key: its `benchmark.json` with its
Expand All @@ -59,9 +60,16 @@ and its resources.
`harbor/` (`source`: the Harbor a recipe pins - built, kept, scanned for its agents;
`feed`: the live feed any Harbor writes, from its own trial hooks),
`importers/` (`atif` ATIF, `otel` OpenTelemetry, and the `cli`), `judge/` (`questions`, `state`, `client`, `store`, `batch`, `reconcile`, `lanes`),
`standard/` (the Nullius standard, `docs/standard.md`: `ports`, `names` (capability vocabulary and legacy aliases), `definitions` (with an agent's or capability's versions), `match`,
`jsonl`, `acp`, `cancellation` (interruptible protocol waits), `relay`, `ledger` (a run's spending cap), `retries` (what an attempt is tried again after, and how many times), `pace` (how soon the next unit starts after a rate limit), `pins` (image digests checked against registry tags), `install`, `run`, `container` (the container backend), `boat` (the boat backend: each unit's agent in a boat.dev VM), `setup_container` (an Original setup's driver and its Linux dependencies in Docker), `forward` (a licence server's one door from it, or a benchmark's MCP server's), `web_services` (HTTP fixtures a driver's setup declares, each behind a unit-local Docker door), `mcp_machine` and `mcp_bridge` (a benchmark's MCP server run on the machine, in its driver's environment, and the agent's bridge to it), `computer_port` and `computer_pipe` (the computer port's MCP server, served by a desktop benchmark's runner over the benchmark's own loop, and the session's stdio pipe to it), `network_requirements` (an environment's declared public web access: the schema and the connectivity check), `hostreq` (what a benchmark's options need of the machine its driver runs on: the check and the install) and `egress` (an own image's check's proxy to public addresses), `job`, `conform`, `fidelity` (ACP against the agent's own CLI), `prove` (a benchmark's controls and proofs), `shard` and `merge` (one run over many machines), `recipe` (the builder's standard recipe), `howto` (the How to add steps) and the `cli`; its
`payload` snapshots the running backend and effective catalogue for a remote host;
`standard/` (the Nullius standard, `docs/standard.md`, one folder per purpose, importing one way: `test_layering.StandardFolders`;
`contract/`: `ports`, `names` (capability vocabulary and legacy aliases), `definitions` (with an agent's or capability's versions), `match`;
`requirements/`: `install`, `hostreq` (what a benchmark's options need of the machine its driver runs on: the check and the install), `network_requirements` (an environment's declared public web access: the connectivity check before any unit);
`protocols/`: `jsonl`, `acp`, `cancellation` (interruptible protocol waits), `computer_port` and `computer_pipe` (the computer port's MCP server, served by a desktop benchmark's runner over the benchmark's own loop, and the session's stdio pipe to it);
`calls/`: `relay`, `ledger` (a run's spending cap);
`backends/`: `container` (the container backend), `boat` (the boat backend: each unit's agent in a boat.dev VM), `setup_container` (an Original setup's driver and its Linux dependencies in Docker), `forward` (a licence server's one door from it, or a benchmark's MCP server's), `web_services` (HTTP fixtures a driver's setup declares, each behind a unit-local Docker door), `mcp_machine` and `mcp_bridge` (a benchmark's MCP server run on the machine, in its driver's environment, and the agent's bridge to it), `egress` (an own image's check's proxy to public addresses);
`runner/`: `run`, `job`, `retries` (what an attempt is tried again after, and how many times), `pace` (how soon the next unit starts after a rate limit), `shard` and `merge` (one run over many machines), `payload` (a snapshot of the running backend and effective catalogue for a remote host), `boat_units` (a benchmark whose units boot a VM of their own, each unit whole in a Boat VM);
`proofs/`: `conform`, `fidelity` (ACP against the agent's own CLI), `prove` (a benchmark's controls and proofs), `pins` (image digests checked against registry tags);
`pages/`: `recipe` (the builder's standard recipe), `howto` (the How to add steps);
and the `cli` at its top;
conformance kits under `standard/kits/`, each a benchmark: a `driver` and, for the
tools kit, an MCP server `mcp_kit`) - the definitions it reads are in the catalogue:
a benchmark's `standard.json` and `driver` in its folder (τ³-bench's also the MCP
Expand All @@ -74,7 +82,7 @@ and its resources.
(the reference `agent`; JiuwenSwarm's `agent` and mini-swe-agent's `run`, the wrappers that start them) and `catalogue/capabilities/<key>/` (the keyword-memory `capability`); `workspace` (and
`workspace_cli`, its shell command),
`cli` and `__main__` (the unified `nullius` and `python -m nullius` commands),
`paths` (user config, data and cache locations), `prices` (the user's model price list: fetched on request and before a capped run; what a cost is estimated from), `migrate` (explicit copying of legacy checkout storage), `settings`, `hosts`, `constraints` (what Nullius may use on each machine: one table, the container and systemd scope probes, the warnings), `execution`, `progress` (what a run is doing, one line per stage), `prerequisites` (what a recipe needs of each machine it runs on, asked before Run and again as it starts), `onboarding` (the Getting started checklist: what this machine
`paths` (user config, data and cache locations), `ondisk` (a file written whole then renamed into place, a lock, a digest), `prices` (the user's model price list: fetched on request and before a capped run; what a cost is estimated from), `migrate` (explicit copying of legacy checkout storage), `settings`, `hosts`, `constraints` (what Nullius may use on each machine: one table, the container and systemd scope probes, the warnings), `execution`, `progress` (what a run is doing, one line per stage), `prerequisites` (what a recipe needs of each machine it runs on, asked before Run and again as it starts), `onboarding` (the Getting started checklist: what this machine
says is done, and where each step is done), `gitrefs` (a repository's branches and tags,
by `git ls-remote`), `secrets` (a benchmark's licences, kept per benchmark outside the repository, and the Hugging Face token of Data providers), `sandbox` (the Docker Hub login Data providers uses), `charts` (categorical charts, bars, dots and a scatter, and their style registry: Compare's Chart view) and `redact` at the top.
- `app/templates/`, `app/static/` — the interface, grouped by the same capability
Expand Down Expand Up @@ -132,7 +140,7 @@ and migration, and `docs/settings/README.md` for paths and precedence.

Three dependency rules. Each is load-bearing and each has a test.

- **`app/nullius/` imports no Flask.** `test_charts.NoFlask` checks every module. If a test in `app/tests` needs Flask, the layering
- **`app/nullius/` imports no Flask.** `test_layering.NoFlask` checks every module. If a test in `app/tests` needs Flask, the layering
has broken, not the test.
- **One name, one implementation per interpreter.**
`app/tests/test_dependency_surface.py` counts *providers* of `nullius` and
Expand Down
2 changes: 1 addition & 1 deletion app/nullius/catalogue/benchmarks/humaneval/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
sys.path.insert(0, os.environ["NULLIUS_UPSTREAM"])
from human_eval.data import read_problems # noqa: E402 as published
from human_eval.execution import check_correctness # noqa: E402
from nullius.standard.container import CHECK_IMAGE, check_argv # noqa: E402
from nullius.standard.backends.container import CHECK_IMAGE, check_argv # noqa: E402

PROBLEMS = {}

Expand Down
5 changes: 3 additions & 2 deletions app/nullius/catalogue/benchmarks/osworld1/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ def answer(unit, dir, setup, model, base_url, key, **_):

def _port():
"""The computer port's shared code, from the nullius package on this driver's import path."""
from nullius.standard import computer_port
from nullius.standard.protocols import computer_port
return computer_port


Expand All @@ -427,7 +427,8 @@ def _option(name, default, kind):

def _runner_env():
"""The runner's environment: this driver's, its import path the upstream's folder and the nullius package's."""
package = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(_port().__file__))))
import nullius # asked of the package itself, wherever the port sits inside it
package = os.path.dirname(os.path.dirname(os.path.abspath(nullius.__file__)))
return dict(os.environ, PYTHONPATH=os.pathsep.join([UP, package]), PYTHONIOENCODING="utf-8")


Expand Down
4 changes: 2 additions & 2 deletions app/nullius/catalogue/benchmarks/osworld1/runner.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""One unit of an agent on OSWorld1: the upstream's DesktopEnv and its own run_single_example, imported and called as
they are, with the computer port's bridge as the loop's agent (nullius.standard.computer_port, agent.computer/v1).
they are, with the computer port's bridge as the loop's agent (nullius.standard.protocols.computer_port, agent.computer/v1).

runner.py --example TASK_JSON --result-dir DIR --socket PATH --ready FILE --lifeline FD --steps N --pause SECONDS
--vm VM_IMAGE --calls FILE [--held FOLDER] [--prepared FILE] [--given FILE]
Expand Down Expand Up @@ -135,7 +135,7 @@ def main(argv=None):
p.add_argument("--steps", type=int, required=True)
p.add_argument("--pause", type=float, required=True)
a = p.parse_args(argv)
from nullius.standard import computer_port as port
from nullius.standard.protocols import computer_port as port
stop, turn = port.Stop(STOP_SECONDS), Turn()
turn.given, turn.said = a.given, port.ready
try: # the clean-up holds before the lifeline can stop the runner
Expand Down
2 changes: 1 addition & 1 deletion app/nullius/catalogue/benchmarks/osworld1/standard.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"command": [
"{install}/.venv/bin/python"
],
"summary": "The unit's desktop for an agent: the computer port's pipe (the nullius package's standard/computer_pipe.py, whose path setup gives as the first argument) joined to the socket where the unit's runner serves the port's MCP server, its second argument."
"summary": "The unit's desktop for an agent: the computer port's pipe (the nullius package's standard/protocols/computer_pipe.py, whose path setup gives as the first argument) joined to the socket where the unit's runner serves the port's MCP server, its second argument."
}
},
"limits": {
Expand Down
2 changes: 1 addition & 1 deletion app/nullius/catalogue/benchmarks/tau3-bench/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
from tau2.runner.progress import run_with_retry
from tau2.utils import load_file

from nullius.standard.jsonl import serve
from nullius.standard.protocols.jsonl import serve
from search_relay import route_qwen

route_qwen(os.environ.get("NULLIUS_OPTION_RETRIEVAL"))
Expand Down
2 changes: 1 addition & 1 deletion app/nullius/catalogue/benchmarks/tau3-bench/mcp_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

``TAU_DOMAIN`` names the domain (``airline``, ``retail``, ...), ``TAU_RETRIEVAL`` a knowledge domain's retrieval config. It runs on the
machine in the driver's environment, never in the agent's container
(``mcp_servers`` in ``standard.json``; ``nullius.standard.mcp_machine``).
(``mcp_servers`` in ``standard.json``; ``nullius.standard.backends.mcp_machine``).
"""
import contextlib
import copy
Expand Down
15 changes: 3 additions & 12 deletions app/nullius/catalogue/harbor_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@
import json
import os
import re
import tempfile
import tomllib
from dataclasses import replace
from urllib import error, parse, request

from nullius import ondisk

from . import catalog, storage

HUB = "https://hub.harborframework.com"
Expand Down Expand Up @@ -209,17 +210,7 @@ def problems(entry: dict, root: str | None = None, replacing: str = "", dataset:


def _write(path: str, entry: dict) -> None:
temporary = None
try:
with tempfile.NamedTemporaryFile(mode="w", encoding="utf-8", dir=os.path.dirname(path),
prefix=".entry-", delete=False) as fh:
temporary = fh.name
json.dump(entry, fh, indent=2, ensure_ascii=False)
fh.write("\n")
os.replace(temporary, path)
finally:
if temporary is not None and os.path.exists(temporary):
os.unlink(temporary)
ondisk.write_whole(path, json.dumps(entry, indent=2, ensure_ascii=False) + "\n", mode=0o600)


def save(entry: dict, root: str | None = None) -> str:
Expand Down
Loading