From 6260b84d5878f8404ecb50b628354f6378a8c191 Mon Sep 17 00:00:00 2001 From: Etienne Filhol Date: Tue, 24 Nov 2026 21:46:02 +0100 Subject: [PATCH 1/8] ci: stop the PR judge asking for tests and docs A judged row for each made coding agents add tests and documentation to earn it. AGENTS.md says when either is worth adding. --- .github/scripts/judge_pr.py | 26 ++++---------------------- AGENTS.md | 6 ++++-- 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/.github/scripts/judge_pr.py b/.github/scripts/judge_pr.py index e11c624a..7c0a15fe 100644 --- a/.github/scripts/judge_pr.py +++ b/.github/scripts/judge_pr.py @@ -17,9 +17,8 @@ description and diff: the acceptance criteria of the linked issue, one row per box of its `## Acceptance` list (a body without one is judged whole); whether the issue and the pull request describe the same change; whether - the description matches the diff; whether the diff stays in scope; whether - tests cover the change or the description says how it was verified; whether - the docs follow; whether the risk is named. A pull request that links no + the description matches the diff; whether the diff stays in scope; + whether the risk is named. A pull request that links no issue reads `–` on the first two. The row "before and after shown" is the script's: when the diff touches what is visible, it counts the images under the description's `## Before and after` heading. @@ -117,21 +116,6 @@ "partly": "A few hunks serve something else (a tidy-up, a rename elsewhere), small beside the change", "no": "A substantial part of the diff is a different change"}, }, - "tests": { - "type": "choice", - "instructions": "Is the changed behaviour covered: tests added or changed in the diff for it, or the description's Verified section saying what was run and checked?", - "criteria": {"yes": "The diff has tests for the behaviour it changes, or the description states how it was verified", - "partly": "Some of the change is covered or verified, some is not", - "no": "No test touches the change and the description says nothing about verification, or says it was not verified"}, - }, - "docs": { - "type": "choice", - "instructions": "When the change alters a page, a command, a setting, a rule or a file layout, do the documentation and the repository's own guides (README, AGENTS.md, docs/) follow in the same diff?", - "criteria": {"yes": "What changed for a reader or an operator is reflected in the documentation in this diff", - "partly": "Some of it is reflected, some surfaces still describe the old behaviour", - "no": "Something a reader or an operator sees changed and no documentation follows", - "none_needed": "Nothing a reader or an operator sees changed"}, - }, "risk_named": { "type": "choice", "instructions": "Does the description name what could break if this change is wrong and how it would be undone (a revert, a rebuild, a migration): deleted tests, changed defaults, data on disk, keys?", @@ -149,7 +133,7 @@ "severe": "Data, keys or history can be lost or wrong: a write into a source tree, keys or secrets, deleted tests, a changed on-disk format, a workflow with write permissions"}, }, } -PR_QUESTIONS = ("issue_same", "description_matches", "scope", "tests", "docs", "risk_named", "merge_risk") +PR_QUESTIONS = ("issue_same", "description_matches", "scope", "risk_named", "merge_risk") class JudgeError(Exception): @@ -585,7 +569,7 @@ def short(text: str, n: int = 90) -> str: VERDICT = {"met": "✅ met", "partial": "⚠️ partial", "not_met": "❌ unmet", "no_evidence": "❌ no evidence", - "yes": "✅ yes", "partly": "⚠️ partly", "no": "❌ no", "none_needed": "–", + "yes": "✅ yes", "partly": "⚠️ partly", "no": "❌ no", "undecided": "❔ undecided", "unanswered": "not asked", "na": "–"} RISK_MARK = {"minor": "🟢", "medium": "🟡", "significant": "🟠", "major": "🔴", "severe": "⛔", "undecided": "❔", "not asked": "⚪"} PRIORITY_MARK = {"low": "🟢", "medium": "🟡", "high": "🟠", "extreme": "🔴"} @@ -594,8 +578,6 @@ def short(text: str, n: int = 90) -> str: ("issue_same", "Issue and pull request describe the same change"), ("description_matches", "Description matches the diff, no more, no less"), ("scope", "Diff stays in scope"), - ("tests", "Tests cover the change, or Verified says how"), - ("docs", "Docs follow the change"), ("risk_named", "Risk named in the description"), ("before_after", "Before and after shown"), ] diff --git a/AGENTS.md b/AGENTS.md index b0a7c618..e77089f9 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -140,6 +140,9 @@ and migration, and `docs/settings/README.md` for paths and precedence. the owner's rules for every page and the scope of UI checks). - Prefer small, targeted diffs. Do not refactor unrelated areas opportunistically. +- Add a test only for a distinct regression no existing test catches, and docs + only when what they say became wrong or a reader needs it to choose or act. + Neither is owed by a change: none is a valid answer. ## Core Architecture @@ -241,8 +244,7 @@ The questions, asked k=3 times with medians: each acceptance criterion of the linked issue (the `## Acceptance` checkbox list, one row per box; a body without one is judged whole), whether the issue and the PR describe the same change, whether the description matches the diff, whether the diff stays in -scope, whether tests or the `## Verified` section cover it, whether the docs -follow, whether `## Risk` names what could break; `## Before and after` is +scope, whether `## Risk` names what could break; `## Before and after` is counted by the script when the diff touches what is visible. Issue rows show `–` when the PR links no issue. Everything the judge reads has been through `redact` first: key-shaped strings and email addresses never leave the runner. `/judge` from an owner, member or collaborator asks again, a draft included. Experimental: From 39904acb9bc8e4b8551885211fa2fecffea12e50 Mon Sep 17 00:00:00 2001 From: Etienne Filhol Date: Tue, 24 Nov 2026 23:11:18 +0100 Subject: [PATCH 2/8] docs: shorten AGENTS.md, the templates and the file-issue skill, and move skills to .agents/skills AGENTS.md held 4,040 words, 911 of them a list of every file that check_docs.py required. It is rules, a path table and a Read first table now. .claude/skills links to .agents/skills, where every assistant looks. --- .../skills/docs-drift/SKILL.md | 23 +- .../skills/docs-drift/scripts/check_docs.py | 54 +- .agents/skills/file-issue/SKILL.md | 60 ++ .../skills/import-agent/SKILL.md | 2 +- .../skills/import-benchmark/SKILL.md | 2 +- .../skills/import-capability/SKILL.md | 2 +- .../skills/import-feature/SKILL.md | 0 .../skills/import-standard/SKILL.md | 6 +- .../skills/remove-integration/SKILL.md | 0 .../skills/run-analysis/SKILL.md | 2 +- .../skills/run-analysis/assets/template.html | 0 .../skills/run-analysis/references/files.md | 0 .../run-analysis/references/investigation.md | 0 .../skills/run-analysis/scripts/runs.py | 0 {.claude => .agents}/skills/ui-sweep/SKILL.md | 2 +- .../skills/ui-sweep/scripts/sweep.py | 2 +- .claude/skills | 1 + .claude/skills/file-issue/SKILL.md | 71 --- .github/ISSUE_TEMPLATE/bug.yml | 49 +- .github/ISSUE_TEMPLATE/enhancement.yml | 38 +- .github/pull_request_template.md | 36 +- .github/scripts/judge_pr.py | 6 +- .github/workflows/ui-sweep.yml | 2 +- AGENTS.md | 571 +++++------------- CONTRIBUTING.md | 9 +- app/nullius/standard/pages/howto.py | 2 +- app/tests/test_standard_howto.py | 2 +- app/ui_tests/test_agents.py | 4 +- docs/standard.md | 2 +- 29 files changed, 325 insertions(+), 623 deletions(-) rename {.claude => .agents}/skills/docs-drift/SKILL.md (83%) rename {.claude => .agents}/skills/docs-drift/scripts/check_docs.py (77%) create mode 100644 .agents/skills/file-issue/SKILL.md rename {.claude => .agents}/skills/import-agent/SKILL.md (99%) rename {.claude => .agents}/skills/import-benchmark/SKILL.md (99%) rename {.claude => .agents}/skills/import-capability/SKILL.md (99%) rename {.claude => .agents}/skills/import-feature/SKILL.md (100%) rename {.claude => .agents}/skills/import-standard/SKILL.md (99%) rename {.claude => .agents}/skills/remove-integration/SKILL.md (100%) rename {.claude => .agents}/skills/run-analysis/SKILL.md (99%) rename {.claude => .agents}/skills/run-analysis/assets/template.html (100%) rename {.claude => .agents}/skills/run-analysis/references/files.md (100%) rename {.claude => .agents}/skills/run-analysis/references/investigation.md (100%) rename {.claude => .agents}/skills/run-analysis/scripts/runs.py (100%) rename {.claude => .agents}/skills/ui-sweep/SKILL.md (98%) rename {.claude => .agents}/skills/ui-sweep/scripts/sweep.py (99%) create mode 120000 .claude/skills delete mode 100644 .claude/skills/file-issue/SKILL.md diff --git a/.claude/skills/docs-drift/SKILL.md b/.agents/skills/docs-drift/SKILL.md similarity index 83% rename from .claude/skills/docs-drift/SKILL.md rename to .agents/skills/docs-drift/SKILL.md index b2529b88..7fc3d9d0 100644 --- a/.claude/skills/docs-drift/SKILL.md +++ b/.agents/skills/docs-drift/SKILL.md @@ -13,9 +13,8 @@ runs them: - repository paths named in backticks in a tracked `.md`, and files under `app/` or `docs/` named in a fenced command; - the `docs/` folder map in `docs/README.md`; -- AGENTS.md's repository map against `app/web` and `app/nullius`, both ways (a - module it leaves out, a name it gives that does not exist); -- the importer registry against the README table and AGENTS' `importers/` entry. +- AGENTS.md "Where code lives" against the packages of `app/nullius`, both ways; +- the importer registry against the README table. A path is only checked when its first segment is a top-level entry of the repository, so a path under a wrong top-level directory passes silently. @@ -30,7 +29,7 @@ or name the merge commit and diff its first parent. ## Procedure -1. **Run the check first.** `python3 .claude/skills/docs-drift/scripts/check_docs.py`, +1. **Run the check first.** `python3 .agents/skills/docs-drift/scripts/check_docs.py`, on a bare `python3`. Fix every finding before reading anything. Remove obsolete references unless the user explicitly asks to keep them. An @@ -46,22 +45,22 @@ 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 | + | `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 "Three rules, each with a test"; preserve source commands as well as installed commands | | `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 | + | `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` | | `app/nullius/compare/` | `.claude/rules/running.md`, the comparison paragraph; `docs/cli/read-jobs.md`; `docs/field-guide.md`; `docs/how-it-works.md`, the `/compare` row | - | `app/nullius/catalogue/`, `app/nullius/recipes/`, `app/nullius/harbor/` | README "Ways to run" and its sections from "Bring anything" to "Read it"; `docs/builder.md` "Recipe stages" and "Agents and Capabilities tabs"; `.claude/rules/running.md`, what the repository runs and installs; for `harbor/`, the `source.py` docstring and `docs/builder.md` "Which Harbor"; for `catalogue/`, `.claude/skills/import-benchmark/SKILL.md` (a Harbor entry, the listing rule) too; for `providers.py`, the provider rows of `docs/builder.md` "Which providers" | + | `app/nullius/catalogue/`, `app/nullius/recipes/`, `app/nullius/harbor/` | README "Ways to run" and its sections from "Bring anything" to "Read it"; `docs/builder.md` "Recipe stages" and "Agents and Capabilities tabs"; `.claude/rules/running.md`, what the repository runs and installs; for `harbor/`, the `source.py` docstring and `docs/builder.md` "Which Harbor"; for `catalogue/`, `.agents/skills/import-benchmark/SKILL.md` (a Harbor entry, the listing rule) too; for `providers.py`, the provider rows of `docs/builder.md` "Which providers" | | `app/nullius/execution.py`, `app/nullius/hosts.py`, `app/nullius/settings.py` | `.claude/rules/running.md`, the run-from-Review paragraph and the settings list with its count of things a person sets; README "What it does"; `docs/builder.md` "Run"; `docs/settings/README.md`; `docs/how-it-works.md`, Paths 2 to 4 | | `app/nullius/judge/`, `app/web/judge.py`, `app/web/judge_tasks.py`, `app/web/reconcile.py` | `docs/judgement.md`; README "What it does" | | `app/nullius/workspace.py`, `app/nullius/workspace_cli.py` | `.claude/rules/running.md`, the workspace paragraph; `docs/how-it-works.md` "What the workspace keeps"; `docs/cli/read-jobs.md` | | `app/nullius/redact.py` | `.claude/rules/running.md` (log lines are redacted); `.claude/rules/traces.md` (the artifact reader) | - | `app/web/`, `app/templates/`, `app/static/` | the AGENTS map's `app/web/` entry — the gate checks the module names, you check what it says each does; README "What it does", for the page that changed; `docs/how-it-works.md` "What you get back, page by page"; `.claude/rules/traces.md` for the trial page's strips; `app/tests/field_contract.json` when a template reads a different field (refreshed with `python3 app/tests/field_contract.py --write`) | + | `app/web/`, `app/templates/`, `app/static/` | README "What it does", for the page that changed; `docs/how-it-works.md` "What you get back, page by page"; `.claude/rules/traces.md` for the trial page's strips; `app/tests/field_contract.json` when a template reads a different field (refreshed with `python3 app/tests/field_contract.py --write`) | | `app/tests/`, `app/ui_tests/` | a *new module* is named in AGENTS Commands only if it is run differently | - | `.github/workflows/`, `app/requirements.txt` | AGENTS Commands (the PR judge) and Core Architecture (the discovery paths); README "Quickstart" and "Documentation"; `.claude/rules/running.md` "Running the app" | + | `.github/workflows/`, `app/requirements.txt` | AGENTS "Commands"; README "Quickstart" and "Documentation"; `.claude/rules/running.md` "Running the app" | | `docs/` | `docs/README.md` — the gate checks its folders, you check the one-line descriptions; `docs/cli/` against each command's `--help` | - | `.claude/` | AGENTS.md, which is the map: every rule and skill is named there | + | `.agents/`, `.claude/` | AGENTS.md "Read first" | | a document itself (`README.md`, `AGENTS.md`, `docs/field-guide.md`, a rule, a topic page) | the changed paragraphs against the code they describe, and every other document in this table that says the same thing | | anything that closes or opens an issue | the issue's body and Development link; the README or rule sentence that cites it by number | @@ -79,10 +78,10 @@ or name the merge commit and diff its first parent. 3. **Then the surfaces everyone forgets**, whatever the scope: - README.md "Quickstart" and "Documentation"; - - AGENTS.md "What This Repo Is", "Core Architecture" and "More Detail"; + - AGENTS.md "Where code lives", "Commands" and "Read first"; - `.claude/rules/running.md` — its commands still run as written (`nullius …`, `uv run …`, the `PYTHONPATH=app python3 -m nullius.…` forms, `--no-debug`); - - `docs/how-it-works.md` "The pieces" — the backend list beside the AGENTS map; + - `docs/how-it-works.md` "The pieces" — the backend list; - `docs/cli/pages.md` — the covered rows still run, and a command that gained a flag has it in the table. diff --git a/.claude/skills/docs-drift/scripts/check_docs.py b/.agents/skills/docs-drift/scripts/check_docs.py similarity index 77% rename from .claude/skills/docs-drift/scripts/check_docs.py rename to .agents/skills/docs-drift/scripts/check_docs.py index 9b4e8253..93294752 100755 --- a/.claude/skills/docs-drift/scripts/check_docs.py +++ b/.agents/skills/docs-drift/scripts/check_docs.py @@ -4,7 +4,7 @@ silently when files move — links that no longer resolve, paths named in prose that no longer exist — and nothing that needs judgement. - python3 .claude/skills/docs-drift/scripts/check_docs.py + python3 .agents/skills/docs-drift/scripts/check_docs.py Prints every finding and exits 1 if there are any. """ @@ -131,43 +131,26 @@ def check_md_links() -> list[str]: return bad -def _map_bullet(text: str, root: str) -> str: - """The AGENTS.md repository-map bullet that starts with `root` - up to the next bullet.""" - m = re.search(r"^- `" + re.escape(root) + r"`.*?(?=^- `|^#|\Z)", text, re.M | re.S) - return m.group(0) if m else "" - - def check_map() -> list[str]: - """AGENTS.md's repository map names every module of app/web and - app/nullius and names no module that does not exist.""" + """AGENTS.md's "Where code lives" names every package of app/nullius, and no + folder there that does not exist. A module is described by its docstring.""" agents = REPO / "AGENTS.md" if not agents.exists(): return [] - text = agents.read_text(encoding="utf-8") - bad = [] - for root in ("app/web/", "app/nullius/"): - bullet = _map_bullet(text, root) - if not bullet: - bad.append(f"AGENTS.md: no map bullet for `{root}`") - continue - named = set(re.findall(r"`([\w/]+?)/?`", bullet)) - modules = sorted(p for p in (REPO / root).rglob("*.py") if p.name != "__init__.py" and "__pycache__" not in p.parts) - for mod in modules: - rel = mod.relative_to(REPO / root) - bare, dotted = rel.stem, str(rel.with_suffix("")).replace("\\", "/") - if not ({bare, dotted, rel.parent.name + "/" + bare} & named): - bad.append(f"AGENTS.md: the `{root}` map does not name `{dotted}`") - for name in sorted(named): - if name.rstrip("/") == root.rstrip("/"): - continue - if "/" in name and not (REPO / root / name).exists() and not (REPO / root / (name + ".py")).exists(): - bad.append(f"AGENTS.md: the `{root}` map names `{name}`, which does not exist under {root}") - return bad + part = re.search(r"^## Where code lives$.*?(?=^## |\Z)", agents.read_text(encoding="utf-8"), re.M | re.S) + if not part: + return ["AGENTS.md: no \"Where code lives\""] + root = REPO / "app/nullius" + folders = {p.name for top in (root, root / "standard") for p in top.iterdir() if p.is_dir() and p.name != "__pycache__"} + entries = {p.name for p in (root / "catalogue").iterdir() if p.is_dir()} + named = set(re.findall(r"`(?:app/nullius/)?([\w-]+)/`", part.group(0))) + return ([f"AGENTS.md: \"Where code lives\" does not name `{name}/`" for name in sorted(folders - named)] + + [f"AGENTS.md: \"Where code lives\" names `{name}/`, which is not under app/nullius/" + for name in sorted(named - folders - entries) if not (REPO / name).is_dir()]) def check_importers() -> list[str]: - """The importers the README's ways-in table and the AGENTS.md map name are - the registry's, no more and no fewer.""" + """The README's ways-in table names every importer of the registry.""" # The registry is read in a subprocess so this process's import path stays # what it was: the test suite runs these checks over copies of the tree. proc = subprocess.run([sys.executable, "-c", "import json, sys; from nullius import importers as r; " @@ -186,15 +169,6 @@ def check_importers() -> list[str]: for label in sorted(labels): if label not in rows: bad.append(f"README.md: the ways-in table does not name the {label} importer") - agents = (REPO / "AGENTS.md").read_text(encoding="utf-8") if (REPO / "AGENTS.md").exists() else "" - bullet = _map_bullet(agents, "app/nullius/") - listed = re.search(r"`importers/` \(([^)]*)\)", bullet) - if not listed: - bad.append("AGENTS.md: the map does not list `importers/` with its readers") - else: - for label in sorted(labels): - if label not in listed.group(1): - bad.append(f"AGENTS.md: `importers/` does not name {label}") return bad diff --git a/.agents/skills/file-issue/SKILL.md b/.agents/skills/file-issue/SKILL.md new file mode 100644 index 00000000..a63fa518 --- /dev/null +++ b/.agents/skills/file-issue/SKILL.md @@ -0,0 +1,60 @@ +--- +name: file-issue +description: File a GitHub issue or open a pull request here with gh, short and in the shape the forms and the PR judge expect, then read it back. Use whenever asked to file, open, record or report an issue or a bug, or to open a PR, or when a defect is found in passing and should be recorded rather than fixed. +--- + +# File an issue, open a pull request + +**Short.** The point first, then why; one fact per line; fragments are fine. +Quotes and numbers. No background, file tour, hedging or restated diff. + +- Under 150 words, most need 80: `wc -w`. +- Cut facts, not grammar. Full words, real names: a stranger must be able to act + on it. A fact nobody acts on goes. + +| No | Yes | +| --- | --- | +| Currently, when a user types a partial model name, the search may fail to return the expected results. | `Qwen 32b` lists nothing. OpenRouter has two. | +| Comprehensive tests were added and the change was verified thoroughly across browsers. | Route suite 690. Chromium, Firefox, WebKit. Not checked: macOS Safari. | +| Live-list test now `sourceOf`'s: asking once untested. | No test covers asking Decision's list only once. | + +Never: a key, token, password, email address, personal message, private link, +host name, site address or machine attribution. A security problem goes to the +address in SECURITY.md, never to an issue. + +## First + +Search issues and pull requests, open and closed (`gh issue list --state all +--search`, `gh pr list --state all --search`), here and in the repository that +owns the cause (`--repo`). File a bug there, with a link from here; while minor +or unconfirmed, note it here instead. + +## An issue + +The body is the form's labels as `### Label`, in order, without Priority; drop an +empty one. `.github/ISSUE_TEMPLATE/bug.yml` and `enhancement.yml` hold them, and +their placeholders are the example. Acceptance is `- [ ]` boxes, each checkable +in the diff. + + gh issue create --title "" \ + --label bug --label P3 --assignee aitianshi --body-file issue.md + +- Priority: `P0` to `P3`, as `gh label list` describes them. Undecided: the lowest + defensible, and say it is a placeholder. +- `aitianshi` where that is the real owner, else nobody. +- Reuse labels. Set the native type (`Bug`, `Feature`) too; where `gh` lacks it, + the GraphQL mutation `updateIssue` takes `issueTypeId`. +- Keep the metadata true when scope, priority, owner or state changes. + +## A pull request + +The body is `.github/pull_request_template.md`; its comment is the example. The +title's types and scopes are in AGENTS.md. A visible change has two images of one +width under `## Before and after`; otherwise drop the section. "Not checked" is +a valid line. + + gh pr create --title "fix(web): ..." --body-file pr.md + +Read both back. The issue must list the pull request in +`closedByPullRequestsReferences` (GraphQL); stacked pull requests link the same +way, and a base is never retargeted for it. diff --git a/.claude/skills/import-agent/SKILL.md b/.agents/skills/import-agent/SKILL.md similarity index 99% rename from .claude/skills/import-agent/SKILL.md rename to .agents/skills/import-agent/SKILL.md index 1d9c50b9..c53676fb 100644 --- a/.claude/skills/import-agent/SKILL.md +++ b/.agents/skills/import-agent/SKILL.md @@ -208,7 +208,7 @@ run only if your instructions already say yes. `python3 app/tests/catalogue_docs.py --write`, run `python3 app/tests/parallel.py`, the route suite (`uv run --no-project --with-requirements app/requirements.txt python app/tests/parallel.py app/ui_tests`), and - `python3 .claude/skills/docs-drift/scripts/check_docs.py`. Use an isolated + `python3 .agents/skills/docs-drift/scripts/check_docs.py`. Use an isolated profile with an empty user catalogue so personal overrides cannot mask the contributed files. Personal imports finish with definition checks, authorized proofs/trials and focused UI checks; report any unavailable prerequisites. diff --git a/.claude/skills/import-benchmark/SKILL.md b/.agents/skills/import-benchmark/SKILL.md similarity index 99% rename from .claude/skills/import-benchmark/SKILL.md rename to .agents/skills/import-benchmark/SKILL.md index 7224b91c..45239db8 100644 --- a/.claude/skills/import-benchmark/SKILL.md +++ b/.agents/skills/import-benchmark/SKILL.md @@ -159,7 +159,7 @@ When they do, write it locally: `app/tests` and `app/ui_tests`, and the legacy dataset description where relevant. Refresh `python3 app/tests/catalogue_docs.py --write`; run the backend and route suites from AGENTS.md, and - `python3 .claude/skills/docs-drift/scripts/check_docs.py`. Use an isolated + `python3 .agents/skills/docs-drift/scripts/check_docs.py`. Use an isolated profile and an empty user catalogue so personal overrides cannot mask the bundled entry. Ask what, if anything, goes upstream only when publication was not already authorized. diff --git a/.claude/skills/import-capability/SKILL.md b/.agents/skills/import-capability/SKILL.md similarity index 99% rename from .claude/skills/import-capability/SKILL.md rename to .agents/skills/import-capability/SKILL.md index 0b5e934a..d01866c2 100644 --- a/.claude/skills/import-capability/SKILL.md +++ b/.agents/skills/import-capability/SKILL.md @@ -188,7 +188,7 @@ See `docs/standard.md`, "Native capabilities and composition". `python3 app/tests/catalogue_docs.py --write`, run `python3 app/tests/parallel.py`, the route suite (`uv run --no-project --with-requirements app/requirements.txt python app/tests/parallel.py app/ui_tests`), and - `python3 .claude/skills/docs-drift/scripts/check_docs.py`. Use an isolated + `python3 .agents/skills/docs-drift/scripts/check_docs.py`. Use an isolated profile with an empty user catalogue so personal overrides cannot mask the contributed files. diff --git a/.claude/skills/import-feature/SKILL.md b/.agents/skills/import-feature/SKILL.md similarity index 100% rename from .claude/skills/import-feature/SKILL.md rename to .agents/skills/import-feature/SKILL.md diff --git a/.claude/skills/import-standard/SKILL.md b/.agents/skills/import-standard/SKILL.md similarity index 99% rename from .claude/skills/import-standard/SKILL.md rename to .agents/skills/import-standard/SKILL.md index cbcc955e..bec6a44c 100644 --- a/.claude/skills/import-standard/SKILL.md +++ b/.agents/skills/import-standard/SKILL.md @@ -119,8 +119,8 @@ subagent), report it as an open question and leave it unwritten. |---|---|---| | tasks and a way to score them, meant for any agent | benchmark, `agent` family | driver + `standard.json` | | questions over a history, meant for a memory or retriever | benchmark, `capability` family | driver with `produce` + `standard.json` | -| a program that does tasks with a model (CLI agent, coding agent) | agent | the `import-agent` skill (`.claude/skills/import-agent/SKILL.md`); its Agent part below if invoked here | -| a component a benchmark calls (memory, retriever) | capability | the `import-capability` skill (`.claude/skills/import-capability/SKILL.md`); its Capability part below if invoked here | +| a program that does tasks with a model (CLI agent, coding agent) | agent | the `import-agent` skill (`.agents/skills/import-agent/SKILL.md`); its Agent part below if invoked here | +| a component a benchmark calls (memory, retriever) | capability | the `import-capability` skill (`.agents/skills/import-capability/SKILL.md`); its Capability part below if invoked here | | a benchmark Harbor already runs, for Harbor agents | not this skill | `import-benchmark` | | the user's own source of a benchmark already here (a fork with a fix, any repository, private included) | a version of that benchmark | `versions..upstream`, below | @@ -362,7 +362,7 @@ output to stderr: stdout carries the JSON lines. for every changed definition (`python3 app/tests/catalogue_docs.py --write`), run `python3 app/tests/parallel.py`, the route suite (`uv run --no-project --with-requirements app/requirements.txt python app/tests/parallel.py app/ui_tests`), - and `python3 .claude/skills/docs-drift/scripts/check_docs.py` from the source + and `python3 .agents/skills/docs-drift/scripts/check_docs.py` from the source root. Keep the test profile/catalogue isolated from personal entries. Do not bake the importing machine's package or diff --git a/.claude/skills/remove-integration/SKILL.md b/.agents/skills/remove-integration/SKILL.md similarity index 100% rename from .claude/skills/remove-integration/SKILL.md rename to .agents/skills/remove-integration/SKILL.md diff --git a/.claude/skills/run-analysis/SKILL.md b/.agents/skills/run-analysis/SKILL.md similarity index 99% rename from .claude/skills/run-analysis/SKILL.md rename to .agents/skills/run-analysis/SKILL.md index 86765645..9fb13a1c 100644 --- a/.claude/skills/run-analysis/SKILL.md +++ b/.agents/skills/run-analysis/SKILL.md @@ -34,7 +34,7 @@ metric is defined. ## Workflow -`S` below is the resolved path to `scripts/runs.py` beside this skill (`.claude/skills/run-analysis/scripts/runs.py` +`S` below is the resolved path to `scripts/runs.py` beside this skill (`.agents/skills/run-analysis/scripts/runs.py` from a checkout root). Standard library only (Python 3.8+); it writes only what `--out` names. ### 1. Locate the runs and agree on names diff --git a/.claude/skills/run-analysis/assets/template.html b/.agents/skills/run-analysis/assets/template.html similarity index 100% rename from .claude/skills/run-analysis/assets/template.html rename to .agents/skills/run-analysis/assets/template.html diff --git a/.claude/skills/run-analysis/references/files.md b/.agents/skills/run-analysis/references/files.md similarity index 100% rename from .claude/skills/run-analysis/references/files.md rename to .agents/skills/run-analysis/references/files.md diff --git a/.claude/skills/run-analysis/references/investigation.md b/.agents/skills/run-analysis/references/investigation.md similarity index 100% rename from .claude/skills/run-analysis/references/investigation.md rename to .agents/skills/run-analysis/references/investigation.md diff --git a/.claude/skills/run-analysis/scripts/runs.py b/.agents/skills/run-analysis/scripts/runs.py similarity index 100% rename from .claude/skills/run-analysis/scripts/runs.py rename to .agents/skills/run-analysis/scripts/runs.py diff --git a/.claude/skills/ui-sweep/SKILL.md b/.agents/skills/ui-sweep/SKILL.md similarity index 98% rename from .claude/skills/ui-sweep/SKILL.md rename to .agents/skills/ui-sweep/SKILL.md index 1120ab06..2dacbd5e 100644 --- a/.claude/skills/ui-sweep/SKILL.md +++ b/.agents/skills/ui-sweep/SKILL.md @@ -67,7 +67,7 @@ rules. It exits nonzero for page JavaScript errors or clipped text and prints the affected screenshots; `report.json` also lists each one's red warning lines. Resolve the script relative to this skill; in a checkout it is - `.claude/skills/ui-sweep/scripts/sweep.py`. Keep captures outside installed + `.agents/skills/ui-sweep/scripts/sweep.py`. Keep captures outside installed package resources. 3. Look at every screenshot of what changed, with `.claude/rules/ui.md` diff --git a/.claude/skills/ui-sweep/scripts/sweep.py b/.agents/skills/ui-sweep/scripts/sweep.py similarity index 99% rename from .claude/skills/ui-sweep/scripts/sweep.py rename to .agents/skills/ui-sweep/scripts/sweep.py index 5ef4afaa..4094ea96 100644 --- a/.claude/skills/ui-sweep/scripts/sweep.py +++ b/.agents/skills/ui-sweep/scripts/sweep.py @@ -1,6 +1,6 @@ """Click through the run builder and the catalogue, and keep a screenshot of each. - uv run --with playwright python .claude/skills/ui-sweep/scripts/sweep.py \ + uv run --with playwright python .agents/skills/ui-sweep/scripts/sweep.py \ --url http://127.0.0.1:5000 --out [--browser ] [--only ] Every benchmark the builder offers, on both runners, on every step that has a diff --git a/.claude/skills b/.claude/skills new file mode 120000 index 00000000..2b7a412b --- /dev/null +++ b/.claude/skills @@ -0,0 +1 @@ +../.agents/skills \ No newline at end of file diff --git a/.claude/skills/file-issue/SKILL.md b/.claude/skills/file-issue/SKILL.md deleted file mode 100644 index 265ee3d2..00000000 --- a/.claude/skills/file-issue/SKILL.md +++ /dev/null @@ -1,71 +0,0 @@ ---- -name: file-issue -description: File a GitHub issue or open a pull request in the shape this repository's forms and judge expect - the Bug or Enhancement form's fields (Priority, Components, Evidence, Screenshot, Reproduction, Expected, Acceptance) and the pull request body's sections (What, Touches, Before and after, Verified, Risk) - with gh, then read it back. Use whenever asked to file, open, record or report an issue or a bug, or to open a PR, or when a defect is found in passing and should be recorded rather than fixed. ---- - -# File an issue, open a pull request - -The forms under `.github/ISSUE_TEMPLATE/` and the template -`.github/pull_request_template.md` are what a person fills in the browser. -An assistant files with `gh` and must produce the same shape, because the PR -judge (`.github/scripts/judge_pr.py`) reads the sections by their headings: -`## Acceptance` in the issue, `## What`, `## Touches`, `## Before and after`, -`## Verified` and `## Risk` in the pull request. - -For an installed-runtime defect reported outside a checkout, select -the repository that owns the cause explicitly with `gh ... --repo OWNER/REPO` -on searches, issue creation and readback; read its templates through GitHub -when needed. A PR requires the source checkout. - -Before anything: search the open and closed issues and pull requests of this -repository and of the repository that owns the cause, with `gh issue list ---search` and `gh pr list --search`. A duplicate splits the evidence. - -## An issue - -1. Decide the kind: **Bug** (the application does something wrong) or - **Enhancement** (it should do something it does not). Decide the - **priority** by how deep the cause reaches: `low` the surface (docs, - templates, static files), `medium` the web layer or the catalogue, `high` - the backend, `extreme` what runs and proves (the standard, execution, - hosts, keys). When undecided, the lowest defensible, and say so. -2. Write the body with the form's headings, in this order, each as `### Name`: - Priority, Components (the form's names, as a list), Evidence (quoted - output, a path, a count), Screenshot (when it is visible: upload with - `gh issue create` from a file, or paste the image link), Reproduction - (numbered steps), Expected, Acceptance (`- [ ]` boxes, one per criterion, - each checkable by a reader of the diff), Dependencies and related. - An enhancement has Today and Wanted in the place of Evidence, Screenshot, - Reproduction and Expected. -3. Create it with the kind's label and the priority label: - - gh issue create --title "" \ - --label bug --label "priority: low" --body-file issue.md - - Set the native type when the repository has one (`Bug`, `Feature`, `Task`): - - gh issue edit --type Bug # or through the web form; gh may lack --type - -4. Read it back: `gh issue view `. The headings and the boxes must be - there; the labels must be the two set. - -## A pull request - -The title is a conventional commit subject, because a squash merge makes it -the commit on `main`: `type(scope): summary`, lowercase except names, no -final period. Type: `feat`, `fix`, `perf`, `refactor`, `docs`, `test`, `ci`, -`build`, `chore` or `revert`. Scope: the part touched, as AGENTS.md lists them -(`standard`, `catalogue`, `runs`, `web`, `docs`, `ci`, ...). For example -`feat(catalogue): run LongMemEval on one question type`. - -The body follows the template: `Closes #n` first when an issue exists, then -`## What`, `## Touches`, `## Before and after` (two images at the same width -when the change is visible; leave the section out otherwise), `## Verified` -(what was run and looked at; "not verified" is a valid answer), `## Risk` -(what could break and how it is undone). Open it with `gh pr create ---body-file pr.md`, then read it back with `gh pr view`. - -## What never goes in - -No key, token or password, no email address or personal message, no private -link, no name of the host or the site's address. No machine attribution trailer in a commit or a body. diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index 1c6843c9..d0308fa9 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -1,68 +1,57 @@ name: Bug -description: Something the application does wrong. Every field is what the judge and the fixer read. +description: Something the application does wrong. labels: ["bug"] type: Bug body: + - type: markdown + attributes: + value: | + Under 150 words, most need 80. The point first, one fact per line, fragments are fine. Cut facts, not grammar. No key, address or private link. A security problem goes to SECURITY.md's address instead. - type: dropdown id: priority attributes: label: Priority - description: How deep it reaches. low, the surface (docs, templates, static files) · medium, the web layer or the catalogue · high, the backend · extreme, what runs and proves (the standard, execution, hosts, keys). + description: How deep it reaches. low, docs and pages · medium, web layer or catalogue · high, backend · extreme, what runs and proves options: [low, medium, high, extreme] validations: required: true - - type: checkboxes - id: components - attributes: - label: Components - description: What it touches. - options: - - label: app/nullius (backend) - - label: app/web (routes) - - label: templates and static files - - label: docs and the site - - label: catalogue (benchmarks, agents, capabilities) - - label: the standard (ports, kits, relay, runs) - - label: CI, workflows and skills - type: textarea id: evidence attributes: label: Evidence - description: What was observed, quoted rather than characterised. Output, an error, a path, a count. No key, no address, no private link. + description: What was observed, quoted. A screenshot when it is visible. + placeholder: | + Run builder, Model: `Qwen 32b` says "No matching models". OpenRouter lists two. validations: required: true - - type: textarea - id: screenshot - attributes: - label: Screenshot - description: When it is visible, a picture of what is wrong. Paste or drop it here. - type: textarea id: reproduction attributes: label: Reproduction - description: The smallest steps or input that show it. + description: The fewest steps that show it. placeholder: | - 1. - 2. + 1. Run builder, GSM8K, provider OpenRouter. + 2. Model: type `Qwen 32b`. validations: required: true - type: textarea id: expected attributes: label: Expected - description: What should have happened instead. + placeholder: Both Qwen 32B models are listed. - type: textarea id: acceptance attributes: label: Acceptance - description: One box per criterion. The judge gives each its own row on the pull request that closes this. + description: | + One box per criterion, checkable in the diff; the judge gives each its own row. Example: `- [ ] Words match in any order and case` value: | - [ ] validations: required: true - - type: textarea + - type: input id: related attributes: - label: Dependencies and related - description: Issues or pull requests this waits on or touches, with their state; the repository that owns the cause when it is not this one. - placeholder: none + label: Related + description: What this waits on; the repository that owns the cause when it is not this one. + placeholder: "#124" diff --git a/.github/ISSUE_TEMPLATE/enhancement.yml b/.github/ISSUE_TEMPLATE/enhancement.yml index 8566b09b..339675fc 100644 --- a/.github/ISSUE_TEMPLATE/enhancement.yml +++ b/.github/ISSUE_TEMPLATE/enhancement.yml @@ -3,53 +3,49 @@ description: Something the application should do, or do better. labels: ["enhancement"] type: Feature body: + - type: markdown + attributes: + value: | + Under 150 words, most need 80. The point first, one fact per line, fragments are fine. Cut facts, not grammar. No key, address or private link. A security problem goes to SECURITY.md's address instead. - type: dropdown id: priority attributes: label: Priority - description: How deep it reaches. low, the surface (docs, templates, static files) · medium, the web layer or the catalogue · high, the backend · extreme, what runs and proves (the standard, execution, hosts, keys). + description: How deep it reaches. low, docs and pages · medium, web layer or catalogue · high, backend · extreme, what runs and proves options: [low, medium, high, extreme] validations: required: true - - type: checkboxes - id: components - attributes: - label: Components - description: What it touches. - options: - - label: app/nullius (backend) - - label: app/web (routes) - - label: templates and static files - - label: docs and the site - - label: catalogue (benchmarks, agents, capabilities) - - label: the standard (ports, kits, relay, runs) - - label: CI, workflows and skills - type: textarea id: today attributes: label: Today - description: What the application does now, quoted or pictured where it is visible. No key, no address, no private link. + description: What the application does now, quoted or pictured. + placeholder: | + Agents, Prove its ports: the Model field is plain text. No list. validations: required: true - type: textarea id: wanted attributes: label: Wanted - description: What it should do, and for whom. A sketch or a screenshot of the target when it is visible. + description: What it should do, and for whom. A sketch when it is visible. + placeholder: | + The builder's model picker there, for the chosen provider. validations: required: true - type: textarea id: acceptance attributes: label: Acceptance - description: One box per criterion. The judge gives each its own row on the pull request that closes this. + description: | + One box per criterion, checkable in the diff; the judge gives each its own row. Example: `- [ ] The kits' form lists its provider's models` value: | - [ ] validations: required: true - - type: textarea + - type: input id: related attributes: - label: Dependencies and related - description: Issues or pull requests this waits on or touches, with their state. - placeholder: none + label: Related + description: What this waits on. + placeholder: "#124" diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 21e04b52..20e5710d 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,16 +1,38 @@ -Closes # + +- `Qwen 32b` found no model: the search wanted the text in one piece. +- Every model field now matches words in any order, through one picker. +- Builder: a pick, Enter or leaving the field sets the model. Typing does not. -## Touches +## Verified + +- Route suite 690, backend 2904. +- Chromium, Firefox, WebKit: 33 checks each. +- Not checked: macOS Safari. + +## Risk - +- A model typed but not set is lost on reload. Undo: revert. +--> + +Closes # + +## What ## Before and after - + | Before | After | | --- | --- | @@ -18,8 +40,4 @@ Closes # ## Verified - - ## Risk - - diff --git a/.github/scripts/judge_pr.py b/.github/scripts/judge_pr.py index 7c0a15fe..a179495b 100644 --- a/.github/scripts/judge_pr.py +++ b/.github/scripts/judge_pr.py @@ -293,13 +293,13 @@ def criteria_of(body: str) -> tuple: IMAGE = re.compile(r"!\[[^\]]*\]\([^)]+\)|]*>|https?://\S+\.(?:png|jpe?g|gif|webp|svg)\b", re.I) TRAILER = re.compile(r"^\s*(?:Co-Authored-By|Co-authored-by):\s*(?:claude|anthropic|chatgpt|openai|gpt|copilot|gemini|codex|cursor|devin|assistant)\b" r"|^\s*(?:Claude-Session|Generated-by|Generated by|Signed-off-by: Claude)", re.I | re.M) -ALLOWED_ROOTS = ("app/", "docs/", ".github/", ".claude/") +ALLOWED_ROOTS = ("app/", "docs/", ".github/", ".agents/", ".claude/") ALLOWED_ROOT_FILES = ("README.md", "AGENTS.md", ".gitignore", ".gitattributes", "LICENSE", "LICENCE") VISIBLE = ("app/templates/", "app/static/", "docs/field-guide.md", "docs/assets/", "docs/diagrams/", "app/site/assets/", "app/site/overrides/") PRIORITY_PATHS = [ # the first match decides; deepest first ("extreme", ("app/nullius/standard/", "app/nullius/execution.py", "app/nullius/hosts.py", "app/nullius/secrets.py", ".github/workflows/", ".github/scripts/")), ("high", ("app/nullius/",)), - ("medium", ("app/web/", "app/nullius/catalogue/", ".claude/", "app/app.py", "app/requirements.txt")), + ("medium", ("app/web/", "app/nullius/catalogue/", ".agents/", ".claude/", "app/app.py", "app/requirements.txt")), ("low", ()), ] MAJOR_FLOOR = ("app/nullius/standard/", "app/nullius/execution.py", "app/nullius/hosts.py", "app/nullius/secrets.py", @@ -374,7 +374,7 @@ def signals_of(diff: str, pr: dict) -> dict: priority, by = priority_of(paths) checks = [ {"name": "No machine attribution trailer in the commits or the description", "ok": not trailers, "detail": trailers[0] if trailers else ""}, - {"name": "New code under app/, docs/, .github/ or .claude/", "ok": not outside, "detail": ", ".join(outside[:3])}, + {"name": "New code under app/, docs/, .github/, .agents/ or .claude/", "ok": not outside, "detail": ", ".join(outside[:3])}, {"name": "No Flask import under the backend package", "ok": not flask, "detail": ", ".join(flask[:3])}, {"name": "No key-shaped string in the diff", "ok": not secrets, "detail": ", ".join(secrets[:3])}, ] diff --git a/.github/workflows/ui-sweep.yml b/.github/workflows/ui-sweep.yml index 2f372971..a94614a1 100644 --- a/.github/workflows/ui-sweep.yml +++ b/.github/workflows/ui-sweep.yml @@ -55,7 +55,7 @@ jobs: if [ -n "$SWEEP_BENCHMARK" ]; then sweep_args+=(--only "$SWEEP_BENCHMARK") fi - "$RUNNER_TEMP/ui-sweep-browser/bin/python" .claude/skills/ui-sweep/scripts/sweep.py \ + "$RUNNER_TEMP/ui-sweep-browser/bin/python" .agents/skills/ui-sweep/scripts/sweep.py \ --url http://127.0.0.1:8791 --out "$RUNNER_TEMP/ui-sweep" "${sweep_args[@]}" # Nothing is kept: artifacts count against the account's storage. The # report goes to the log; screenshots are the local sweep's. diff --git a/AGENTS.md b/AGENTS.md index e77089f9..be25de76 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,430 +1,167 @@ ---- -description: Shared instructions for AI coding assistants in Nullius. ---- - -# AGENTS.md - -Shared instructions for AI coding assistants working in **Nullius**. -Keep this file specific, factual, and cross-tool. Prefer nearby code over -assumptions. Describe current behavior and constraints; remove obsolete code -and historical commentary unless the user explicitly asks to keep it. - -`README.md` carries the design and rationale. This file is the map. - -## What This Repo Is - -**Nullius is an application: bring anything, run it, prove it.** A -benchmark, an agent or any capability comes into its catalogues by one prompt -(the import skills), is paired by the ports it has proven (the Nullius -standard, `docs/standard.md`), runs here or on many machines, and every score -opens into the evidence behind it - the agent's failure or the benchmark's. -It reads Harbor's output too, from any agent, and ATIF and OpenTelemetry -exports. It runs a benchmark only on an explicit Run from the builder's Review step - a -standard recipe (a benchmark's own scripts included, as its Original setup) -or a Harbor recipe - on this machine or a host (`app/nullius/execution.py`). A Harbor recipe pins its Harbor - a -release from PyPI, or a repository (a private fork included) at a commit, -built on this machine and its wheels sent to a host - and runs it through -`uvx`, outside this application's interpreter (`app/nullius/harbor/source.py`); -a recipe without a pin runs whatever `harbor` is on the target's PATH. -The job records which one ran. - -Application code lives under `app/`; topic documentation lives under `docs/`. -**New code goes under `app/`**, never loose at the root. Root `pyproject.toml` -builds the `nullius-eval` distribution: `nullius` is the backend, `_nullius_app` is the UI -and its resources. - -- `app/app.py` — the entry point: the application object from `app/web/core.py`, - the capability modules imported so each registers its routes, `main()`. -- `app/web/` — the Flask side, one module per capability: `core` (the application object), `shared` (the open - workspace and its jobs, path resolution, the catalogue cache, the query - helpers, the form-token guard), `filters` (template filters, page context), - then `runs`, `traces`, `compare`, `builder`, `catalogue`, `agents`, - `settings`, `workspaces`, `execute`, `judge`, `feasibility`, `reconcile`, `judge_tasks`, `onboarding`, `failure` (`agents` is the Agents - and Capabilities tabs and conformance Kits catalogue). Cross-module names are reached as - attributes (`shared.STATE`, `traces._trial_evidence`): patch one, patched for all. -- `app/nullius/` — its backend, one package per purpose: `runs/` (reading one - Harbor job tree: `parse`, `classify`, `live`, `artifacts`, `evidence`, - `feasibility`, `failure_analysis` - a job's failure labels and task flags, beside its result.json, written by `flags_cli` too -, `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`, 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 - datasets nested in it, its `report` block and its `standard.json` when it runs on the standard; - `harbor_entry`, - a Harbor benchmark added from the Benchmarks page's form; `citation`, an entry's - BibTeX read into the paper its page shows; `storage`, whole-folder user overlays and restoring bundled entries; `sources`, where each dataset's data comes - from for each way it runs), `recipes/` - (`launch`, the builder's vocabulary; `store`, its saved recipes), `providers` (the model provider registry: protocols, presets and each provider's record, read by every consumer; and the builder's steps), - `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`, 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), `proofs` (generated evidence in sibling `proofs.json`), `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 - server of its domains' tools, `mcp_server`: the upstream's own, run on the machine; OSWorld1's also its null control's - agent, `nop`, and the `runner` of a unit an agent runs: the upstream's loop with the computer port's bridge; OSWorld2's also `nop`, `api_logs` (each image of its API logs kept once), `websites` (its mock - websites: the checks before a VM start, Overleaf's lock and reset, the stack's command line), `gitlab_server` (its - GitLab: made once on the run's machine with its token, its tasks' lock, the stack's command line), `proxy` (a - tinyproxy of a unit's own for the tasks that ask for a proxy) and, in `startup/`, - `sitecustomize`: its VMs' disk write limit in every process its driver starts), `catalogue/agents//` - (the reference `agent`; DigitalMate's `run`, `gateway` and `acp` (product startup, task submission, and its fixed version's ACP sessions); - JiuwenSwarm's `agent`, mini-swe-agent's `run` and SWE-agent's `run`, the wrappers that start them) and `catalogue/capabilities//` (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), `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 - names (`runs/`, `traces/`, `builder/`, …; `base.html`, `style.css` and the fonts at the top), including the command - builder's JavaScript, which owns the generated recipes. `app/templates/_tables.html` and - `app/static/tables.js` are the table toolkit: one column list builds a table's headers, cells and controls. - `app/templates/_cards.html` lays the same field list out as cards, one slot per field. - `app/templates/_icons.svg` is the icon sprite, checked by `app/tests/test_icons.py`. -- `app/tests/`, `app/ui_tests/` — the backend suite and the route suite. - Beside the backend tests sit scripts run by hand: - `app/tests/field_contract.py`, which refreshes the `field_contract.json` the - suite checks, and `app/tests/catalogue_docs.py`, which writes the Supported - sections under `docs/` from explicit bundled catalogue roots, never user overlays: each section's README block and - a page per benchmark, agent and capability (`test_catalogue_docs.py` fails - when they are stale). The fixtures under `app/tests/fixtures/` are small and - hand-made. -- `app/site/` — the static website: MkDocs configuration and - source staging. It publishes `docs/`. - `diagrams.py` draws the figures under `docs/diagrams/` - (`--write` after a change; `test_site.py` fails when they are stale). - `readme_media.py` draws the README’s animated SVGs under - `docs/assets/nullius/readme/` (`--write` to refresh, `--check` for drift). - Build dependencies are isolated in `app/site/requirements.txt`; - build, preview and publishing instructions are in `app/site/README.md`. -- `docs/` — the introduction, quickstart, concepts and results guides; `settings/`, - `benchmarks/`, `agents/` and `capabilities/` hold focused guides; topic pages and the example of a new benchmark. Keep validations, captures and rendered reports out of `docs/`. - -Benchmark integrations expose one current entry with supported behavior as options. -Internal driver changes do not create selectable versions. Reserve benchmark versions -for explicit upstream releases or requested forks; retain only applicable proofs. -Authored definitions contain configuration; generated evidence belongs in the entry's -`proofs.json`. Proof runs leave definition files untouched. Read through -`definitions` to combine the two; do not infer proven ports from raw definition JSON. - -### Installation and user storage - -**Flask is the application's only direct runtime dependency.** Nullius itself -is installed with `uv tool install nullius-eval` from PyPI, selecting the latest -version unless one is explicitly pinned. The executable is `nullius`. - -`nullius paths` lists persistent locations. On Linux, settings, the model price -list and benchmark licences live under `~/.config/nullius/`, user catalogue entries, workspaces, -runs, saved builder recipes and standard installs under `~/.local/share/nullius/`, and caches under -`~/.cache/nullius/`. XDG variables move those roots; `NULLIUS_HOME` selects a -separate profile with `config/`, `data/` and `cache/`. Settings saves owner-only JSON; process environment values win. -No personal data belongs inside the installed package. See `docs/getting-started.md` for installation -and migration, and `docs/settings/README.md` for paths and precedence. - -## Instruction Priority - -- Follow system, tool, and user instructions first, then this file, then - the rules under `.claude/rules/` (`running.md`: what runs and installs, how - to read a result; `traces.md`: what the pages do with a trace; `ui.md`: - the owner's rules for every page and the scope of UI checks). -- Prefer small, targeted diffs. Do not refactor unrelated areas - opportunistically. -- Add a test only for a distinct regression no existing test catches, and docs - only when what they say became wrong or a reader needs it to choose or act. - Neither is owed by a change: none is a valid answer. - -## Core Architecture - -Three dependency rules. Each is load-bearing and each has a test. - -- **`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 - fails when there is more than one. A local package can shadow an installed distribution, so successful imports alone do not prove it. -- **The templates' field contract is pinned.** Templates read Python data objects (such as Job, Trial and Verdict) - by attribute name, and no import catches a renamed field — - it surfaces as a blank cell or an `UndefinedError` at request time. - `app/tests/field_contract.json` pins them and `test_field_contract.py` - fails on a removal. After a deliberate change to a rendered class, refresh - the pin with `python3 app/tests/field_contract.py --write`; it refuses when a - module cannot be imported, so a refresh cannot bless a loss. - -Bundled resources resolve from `__file__`; personal storage resolves through -`nullius.paths`. The source `app/` directory moves as a unit; moving it also -requires updating the package mapping in `pyproject.toml` and the test-discovery -paths in `.github/workflows/tests.yml`. +# Nullius + +Bring any benchmark, agent or capability, run it, and open every score into the +evidence behind it: the agent's failure or the benchmark's. + +- Runs through the Nullius standard (`docs/standard.md`) or Harbor, only on an + explicit Run. Also reads Harbor, ATIF and OpenTelemetry results. +- `app/nullius/` is the backend: standard library only, an entry's own code aside. + `app/web/` is Flask, the only runtime dependency. + +The user's instructions come first, then this file, then `.claude/rules/`. This +file holds rules for any assistant: no file lists, no history. + +## How we work + +- **Small diffs.** No refactoring on the way. A defect found in passing becomes + an issue, not a wider change. +- **Nearby code over assumptions.** Describe what is. Remove obsolete code and + historical comments unless asked to keep them. +- **Facilitator, not re-implementer.** A benchmark, agent or capability runs its + upstream's own code at a pin, in its own environment. Ask before writing more + than glue. +- **Reuse before adding.** In the backend, for example, `paths`, `ondisk`, + `redact`, `settings`, `providers`; on a page `_tables.html`, `_cards.html`, + `tables.js`, `model-picker.js`, `disclosures.js`, `_icons.svg`. +- **No machine attribution** in a commit or a pull request: no assistant + `Co-Authored-By`, session link or generated-by line. Human co-authors stay. + Existing commits are not rewritten for it. +- **Nothing merges without the user's word.** + +## Three rules, each with a test + +1. `app/nullius/` imports no Flask (`test_layering`). A backend test that needs + Flask means the layering broke. +2. One provider of `nullius` per interpreter (`test_dependency_surface`): a local + package can shadow an installed one. Source commands use `uv run --no-project`. +3. Fields the templates read are pinned, for the modules `field_contract.py` lists + (`test_field_contract`). A rename is a blank cell, not an import error. + +Bundled files resolve from `__file__`, personal ones through `nullius.paths`. +No personal data in the package. + +## Where code lives + +New code goes under `app/`, never at the root. A module's docstring says what it +is: `grep -m1 '"""' app/nullius/runs/*.py`. + +| Path | Holds | +| --- | --- | +| `app/nullius/runs/`, `traces/`, `compare/` | Reading one job tree, a trial's trace, several runs | +| `app/nullius/catalogue/` | A folder per entry under `benchmarks/`, `agents/`, `capabilities/`: its definition and its own 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 | +| `app/nullius/standard/` | The standard: `contract/`, `requirements/`, `protocols/`, `calls/`, `backends/`, `runner/`, `proofs/`, `pages/`, importing one way (`test_layering`), and the conformance `kits/` | +| `app/web/` | One module per capability; `core` is the application, `shared` what pages share. Use another module's names as attributes (`shared.STATE`): patch one, patched for all | +| `app/templates/`, `app/static/` | The interface, under the same capability names | +| `app/tests/`, `app/ui_tests/` | Backend and route suites; fixtures are small and hand-made | +| `app/site/`, `docs/` | The website; the documentation it publishes | +| `.agents/skills/` | Skills; `.claude/skills` links here | ## Commands -The backend suite imports only the standard library; its offline Harbor build -fixtures also need git and uv/uvx on PATH. Only the route suite needs Flask, -the one requirement in `app/requirements.txt`. Use `uv run --no-project` for -source commands so the root packaging metadata does not install a second copy -of Nullius into the source test interpreter. Run everything from the -repository root. `app/tests/parallel.py` runs a suite one module per process, -several at a time; `python3 -m unittest discover -s app/tests -t app` runs the -same tests in one process. -The parallel runner selects a temporary profile before importing test modules. -When invoking unittest directly, set `NULLIUS_HOME` to a temporary directory -and unset personal catalogue/storage overrides before discovery. +From the repository root: ```bash +# backend suite; --docker adds the tests that run containers python3 app/tests/parallel.py -# with the docker tier: the tests that build and run containers for real -# (app/tests/docker_tier.py), skipped otherwise -python3 app/tests/parallel.py --docker - # route suite uv run --no-project --with-requirements app/requirements.txt \ python app/tests/parallel.py app/ui_tests -# docs drift is the /docs-drift skill (.claude/skills/docs-drift/SKILL.md), -# run by hand: its script checks links and paths, then the prose is read - -# the installed app (or use the source command below) -nullius serve - -# from a source checkout -uv run --no-project --with-requirements app/requirements.txt app/app.py jobs - -# refresh the templates' field contract -python3 app/tests/field_contract.py --write - -# refresh the Supported sections after a catalogue definition changes -python3 app/tests/catalogue_docs.py --write - -# the importer registry: ATIF and OpenTelemetry -PYTHONPATH=app python3 -m nullius.importers.cli --list +# the app +uv run --no-project --with-requirements app/requirements.txt app/app.py ``` -Debug mode is off by default. Use `--debug` only for development; `--no-debug` -overrides an explicit `DEBUG=1` environment setting. - -**CI** (`.github/workflows/`): - -- `tests`: backend and route suites, actionlint, and a wheel install check - (`app/packaging/verify.py`). Non-draft pull requests, and by hand. -- `judge-pr`: the PR judge, below. Non-draft pull requests, and `/judge`. -- `docker-tests`: the backend suite with the docker tier. Nightly, and by hand. -- `draft release` (`release.yml`): builds and verifies a release's wheel and - source archive into a draft GitHub release. By hand; never publishes. -- `publish to PyPI` (`publish.yml`): uploads a reviewed, published release's - verified assets by Trusted Publishing. By hand, with confirmation. -- `documentation site`: checks the site build, by hand - (`bash app/site/host-build.sh` locally). The host publishes from - `docs-release`, advanced to the release tag after the PyPI upload. - -See `app/packaging/README.md`, `docs/releases/` and `app/site/README.md`. - -**UI checks:** `.claude/rules/ui.md`. The `UI sweep` workflow runs nightly and by hand. A benchmark key narrows it. It fails on page JavaScript errors or clipped text. Screenshots are the local sweep's -and need visual review. - -**The PR judge** (`.github/workflows/judge-pr.yml`, running -`.github/scripts/judge_pr.py`) comments on every pull request: two ratings, then a -table of questions. **Merge risk** (minor, medium, significant, major, -severe) is the TypeSafe judge's reading of what happens if the change merges -and is wrong, floored by the script (a deleted test, a key-shaped string or a -workflow change is severe at least; the standard, execution, hosts, secrets, -the parser or the classifier is major at least). **Priority** (low, medium, -high, extreme) is how deep the diff reaches, computed from its paths alone. -The questions, asked k=3 times with medians: each acceptance criterion of the -linked issue (the `## Acceptance` checkbox list, one row per box; a body -without one is judged whole), whether the issue and the PR describe the same -change, whether the description matches the diff, whether the diff stays in -scope, whether `## Risk` names what could break; `## Before and after` is -counted by the script when the diff touches what is visible. Issue rows show `–` when the PR links no issue. Everything the -judge reads has been through `redact` first: key-shaped strings and email -addresses never leave the runner. `/judge` from an owner, member or collaborator asks again, a draft included. Experimental: -never a required check; without the secret `TYPESAFE_API_KEY` (or `API_KEY_TYPESAFE`) it reports "not configured" and stays -green. Offline: `python3 .github/scripts/judge_pr.py --pr-file pr.md ---diff-file pr.diff [--issue-file issue.md] --dry` builds the states and asks -nothing. - -**Run analysis** is the `/run-analysis` skill -(`.claude/skills/run-analysis/SKILL.md`): triage of a run that failed or looks -wrong, an analysis of one job, or a comparison of several, written up as one -self-contained page. Its script, `.claude/skills/run-analysis/scripts/runs.py`, -prints health verdicts, computes the metrics and -renders the page from the template beside it; the findings and the prose are -the assistant's, by the procedure in the SKILL.md. - -## Conventions - -Use `nullius.thinkflowlab@proton.me` for Nullius-owned contact email addresses, -including security reports. - -### Documentation - -`docs/` is terse: fragments and tables, the fewest words that change what a -reader chooses, does or concludes. - -- Keep guarantees, requirements, refusals and their fix. Drop the mechanism - (flags, files, protocols, how a key travels), interface narration, history - and asides. -- A table cell is a line, not a paragraph. One fact lives on one page; others link. -- A prerequisite Review already checks is not repeated. -- `docs/standard.md` headings are never renamed: the import skills cite them. - -### Test design - -- Test observable behavior, contracts and meaningful failure modes—not incidental - wording, internal structure or current catalogue contents. -- Before adding a test, inspect nearby coverage. Extend an existing case or use - subtests when the fixture and behavior are shared. -- Add a separate test when it protects a distinct regression or needs a different - setup. A past bug alone does not require a separate test. -- Assert exact text only when that text is a contract. -- Before removing a test as redundant, identify the surviving assertions that - protect its behavior. Shared line coverage alone is insufficient. -- Consolidation must preserve edge cases and fixture isolation. Fewer test methods - is not itself the goal. - -### Attribution - -**No machine attribution in commit messages or pull request descriptions** — no -`Co-Authored-By: Claude …` or any assistant variant, no `Claude-Session:` or -other session metadata, no generated-by signature. Keep the message about the -change and why it was made. - -**Legitimate human co-authors are preserved.** A `Co-Authored-By` naming a real -person who contributed is correct and expected. - -Two things enforce it: -`.claude/settings.json` sets `attribution` to empty for `commit` and `pr` with -`sessionUrl` off, and a `commit-msg` hook in the shared Git directory rejects -machine signatures while allowing human co-authors. **Do not bypass the hook** -(no `--no-verify`). - -Existing commits are **not** rewritten. Do not amend, rebase or force-push to -strip trailers from history. - -The metric field guide (`docs/field-guide.md`) is a living document: a change that alters what it -defines updates it in the same change. `app/tests/test_field_guide.py` fails -when a field it names leaves the backend, when its stated counts stop -matching its tables, or when its outcome vocabulary stops being the -classifier's; what each metric means is still read by a person. - -The builder saves and imports recipes as JSON. Review runs them through the -execution backend. -`app/ui_tests/test_recipe_execution_fixtures.py` pins the compiled execution plans. - -### Issues - -Before opening anything, **search existing issues *and* pull requests** — -across the repositories involved, not just this one. - -An issue carries enough to act on without a conversation. The forms under -`.github/ISSUE_TEMPLATE/` (Bug, Enhancement) hold the fields: **Priority** -(how deep it reaches: low the surface, medium the web layer or the -catalogue, high the backend, extreme what runs and proves), **Components**, -**Evidence** (what was observed, quoted rather than characterised), a -**Screenshot** when it is visible, **Reproduction** (the smallest steps or -input that show it), **Expected**, **Acceptance** (one checkbox per -criterion; the judge gives each its own row) and **Dependencies and -related**. A pull request's title is a conventional commit subject, since a -squash merge makes it the commit on `main`: `type(scope): summary`, the -summary lowercase (names keep their case) without a final period. The type is -one of `feat`, `fix`, `perf`, `refactor`, `docs`, `test`, `ci`, `build`, -`chore` or `revert`; the scope is the part it touches: `standard`, -`catalogue`, `runs`, `traces`, `compare`, `judge`, `builder`, `web`, -`execution`, `settings`, `docs`, `site`, `ci`, `release`. For example -`fix(standard): give drivers only the nullius package on PYTHONPATH`. -A pull request's body follows `.github/pull_request_template.md`: -`Closes #n`, What, Touches, Before and after (two images when the change is -visible), Verified, Risk. An assistant files either with the `/file-issue` -skill (`.claude/skills/file-issue/SKILL.md`), which produces the same shape -with `gh`. No key, address, personal message or private link in any of it. - -Where it goes: - -- **File a bug in the repository that owns the cause**, not the one where the - symptom appeared: a cause in Harbor is Harbor's issue, with a link from here. -- **Minor or unconfirmed observations go to the parent**, rather than becoming - a speculative issue in a component repository. - -How it is kept: - -- **Set the native Type and Priority when the issue is created.** Where the priority is genuinely undecided, - choose the lowest that is defensible and say in the body that it is a - placeholder. Reuse the labels that exist (`bug`, `enhancement`). -- **Assign `aitianshi`** where that is the real ownership; an inappropriate - assignee is worse than none, and a session identifier is not an account. -- **Every implementation pull request references its issue**, and the issue's - Development panel shows it. Body text is the means, not the proof: read it - back with `closedByPullRequestsReferences` in the GraphQL API before calling - the work done. Stacked pull requests link the same way; a base is never - retargeted for the panel's sake. -- **Update the metadata at every change** of scope, ownership, priority, - dependencies, implementation PR, validation evidence or completion. - -**Recording something is not a licence to fix it.** Writing an issue for a -defect found in passing is the correct response to noticing it; widening the -current change to address it is not. Repositories stay private, and nothing -merges without the user's word. - -### Native capabilities and composition - -When evaluating an agent's capabilities, inspect the pinned upstream's callable -interfaces; do not infer memory or retrieval from conversation support. Keep -native, augmented and replacement setups distinct. A component's port proof -does not prove an agent uses it, and adding a tool is not necessarily replacing -a native capability. The current runner has no generic agent-plus-capability -recipe. Follow `docs/standard.md`, "Native capabilities and composition", and -the import skills for evidence requirements and reporting integration gaps. - -## More Detail - -- The product, what each page does and why — `README.md`, then the topic - pages `docs/builder.md`, `docs/judgement.md`, `docs/settings/README.md`, `docs/cli/README.md` -- What each metric means and how portable it is — `docs/field-guide.md` -- Open work — the GitHub issues -- The benchmark catalogue: a folder per benchmark, what an entry holds, the - listing rule and its checks — the docstring of `app/nullius/catalogue/catalog.py` -- The builder's vocabulary and the agents it offers — - `app/nullius/recipes/launch.py`; the recipe core `app/static/builder/command-builder-core.js` -- The Harbor a recipe pins: the pin, the build here, the cache, the scan, the - `harbor` script a run calls — the docstring of `app/nullius/harbor/source.py`; - `docs/builder.md`, "Which Harbor" -- Bringing a new benchmark in, either way, starts at the `/import-benchmark` skill - (`.claude/skills/import-benchmark/SKILL.md`), which asks the route - Harbor, or - the Nullius standard through `/import-standard`, where a paper's own scripts run - as its Original setup; by hand, `docs/examples/new-benchmark/` - a Harbor entry - to copy, and the steps; a Harbor benchmark also from the Benchmarks page, - *+ Add a benchmark* - a prompt for any assistant - or by hand *Add a Harbor - benchmark* (`app/nullius/catalogue/harbor_entry.py`) -- The Nullius standard - benchmarks, agents and capabilities matched by proven - ports, run over ACP, MCP and the relay; importing each by hand and with the - `/import-standard` skill for a benchmark, `/import-agent` for an agent and - `/import-capability` for a capability (`.claude/skills//SKILL.md`; the - Agents and Capabilities tabs' *Add* button writes the prompt for any assistant) - - `docs/standard.md`; the code under `app/nullius/standard/`. Nullius is a - facilitator, not a re-implementer: a benchmark, agent or capability runs its - upstream's own code at a pin, its dependencies in its own environment, and - any code of ours beyond glue is asked about first -- Settings, its variables and their validation — `app/nullius/settings.py`; - hosts, keys and the connection test — `app/nullius/hosts.py` -- Removing a benchmark, agent or capability throughout the app, including - generated artifacts and requested runtime data — `/remove-integration` - (`.claude/skills/remove-integration/SKILL.md`) -- Running a recipe: the plan, the parts, a host, the mirror, the record a - restart reads — the docstrings of `app/nullius/execution.py`; the routes in - `app/web/execute.py` -- Judgement: questions, state, client, store, batch, reconcile, lanes — - `app/nullius/judge/` -- The live board, and the four rules it must keep — the docstring of - `app/nullius/runs/live.py` -- Machine-specific notes (confinement, disk) — `.claude/environment.local.md`, - gitignored and per checkout +- The backend suite needs git and uv on PATH. Without Node, the tests of the + pages' scripts skip. +- unittest by hand: `NULLIUS_HOME` a temporary folder, personal catalogue and + storage variables unset. +- A page change: its tests and focused browser checks, not the full sweep. +- CI on non-draft pull requests: the tests, and the PR judge, which never gates. + +| Changed | Refresh | +| --- | --- | +| A class the templates render | `python3 app/tests/field_contract.py --write` | +| A catalogue definition | `python3 app/tests/catalogue_docs.py --write` | +| A documentation figure | `python3 app/site/diagrams.py --write` | +| The README's animated SVGs | `python3 app/site/readme_media.py --write` | +| What a metric means | `docs/field-guide.md`, by hand | + +## Tests and docs + +A change owes neither. + +- **A test** for a distinct regression no existing test catches: behavior, a + contract, a failure mode. Not wording, structure or catalogue contents. Extend + a nearby case first. +- **Removing a test:** name the assertions that still protect its behavior, and + keep its edge cases and fixture isolation. +- **Docs** when what they say became wrong, or a reader needs them to choose or + act. The code already says how it works. No prerequisite Review already checks. +- **In `docs/`:** keep guarantees, requirements, refusals and their fix; drop + mechanism, narration and history. One fact, one page. A table cell is a line. + No validations, captures or rendered reports. +- Headings of `docs/standard.md` are never renamed: the import skills cite them. + +## Catalogue + +- One entry per benchmark; what it supports is an option. A version is an + upstream release or a requested fork, never a change of our driver. +- Definitions hold configuration. Proof runs write evidence to `proofs.json` + beside them and leave them untouched. Read both through `definitions`; never + infer proven ports from raw JSON. +- An agent's native capability is a callable its pinned upstream exposes, tested. + A component's proof does not prove an agent uses it. + +## Issues and pull requests + +The `file-issue` skill files both. The templates hold the shape and an example. + +- Search issues and pull requests first, here and where the cause lives. +- A pull request references its issue, with `Closes` when it finishes it. +- Title: `type(scope): summary`, lowercase except names, no final period. A squash + makes it the commit on `main`, and the body its message. + - Types: `feat` `fix` `perf` `refactor` `docs` `test` `ci` `build` `chore` `revert` + - Scopes: `standard` `catalogue` `runs` `traces` `compare` `judge` `builder` + `web` `execution` `settings` `docs` `site` `ci` `release` +- No key, email address, personal message or private link. +- A security problem goes to Nullius's contact address, + `nullius.thinkflowlab@proton.me`, never to an issue (`SECURITY.md`). + +## Writing + +Short and plain: issues, pull requests, their comments, docs. + +- The point first, then why. One fact per line. Fragments are fine. +- Cut facts, not grammar: a stranger must be able to act on it. +- Numbers and quotes, not adjectives. No background, file tour, hedging or + restated diff. + +| No | Yes | +| --- | --- | +| This change introduces a comprehensive improvement to model search, which previously could fail to surface relevant results in certain cases. | `Qwen 32b` found no model. Words now match in any order. | + +## Read first + +| Working on | Read | +| --- | --- | +| What runs, reading a result | `.claude/rules/running.md` | +| The trial page's trace | `.claude/rules/traces.md` | +| Any page | `.claude/rules/ui.md`; `/ui-sweep` only when asked | +| Vocabulary | `docs/concepts.md` | +| The standard, its ports and kits | `docs/standard.md` | +| Adding an entry | `/import-benchmark`, `/import-standard`, `/import-agent`, `/import-capability`; by hand, `docs/examples/new-benchmark/` | +| Removing an entry | `/remove-integration` | +| How the catalogue loads | Docstring of `app/nullius/catalogue/catalog.py` | +| The run builder | `docs/builder.md`; `app/nullius/recipes/launch.py`; `app/static/builder/command-builder-core.js` | +| A pinned Harbor | Docstring of `app/nullius/harbor/source.py` | +| Running a recipe, hosts | Docstrings of `app/nullius/execution.py` and `app/nullius/hosts.py` | +| The live board | Docstring of `app/nullius/runs/live.py` | +| Settings and storage | `docs/settings/README.md`; `app/nullius/settings.py` | +| Judgement; the PR judge | `docs/judgement.md`; docstring of `.github/scripts/judge_pr.py` | +| A run that looks wrong, comparing runs | `/run-analysis` | +| Stale docs | `/docs-drift` | +| The website; a release | `app/site/README.md`; `app/packaging/README.md` | +| This machine | `.claude/environment.local.md`, gitignored | diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ae6f2342..80de472a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -44,7 +44,7 @@ The tests require a Flask-free backend, one provider of `nullius`, and the templ Use the import skills rather than writing an entry by hand: `/import-benchmark`, `/import-standard`, `/import-agent` and `/import-capability` under -`.claude/skills/`. Each pins the upstream, wraps the upstream's own code and +`.agents/skills/`. Each pins the upstream, wraps the upstream's own code and proves what fits. Nullius is a facilitator, not a re-implementer: anything beyond glue is asked about first. The *+ Add* button on the Benchmarks, Agents and Capabilities pages writes the prompt for any assistant. @@ -87,8 +87,8 @@ decision by the repository owner. - **Small and targeted.** One change per pull request; no refactoring of unrelated areas on the way. -- **Fill in the template.** The PR judge compares the description with the - diff and with the linked issue's acceptance list. +- **Fill in the template, short.** It holds an example. The PR judge compares it + with the diff and with the linked issue's acceptance list. - **Reference the issue** so it shows in the issue's Development panel. - **Say what you verified.** Tests run, browser checks made, widths tried. "Not verified" is an honest answer. @@ -96,7 +96,6 @@ decision by the repository owner. Commit messages are about the change and why it was made. No machine attribution: no `Co-Authored-By: Claude`, no session metadata, no generated-by -signature. A hook rejects them; do not bypass it. A real person who contributed -is named as a co-author as usual. +signature. A real person who contributed is named as a co-author as usual. Nothing merges without the repository owner's word. diff --git a/app/nullius/standard/pages/howto.py b/app/nullius/standard/pages/howto.py index 74f7f603..e7363ab8 100644 --- a/app/nullius/standard/pages/howto.py +++ b/app/nullius/standard/pages/howto.py @@ -203,7 +203,7 @@ def prompt(kind: str) -> str: "capability": "Verify its callable operations and proven ports.\n", }[kind] return (f'Add the {kind} "{{name}}" to Nullius.\nSource: {{source}}\nRemark: {{remark}}\n\n' - f"Follow /import-{kind}, or .claude/skills/import-{kind}/SKILL.md in the source checkout, " + f"Follow /import-{kind}, or .agents/skills/import-{kind}/SKILL.md in the source checkout, " "with docs/standard.md and AGENTS.md. If unavailable, ask for the checkout.\n" f"Write to {target}, even when the skill names package paths. " "For an existing bundled entry, copy its whole folder there first; never edit installed files. " diff --git a/app/tests/test_standard_howto.py b/app/tests/test_standard_howto.py index 19b1043a..47814746 100644 --- a/app/tests/test_standard_howto.py +++ b/app/tests/test_standard_howto.py @@ -82,7 +82,7 @@ def test_each_kind_names_its_skill_both_ways_and_has_three_slots(self): for kind, command in (("agent", "/import-agent"), ("capability", "/import-capability"), ("benchmark", "/import-benchmark")): text = howto.prompt(kind) self.assertIn(command, text) - self.assertIn(f".claude/skills/{command[1:]}/SKILL.md", text) + self.assertIn(f".agents/skills/{command[1:]}/SKILL.md", text) self.assertIn("docs/standard.md", text) for slot in ("{name}", "{source}", "{remark}"): self.assertEqual(text.count(slot), 1, (kind, slot)) diff --git a/app/ui_tests/test_agents.py b/app/ui_tests/test_agents.py index a2498def..459d2dd6 100644 --- a/app/ui_tests/test_agents.py +++ b/app/ui_tests/test_agents.py @@ -201,9 +201,9 @@ def test_agents_capabilities_and_kits_are_cards_by_default_and_a_table_on_reques def test_the_add_dialog_builds_a_prompt_and_keeps_the_steps_by_hand_for_each_kind(self): for url, a, skill, words in ( - ("/agents", "an agent", ".claude/skills/import-agent/SKILL.md", + ("/agents", "an agent", ".agents/skills/import-agent/SKILL.md", ("nullius standard new agent my-agent", "--unsandboxed", ""start": {")), - ("/capabilities", "a capability", ".claude/skills/import-capability/SKILL.md", + ("/capabilities", "a capability", ".agents/skills/import-capability/SKILL.md", ("nullius standard new capability my-memory", ""project"", "from my_memory import Store"))): html = self.get(url).get_data(as_text=True) self.assertIn(f'', html) diff --git a/docs/standard.md b/docs/standard.md index 083c5593..aacdec91 100644 --- a/docs/standard.md +++ b/docs/standard.md @@ -587,7 +587,7 @@ An agent or a capability may keep several versions in its one file: an older rel | `/import-capability` | A capability | The prompt includes your writable catalogue path. An assistant on another -machine uses a source checkout and asks you to update Nullius. Skills live under `.claude/skills//SKILL.md`; +machine uses a source checkout and asks you to update Nullius. Skills live under `.agents/skills//SKILL.md`; install them in the assistant or give it the checkout. Use pinned upstream code. Review any proposed custom implementation before it From 95e6150b78e92d4154f90801b41b76638d4a53bf Mon Sep 17 00:00:00 2001 From: Etienne Filhol Date: Tue, 24 Nov 2026 23:11:18 +0100 Subject: [PATCH 3/8] ci: have the PR judge accept a short description, and open pull requests as drafts --- .agents/skills/file-issue/SKILL.md | 4 +++- .github/scripts/judge_pr.py | 10 +++++----- AGENTS.md | 3 ++- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.agents/skills/file-issue/SKILL.md b/.agents/skills/file-issue/SKILL.md index a63fa518..8ff69bdc 100644 --- a/.agents/skills/file-issue/SKILL.md +++ b/.agents/skills/file-issue/SKILL.md @@ -53,7 +53,9 @@ title's types and scopes are in AGENTS.md. A visible change has two images of on width under `## Before and after`; otherwise drop the section. "Not checked" is a valid line. - gh pr create --title "fix(web): ..." --body-file pr.md + gh pr create --draft --title "fix(web): ..." --body-file pr.md + +It stays a draft until the user says it is ready: CI runs then. Read both back. The issue must list the pull request in `closedByPullRequestsReferences` (GraphQL); stacked pull requests link the same diff --git a/.github/scripts/judge_pr.py b/.github/scripts/judge_pr.py index a179495b..0b955882 100644 --- a/.github/scripts/judge_pr.py +++ b/.github/scripts/judge_pr.py @@ -67,7 +67,7 @@ URL = "https://api.typesafe.ai/v1/systemone" MODEL = "jev-latest" PROVIDER = "typesafe.ai" -QUESTIONS_VERSION = "judgement.questions.pr.v2" +QUESTIONS_VERSION = "judgement.questions.pr.v3" PRICE_PER_MTOK = 0.042 # USD per million input tokens (docs.typesafe.ai/models) CHARS_PER_TOKEN = 4 FILE_LIMIT = 12_000 # characters of one file's diff kept (--file-limit) @@ -104,9 +104,9 @@ }, "description_matches": { "type": "choice", - "instructions": "Does the pull request description describe the change the diff makes, claiming nothing the diff does not do and leaving out nothing the diff does?", - "criteria": {"yes": "What the description says the change does, the diff does, and nothing material is left unsaid", - "partly": "The description is right as far as it goes but leaves out a material part of the diff, or overstates a detail", + "instructions": "Does the pull request description name the change the diff makes and claim nothing the diff does not do? A short description is right: details are left to the diff.", + "criteria": {"yes": "What the description says the change does, the diff does, and each main change is named, in however few words", + "partly": "The description never names one of the main changes, or overstates a detail", "no": "The description claims a change the diff does not make, or describes a different change"}, }, "scope": { @@ -576,7 +576,7 @@ def short(text: str, n: int = 90) -> str: ROWS = [ # (question id or script row, the text of the row) ("criteria", "Changes do what the issue asks"), ("issue_same", "Issue and pull request describe the same change"), - ("description_matches", "Description matches the diff, no more, no less"), + ("description_matches", "Description matches the diff"), ("scope", "Diff stays in scope"), ("risk_named", "Risk named in the description"), ("before_after", "Before and after shown"), diff --git a/AGENTS.md b/AGENTS.md index be25de76..f76df7aa 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -120,7 +120,8 @@ A change owes neither. The `file-issue` skill files both. The templates hold the shape and an example. - Search issues and pull requests first, here and where the cause lives. -- A pull request references its issue, with `Closes` when it finishes it. +- A pull request opens as a draft and references its issue, with `Closes` when it + finishes it. - Title: `type(scope): summary`, lowercase except names, no final period. A squash makes it the commit on `main`, and the body its message. - Types: `feat` `fix` `perf` `refactor` `docs` `test` `ci` `build` `chore` `revert` From 2ff061f13c8cdd794209f7a396a07e10ebc78a83 Mon Sep 17 00:00:00 2001 From: Etienne Filhol Date: Wed, 25 Nov 2026 00:42:02 +0100 Subject: [PATCH 4/8] docs: fix what three reviews found in the agent instructions, templates and judge The app command could start on the user's profile and a change to a job's shape stayed hidden without a SCHEMA bump; AGENTS.md says both. The judge read the template's hidden example as the author's words, and tests before code. A merge could leave a folder in place of the .claude/skills link unseen. --- .../skills/docs-drift/scripts/check_docs.py | 7 +- .agents/skills/file-issue/SKILL.md | 45 +++--- .github/ISSUE_TEMPLATE/bug.yml | 2 +- .github/ISSUE_TEMPLATE/enhancement.yml | 2 +- .github/pull_request_template.md | 28 ++-- .github/scripts/judge_pr.py | 19 ++- AGENTS.md | 131 +++++++++--------- CONTRIBUTING.md | 11 +- app/tests/test_standard_howto.py | 5 + 9 files changed, 132 insertions(+), 118 deletions(-) diff --git a/.agents/skills/docs-drift/scripts/check_docs.py b/.agents/skills/docs-drift/scripts/check_docs.py index 93294752..97dd72fb 100755 --- a/.agents/skills/docs-drift/scripts/check_docs.py +++ b/.agents/skills/docs-drift/scripts/check_docs.py @@ -132,8 +132,9 @@ def check_md_links() -> list[str]: def check_map() -> list[str]: - """AGENTS.md's "Where code lives" names every package of app/nullius, and no - folder there that does not exist. A module is described by its docstring.""" + """AGENTS.md's "Where code lives" names every folder of modules directly under + app/nullius and its standard/, and none that does not exist. A module is + described by its docstring.""" agents = REPO / "AGENTS.md" if not agents.exists(): return [] @@ -141,7 +142,7 @@ def check_map() -> list[str]: if not part: return ["AGENTS.md: no \"Where code lives\""] root = REPO / "app/nullius" - folders = {p.name for top in (root, root / "standard") for p in top.iterdir() if p.is_dir() and p.name != "__pycache__"} + folders = {p.name for top in (root, root / "standard") for p in top.iterdir() if p.is_dir() and any(p.rglob("*.py"))} entries = {p.name for p in (root / "catalogue").iterdir() if p.is_dir()} named = set(re.findall(r"`(?:app/nullius/)?([\w-]+)/`", part.group(0))) return ([f"AGENTS.md: \"Where code lives\" does not name `{name}/`" for name in sorted(folders - named)] diff --git a/.agents/skills/file-issue/SKILL.md b/.agents/skills/file-issue/SKILL.md index 8ff69bdc..775c0045 100644 --- a/.agents/skills/file-issue/SKILL.md +++ b/.agents/skills/file-issue/SKILL.md @@ -5,18 +5,18 @@ description: File a GitHub issue or open a pull request here with gh, short and # File an issue, open a pull request -**Short.** The point first, then why; one fact per line; fragments are fine. -Quotes and numbers. No background, file tour, hedging or restated diff. +**Short.** What was wrong, then what changed. One fact per line; fragments are +fine. Quotes and numbers. No background, file tour, hedging or restated diff. -- Under 150 words, most need 80: `wc -w`. -- Cut facts, not grammar. Full words, real names: a stranger must be able to act - on it. A fact nobody acts on goes. +- Under 150 words, 250 for a large feature, not counting images, quoted output + and Acceptance. +- Drop facts, not words. Full words, real names: a stranger must be able to act on + it. A fact nobody acts on goes. | No | Yes | | --- | --- | | Currently, when a user types a partial model name, the search may fail to return the expected results. | `Qwen 32b` lists nothing. OpenRouter has two. | | Comprehensive tests were added and the change was verified thoroughly across browsers. | Route suite 690. Chromium, Firefox, WebKit. Not checked: macOS Safari. | -| Live-list test now `sourceOf`'s: asking once untested. | No test covers asking Decision's list only once. | Never: a key, token, password, email address, personal message, private link, host name, site address or machine attribution. A security problem goes to the @@ -26,22 +26,22 @@ address in SECURITY.md, never to an issue. Search issues and pull requests, open and closed (`gh issue list --state all --search`, `gh pr list --state all --search`), here and in the repository that -owns the cause (`--repo`). File a bug there, with a link from here; while minor -or unconfirmed, note it here instead. +owns the cause (`--repo`). File a bug there once the user agrees, with a link from +here; while minor or unconfirmed, note it here instead. ## An issue -The body is the form's labels as `### Label`, in order, without Priority; drop an -empty one. `.github/ISSUE_TEMPLATE/bug.yml` and `enhancement.yml` hold them, and -their placeholders are the example. Acceptance is `- [ ]` boxes, each checkable -in the diff. +The body is the form's labels as `### Label`, in order; drop an empty one. +`.github/ISSUE_TEMPLATE/bug.yml` and `enhancement.yml` hold them, and their +placeholders are the example. Acceptance is `- [ ]` boxes, each checkable in the +diff. gh issue create --title "" \ - --label bug --label P3 --assignee aitianshi --body-file issue.md + --label --label --body-file issue.md -- Priority: `P0` to `P3`, as `gh label list` describes them. Undecided: the lowest - defensible, and say it is a placeholder. -- `aitianshi` where that is the real owner, else nobody. +- The label `P0` to `P3` as `gh label list` describes it. Undecided: the lowest + defensible, and say under Priority that it is a placeholder. +- `--assignee aitianshi` where that is the real owner, else nobody. - Reuse labels. Set the native type (`Bug`, `Feature`) too; where `gh` lacks it, the GraphQL mutation `updateIssue` takes `issueTypeId`. - Keep the metadata true when scope, priority, owner or state changes. @@ -49,14 +49,15 @@ in the diff. ## A pull request The body is `.github/pull_request_template.md`; its comment is the example. The -title's types and scopes are in AGENTS.md. A visible change has two images of one -width under `## Before and after`; otherwise drop the section. "Not checked" is -a valid line. +title's types and scopes are in AGENTS.md. A visible change has an image pair per +place that changed, of one width, under `## Before and after`; otherwise drop the +section. `gh` cannot upload images: add them in the browser. "Not checked" is a +valid line. gh pr create --draft --title "fix(web): ..." --body-file pr.md It stays a draft until the user says it is ready: CI runs then. -Read both back. The issue must list the pull request in -`closedByPullRequestsReferences` (GraphQL); stacked pull requests link the same -way, and a base is never retargeted for it. +Read both back. With `Closes`, the issue lists the pull request in +`closedByPullRequestsReferences` (GraphQL), stacked ones too; a base is never +retargeted for it. diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index d0308fa9..190f5420 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -6,7 +6,7 @@ body: - type: markdown attributes: value: | - Under 150 words, most need 80. The point first, one fact per line, fragments are fine. Cut facts, not grammar. No key, address or private link. A security problem goes to SECURITY.md's address instead. + Under 150 words, not counting images, quoted output and Acceptance. The point first, one fact per line, fragments are fine. Drop facts, not words. No key, email address or private link. A security problem goes to SECURITY.md's address instead. - type: dropdown id: priority attributes: diff --git a/.github/ISSUE_TEMPLATE/enhancement.yml b/.github/ISSUE_TEMPLATE/enhancement.yml index 339675fc..e2529bea 100644 --- a/.github/ISSUE_TEMPLATE/enhancement.yml +++ b/.github/ISSUE_TEMPLATE/enhancement.yml @@ -6,7 +6,7 @@ body: - type: markdown attributes: value: | - Under 150 words, most need 80. The point first, one fact per line, fragments are fine. Cut facts, not grammar. No key, address or private link. A security problem goes to SECURITY.md's address instead. + Under 150 words, not counting images, quoted output and Acceptance. The point first, one fact per line, fragments are fine. Drop facts, not words. No key, email address or private link. A security problem goes to SECURITY.md's address instead. - type: dropdown id: priority attributes: diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 20e5710d..4e9bcef3 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,9 +1,10 @@ Closes # @@ -32,7 +34,7 @@ Closes # ## Before and after - + | Before | After | | --- | --- | diff --git a/.github/scripts/judge_pr.py b/.github/scripts/judge_pr.py index 0b955882..55343940 100644 --- a/.github/scripts/judge_pr.py +++ b/.github/scripts/judge_pr.py @@ -92,7 +92,7 @@ "criterion_met": { "type": "noul", "instructions": "The pull request shows this acceptance criterion done.", - "criteria": {"true": "What the criterion asks for is visible in the diff or the tests it adds", + "criteria": {"true": "What the criterion asks for is visible in the diff", "false": "It is not visible, or the change is about something else"}, }, "issue_same": { @@ -105,7 +105,7 @@ "description_matches": { "type": "choice", "instructions": "Does the pull request description name the change the diff makes and claim nothing the diff does not do? A short description is right: details are left to the diff.", - "criteria": {"yes": "What the description says the change does, the diff does, and each main change is named, in however few words", + "criteria": {"yes": "What the description says the change does, the diff does, and each main change is named, a changed default, permission or file on disk included, in however few words", "partly": "The description never names one of the main changes, or overstates a detail", "no": "The description claims a change the diff does not make, or describes a different change"}, }, @@ -119,7 +119,7 @@ "risk_named": { "type": "choice", "instructions": "Does the description name what could break if this change is wrong and how it would be undone (a revert, a rebuild, a migration): deleted tests, changed defaults, data on disk, keys?", - "criteria": {"yes": "The description's Risk section names what could break and how it is undone, and it matches the diff", + "criteria": {"yes": "The description names what could break and how it is undone, and it matches the diff; or the change plainly carries no risk", "partly": "It names a risk but misses one the diff plainly carries, or says nothing about undoing it", "no": "No risk is named, or the one named is not the diff's"}, }, @@ -294,7 +294,7 @@ def criteria_of(body: str) -> tuple: TRAILER = re.compile(r"^\s*(?:Co-Authored-By|Co-authored-by):\s*(?:claude|anthropic|chatgpt|openai|gpt|copilot|gemini|codex|cursor|devin|assistant)\b" r"|^\s*(?:Claude-Session|Generated-by|Generated by|Signed-off-by: Claude)", re.I | re.M) ALLOWED_ROOTS = ("app/", "docs/", ".github/", ".agents/", ".claude/") -ALLOWED_ROOT_FILES = ("README.md", "AGENTS.md", ".gitignore", ".gitattributes", "LICENSE", "LICENCE") +ALLOWED_ROOT_FILES = ("README.md", "AGENTS.md", "CONTRIBUTING.md", "SECURITY.md", "pyproject.toml", ".gitignore", ".gitattributes", "LICENSE", "LICENCE") VISIBLE = ("app/templates/", "app/static/", "docs/field-guide.md", "docs/assets/", "docs/diagrams/", "app/site/assets/", "app/site/overrides/") PRIORITY_PATHS = [ # the first match decides; deepest first ("extreme", ("app/nullius/standard/", "app/nullius/execution.py", "app/nullius/hosts.py", "app/nullius/secrets.py", ".github/workflows/", ".github/scripts/")), @@ -378,7 +378,7 @@ def signals_of(diff: str, pr: dict) -> dict: {"name": "No Flask import under the backend package", "ok": not flask, "detail": ", ".join(flask[:3])}, {"name": "No key-shaped string in the diff", "ok": not secrets, "detail": ", ".join(secrets[:3])}, ] - return {"paths": paths, "files": len(files), "tests_in_diff": [p for p in paths if is_test_path(p)], "deleted_tests": deleted_tests, + return {"paths": paths, "files": len(files), "deleted_tests": deleted_tests, "visible": visible, "images": images, "priority": priority, "priority_by": by, "risk_floor": floor, "risk_floor_why": why, "checks": checks} @@ -386,7 +386,6 @@ def signals_of(diff: str, pr: dict) -> dict: def signals_block(sig: dict) -> str: """The signals as the judge sees them, after the diff.""" lines = [f"PATHS ({sig['files']}): " + ", ".join(sig["paths"][:60]) + (" …" if sig["files"] > 60 else ""), - f"TESTS IN DIFF: {', '.join(sig['tests_in_diff']) or 'none'}", f"DELETED TESTS: {', '.join(sig['deleted_tests']) or 'none'}", f"VISIBLE PATHS: {', '.join(sig['visible']) or 'none'}; images under 'Before and after': {sig['images']}", f"PRIORITY FROM PATHS: {sig['priority']}" + (f" ({sig['priority_by']})" if sig["priority_by"] else "")] @@ -397,12 +396,12 @@ def signals_block(sig: dict) -> str: def diff_block(diff: str, budget: int, file_limit: int = None) -> tuple: - """The diff as the judge sees it: test files first, each file cut at + """The diff as the judge sees it: test files last, each file cut at FILE_LIMIT, the whole cut at `budget`; files that did not fit are named. Returns (text, truncated).""" file_limit = FILE_LIMIT if file_limit is None else file_limit files = split_diff(diff) - files.sort(key=lambda f: (0 if is_test_path(f[0]) else 1)) + files.sort(key=lambda f: is_test_path(f[0])) parts, used, truncated, left = [], 0, False, [] for path, text in files: if len(text) > file_limit: @@ -416,12 +415,12 @@ def diff_block(diff: str, budget: int, file_limit: int = None) -> tuple: if left: truncated = True parts.append(f"[diff omitted for {len(left)} more file(s): " + ", ".join(left) + "]") - head = f"DIFF ({len(files)} files, tests first{', cut' if truncated else ''}):\n" + head = f"DIFF ({len(files)} files, tests last{', cut' if truncated else ''}):\n" return head + "\n".join(parts), truncated def description_block(pr: dict) -> tuple: - body = (pr.get("body") or "").strip() or "(no description)" + body = re.sub(r"", "", pr.get("body") or "", flags=re.S).strip() or "(no description)" # the template's hints, hidden on GitHub truncated = len(body) > DESCRIPTION_LIMIT if truncated: body = body[:DESCRIPTION_LIMIT] + f"\n[… {len(body) - DESCRIPTION_LIMIT} more characters]" diff --git a/AGENTS.md b/AGENTS.md index f76df7aa..dbb3f2da 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,62 +1,64 @@ # Nullius -Bring any benchmark, agent or capability, run it, and open every score into the -evidence behind it: the agent's failure or the benchmark's. +Nullius runs AI evaluations and opens every score into its evidence, to tell an +agent's failure from a benchmark's. -- Runs through the Nullius standard (`docs/standard.md`) or Harbor, only on an - explicit Run. Also reads Harbor, ATIF and OpenTelemetry results. -- `app/nullius/` is the backend: standard library only, an entry's own code aside. - `app/web/` is Flask, the only runtime dependency. +- Runs through the Nullius standard (`docs/standard.md`) or Harbor, only when + asked. Also reads Harbor, ATIF and OpenTelemetry results. +- `app/nullius/` is the backend: standard library only, except code that runs in + an upstream's own environment. `app/web/` is Flask, the web framework and the + only runtime dependency. -The user's instructions come first, then this file, then `.claude/rules/`. This -file holds rules for any assistant: no file lists, no history. +The user's instructions come first, then this file, then `.claude/rules/`. Rules +for every contributor and assistant: no file catalogue, no history. ## How we work - **Small diffs.** No refactoring on the way. A defect found in passing becomes an issue, not a wider change. -- **Nearby code over assumptions.** Describe what is. Remove obsolete code and - historical comments unless asked to keep them. +- **Nearby code over assumptions.** Describe what is. Remove the code and comments + your change makes obsolete. - **Facilitator, not re-implementer.** A benchmark, agent or capability runs its upstream's own code at a pin, in its own environment. Ask before writing more than glue. -- **Reuse before adding.** In the backend, for example, `paths`, `ondisk`, - `redact`, `settings`, `providers`; on a page `_tables.html`, `_cards.html`, - `tables.js`, `model-picker.js`, `disclosures.js`, `_icons.svg`. +- **Reuse before adding**, for example `ondisk`, `redact`, `paths`, `providers`; on + a page `_tables.html`, `_cards.html`, `model-picker.js`, `_icons.svg`. - **No machine attribution** in a commit or a pull request: no assistant `Co-Authored-By`, session link or generated-by line. Human co-authors stay. Existing commits are not rewritten for it. -- **Nothing merges without the user's word.** +- **Nothing merges without the owner's word.** ## Three rules, each with a test -1. `app/nullius/` imports no Flask (`test_layering`). A backend test that needs - Flask means the layering broke. -2. One provider of `nullius` per interpreter (`test_dependency_surface`): a local - package can shadow an installed one. Source commands use `uv run --no-project`. -3. Fields the templates read are pinned, for the modules `field_contract.py` lists - (`test_field_contract`). A rename is a blank cell, not an import error. +1. No file in `app/nullius/` imports Flask, so it runs without the web app: on + hosts, in the CLI, in tests. Code that needs it goes in `app/web/` + (`test_layering`). +2. Only one `nullius` is importable: with two, one hides the other + (`test_dependency_surface`). Run source with `uv run --no-project`. +3. Templates read fields by name, so a renamed one renders blank. + `test_field_contract` fails on it, in the modules `field_contract.py` lists. -Bundled files resolve from `__file__`, personal ones through `nullius.paths`. -No personal data in the package. +Find bundled files from `__file__`, the user's through `nullius.paths`; none of +theirs in the package. ## Where code lives New code goes under `app/`, never at the root. A module's docstring says what it -is: `grep -m1 '"""' app/nullius/runs/*.py`. +is: `grep -m1 '"""' app/nullius/*.py app/nullius/runs/*.py`. | Path | Holds | | --- | --- | +| `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/catalogue/` | A folder per entry under `benchmarks/`, `agents/`, `capabilities/`: its definition and its own 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 | -| `app/nullius/standard/` | The standard: `contract/`, `requirements/`, `protocols/`, `calls/`, `backends/`, `runner/`, `proofs/`, `pages/`, importing one way (`test_layering`), and the conformance `kits/` | -| `app/web/` | One module per capability; `core` is the application, `shared` what pages share. Use another module's names as attributes (`shared.STATE`): patch one, patched for all | -| `app/templates/`, `app/static/` | The interface, under the same capability names | +| `app/nullius/standard/` | The standard: `contract/`, `requirements/`, `protocols/`, `calls/`, `backends/`, `runner/`, `proofs/`, `pages/`, whose imports never loop (`test_layering`), and the conformance `kits/` | +| `app/web/` | One module per area; `core` is the application, `shared` what pages share. Write `shared.STATE`, never `from .shared import STATE`, so one patch reaches all | +| `app/templates/`, `app/static/` | The interface, under the same names | | `app/tests/`, `app/ui_tests/` | Backend and route suites; fixtures are small and hand-made | | `app/site/`, `docs/` | The website; the documentation it publishes | -| `.agents/skills/` | Skills; `.claude/skills` links here | +| `.agents/skills/` | Skills, written `/name` here; `.claude/skills` is a link to it | ## Commands @@ -70,16 +72,23 @@ python3 app/tests/parallel.py uv run --no-project --with-requirements app/requirements.txt \ python app/tests/parallel.py app/ui_tests -# the app -uv run --no-project --with-requirements app/requirements.txt app/app.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 + +# the app, and the CLI +NULLIUS_HOME=$(mktemp -d) uv run --no-project --with-requirements app/requirements.txt \ + app/app.py --debug --port 8791 +PYTHONPATH=app NULLIUS_HOME=$(mktemp -d) python3 -m nullius --help + +# the documentation's links and paths +python3 .agents/skills/docs-drift/scripts/check_docs.py ``` -- The backend suite needs git and uv on PATH. Without Node, the tests of the - pages' scripts skip. -- unittest by hand: `NULLIUS_HOME` a temporary folder, personal catalogue and - storage variables unset. -- A page change: its tests and focused browser checks, not the full sweep. -- CI on non-draft pull requests: the tests, and the PR judge, which never gates. +- Always a profile of your own (`NULLIUS_HOME`). The user's server follows their + runs: never start on their profile, never stop it. +- The backend suite needs git and uv. Without Node, tests of page scripts skip. +- A draft gets no CI: run the suites you touch. Ready, it gets the tests and the PR + judge, which never gates; `/judge` in a comment asks it on a draft. | Changed | Refresh | | --- | --- | @@ -87,41 +96,41 @@ uv run --no-project --with-requirements app/requirements.txt app/app.py | A catalogue definition | `python3 app/tests/catalogue_docs.py --write` | | A documentation figure | `python3 app/site/diagrams.py --write` | | The README's animated SVGs | `python3 app/site/readme_media.py --write` | +| What a job or trial holds, outcomes included | `SCHEMA` in `app/nullius/runs/parse.py`, plus one: opened runs are cached | +| A setting | `app/.env.example`, from `settings.example()` | | What a metric means | `docs/field-guide.md`, by hand | ## Tests and docs -A change owes neither. +Add neither by default. -- **A test** for a distinct regression no existing test catches: behavior, a - contract, a failure mode. Not wording, structure or catalogue contents. Extend - a nearby case first. -- **Removing a test:** name the assertions that still protect its behavior, and - keep its edge cases and fixture isolation. +- **A test** when no existing one would catch this breaking: behavior, a contract, + a failure mode. Not wording, structure or catalogue contents. Extend a nearby + case first. +- **Removing one:** name the assertions that still protect its behavior; keep its + edge cases. - **Docs** when what they say became wrong, or a reader needs them to choose or - act. The code already says how it works. No prerequisite Review already checks. + act. The code already says how it works. - **In `docs/`:** keep guarantees, requirements, refusals and their fix; drop - mechanism, narration and history. One fact, one page. A table cell is a line. - No validations, captures or rendered reports. + mechanism, narration, history and what the builder already checks. One fact, one + page. A table cell is a line. No validations, captures or rendered reports. - Headings of `docs/standard.md` are never renamed: the import skills cite them. ## Catalogue - One entry per benchmark; what it supports is an option. A version is an upstream release or a requested fork, never a change of our driver. -- Definitions hold configuration. Proof runs write evidence to `proofs.json` - beside them and leave them untouched. Read both through `definitions`; never - infer proven ports from raw JSON. -- An agent's native capability is a callable its pinned upstream exposes, tested. - A component's proof does not prove an agent uses it. +- Definitions hold configuration. Proof runs write only `proofs.json`: a bundled + entry's in a user copy, which then hides the bundled one. Read both through + `contract/definitions.py`; never infer proven ports from raw JSON. ## Issues and pull requests The `file-issue` skill files both. The templates hold the shape and an example. - Search issues and pull requests first, here and where the cause lives. -- A pull request opens as a draft and references its issue, with `Closes` when it - finishes it. +- A pull request opens as a draft, with `Closes #n` when it finishes its issue, + else `Refs #n`. - Title: `type(scope): summary`, lowercase except names, no final period. A squash makes it the commit on `main`, and the body its message. - Types: `feat` `fix` `perf` `refactor` `docs` `test` `ci` `build` `chore` `revert` @@ -135,17 +144,15 @@ The `file-issue` skill files both. The templates hold the shape and an example. Short and plain: issues, pull requests, their comments, docs. -- The point first, then why. One fact per line. Fragments are fine. -- Cut facts, not grammar: a stranger must be able to act on it. +- The point first. One fact per line. Fragments are fine. +- Drop facts, not words: a stranger must be able to act on it. - Numbers and quotes, not adjectives. No background, file tour, hedging or restated diff. -| No | Yes | -| --- | --- | -| This change introduces a comprehensive improvement to model search, which previously could fail to surface relevant results in certain cases. | `Qwen 32b` found no model. Words now match in any order. | - ## Read first +The row, before changing that area. + | Working on | Read | | --- | --- | | What runs, reading a result | `.claude/rules/running.md` | @@ -153,16 +160,14 @@ Short and plain: issues, pull requests, their comments, docs. | Any page | `.claude/rules/ui.md`; `/ui-sweep` only when asked | | Vocabulary | `docs/concepts.md` | | The standard, its ports and kits | `docs/standard.md` | -| Adding an entry | `/import-benchmark`, `/import-standard`, `/import-agent`, `/import-capability`; by hand, `docs/examples/new-benchmark/` | +| Adding an entry | `/import-benchmark`, `/import-standard`, `/import-agent`, `/import-capability`; by hand, `add-manually.md` under `docs/benchmarks/`, `docs/agents/` or `docs/capabilities/` | | Removing an entry | `/remove-integration` | -| How the catalogue loads | Docstring of `app/nullius/catalogue/catalog.py` | | The run builder | `docs/builder.md`; `app/nullius/recipes/launch.py`; `app/static/builder/command-builder-core.js` | -| A pinned Harbor | Docstring of `app/nullius/harbor/source.py` | -| Running a recipe, hosts | Docstrings of `app/nullius/execution.py` and `app/nullius/hosts.py` | -| The live board | Docstring of `app/nullius/runs/live.py` | +| A module | Its docstring. Whole designs: `execution.py`, `catalogue/catalog.py`, `harbor/source.py`, `runs/live.py` | +| A command; a metric | `docs/cli/README.md`; `docs/field-guide.md` | | Settings and storage | `docs/settings/README.md`; `app/nullius/settings.py` | | Judgement; the PR judge | `docs/judgement.md`; docstring of `.github/scripts/judge_pr.py` | | A run that looks wrong, comparing runs | `/run-analysis` | | Stale docs | `/docs-drift` | | The website; a release | `app/site/README.md`; `app/packaging/README.md` | -| This machine | `.claude/environment.local.md`, gitignored | +| This machine | `.claude/environment.local.md`, if present | diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 80de472a..3625ec11 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -35,8 +35,8 @@ for the container backend and for Harbor recipes. - `app/nullius/catalogue/` holds the benchmarks, agents and capabilities, one folder each. -[AGENTS.md](AGENTS.md) is the map of the repository and the rules every -contributor and coding assistant follows. Read it before your first change. +[AGENTS.md](AGENTS.md) holds the rules every contributor and coding assistant +follows. Read it before your first change. The tests require a Flask-free backend, one provider of `nullius`, and the template fields pinned in `app/tests/field_contract.json`. @@ -51,8 +51,8 @@ and Capabilities pages writes the prompt for any assistant. ## Running the tests -From the repository root. The backend suite needs nothing installed; only the -route suite needs Flask. +From the repository root. The backend suite needs git and uv; only the route suite +needs Flask. ```bash python3 app/tests/parallel.py @@ -87,12 +87,13 @@ decision by the repository owner. - **Small and targeted.** One change per pull request; no refactoring of unrelated areas on the way. +- **Open it as a draft.** Mark it ready when it is: the checks run then. - **Fill in the template, short.** It holds an example. The PR judge compares it with the diff and with the linked issue's acceptance list. - **Reference the issue** so it shows in the issue's Development panel. - **Say what you verified.** Tests run, browser checks made, widths tried. "Not verified" is an honest answer. -- **No key, no address, no private link** in a body, a commit or a screenshot. +- **No key, no email address, no private link** in a body, a commit or a screenshot. Commit messages are about the change and why it was made. No machine attribution: no `Co-Authored-By: Claude`, no session metadata, no generated-by diff --git a/app/tests/test_standard_howto.py b/app/tests/test_standard_howto.py index 47814746..d27a798c 100644 --- a/app/tests/test_standard_howto.py +++ b/app/tests/test_standard_howto.py @@ -6,6 +6,7 @@ import json import os +import pathlib import shlex import subprocess import sys @@ -17,6 +18,8 @@ from nullius.standard.contract import definitions from nullius.standard.pages import howto +ROOT = pathlib.Path(__file__).resolve().parents[2] + class Steps(unittest.TestCase): def setUp(self): @@ -83,6 +86,8 @@ def test_each_kind_names_its_skill_both_ways_and_has_three_slots(self): text = howto.prompt(kind) self.assertIn(command, text) self.assertIn(f".agents/skills/{command[1:]}/SKILL.md", text) + for folder in (".agents", ".claude"): # .claude/skills is a link: a merge can leave a folder in its place + self.assertTrue((ROOT / folder / "skills" / command[1:] / "SKILL.md").is_file(), (folder, command)) self.assertIn("docs/standard.md", text) for slot in ("{name}", "{source}", "{remark}"): self.assertEqual(text.count(slot), 1, (kind, slot)) From cd357e545ccece05ddd16a61ccb5f61827d4f6b8 Mon Sep 17 00:00:00 2001 From: Etienne Filhol Date: Wed, 25 Nov 2026 01:11:38 +0100 Subject: [PATCH 5/8] chore(ci): use P0 to P3 in the issue forms, let a change say nothing visible changes, and fix outdated text The judge keeps only the validated changes: no tests or docs rows, and that answer to Before and after. --- .agents/skills/docs-drift/SKILL.md | 27 +++++++++----------- .agents/skills/file-issue/SKILL.md | 10 ++++---- .github/ISSUE_TEMPLATE/bug.yml | 7 ++++-- .github/ISSUE_TEMPLATE/enhancement.yml | 7 ++++-- .github/pull_request_template.md | 3 ++- .github/scripts/judge_pr.py | 34 ++++++++++++++------------ CONTRIBUTING.md | 12 ++------- README.md | 2 +- app/packaging/README.md | 3 --- app/tests/test_judge.py | 2 ++ 10 files changed, 51 insertions(+), 56 deletions(-) diff --git a/.agents/skills/docs-drift/SKILL.md b/.agents/skills/docs-drift/SKILL.md index 7fc3d9d0..5facb1ba 100644 --- a/.agents/skills/docs-drift/SKILL.md +++ b/.agents/skills/docs-drift/SKILL.md @@ -47,16 +47,16 @@ or name the merge commit and diff its first parent. | --- | --- | | `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 "Three rules, each with a test"; preserve source commands as well as installed commands | | `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` | - | `app/nullius/compare/` | `.claude/rules/running.md`, the comparison paragraph; `docs/cli/read-jobs.md`; `docs/field-guide.md`; `docs/how-it-works.md`, the `/compare` row | - | `app/nullius/catalogue/`, `app/nullius/recipes/`, `app/nullius/harbor/` | README "Ways to run" and its sections from "Bring anything" to "Read it"; `docs/builder.md` "Recipe stages" and "Agents and Capabilities tabs"; `.claude/rules/running.md`, what the repository runs and installs; for `harbor/`, the `source.py` docstring and `docs/builder.md` "Which Harbor"; for `catalogue/`, `.agents/skills/import-benchmark/SKILL.md` (a Harbor entry, the listing rule) too; for `providers.py`, the provider rows of `docs/builder.md` "Which providers" | - | `app/nullius/execution.py`, `app/nullius/hosts.py`, `app/nullius/settings.py` | `.claude/rules/running.md`, the run-from-Review paragraph and the settings list with its count of things a person sets; README "What it does"; `docs/builder.md` "Run"; `docs/settings/README.md`; `docs/how-it-works.md`, Paths 2 to 4 | + | `app/nullius/runs/` | README "Reading a result"; `.claude/rules/running.md` "Reading a result"; `docs/field-guide.md`, what each field it names means; `docs/how-it-works.md` "Page by page"; `docs/cli/` when a CLI changed | + | `app/nullius/traces/` | `.claude/rules/traces.md`; README "Reading a result" | + | `app/nullius/importers/` | README "Ways to run" and "Local by design"; `.claude/rules/running.md` "Running the app"; `docs/cli/import.md` | + | `app/nullius/compare/` | `docs/cli/read-jobs.md`; `docs/field-guide.md`; `docs/how-it-works.md`, the `/compare` row | + | `app/nullius/catalogue/`, `app/nullius/recipes/`, `app/nullius/harbor/` | README "What it does" and "Ways to run"; `docs/builder.md` "Stages"; `.claude/rules/running.md` "What this repository runs"; for `harbor/`, the `source.py` docstring and `docs/builder.md` "Which Harbor"; for `catalogue/`, `.agents/skills/import-benchmark/SKILL.md` (a Harbor entry, the listing rule) too; for `providers.py`, the provider rows of `docs/builder.md` "Which providers" | + | `app/nullius/execution.py`, `app/nullius/hosts.py`, `app/nullius/settings.py` | `.claude/rules/running.md` "What this repository runs"; README "What it does"; `docs/builder.md` "Run"; `docs/settings/README.md`; `docs/how-it-works.md`, Paths 2 and 3 | | `app/nullius/judge/`, `app/web/judge.py`, `app/web/judge_tasks.py`, `app/web/reconcile.py` | `docs/judgement.md`; README "What it does" | - | `app/nullius/workspace.py`, `app/nullius/workspace_cli.py` | `.claude/rules/running.md`, the workspace paragraph; `docs/how-it-works.md` "What the workspace keeps"; `docs/cli/read-jobs.md` | - | `app/nullius/redact.py` | `.claude/rules/running.md` (log lines are redacted); `.claude/rules/traces.md` (the artifact reader) | - | `app/web/`, `app/templates/`, `app/static/` | README "What it does", for the page that changed; `docs/how-it-works.md` "What you get back, page by page"; `.claude/rules/traces.md` for the trial page's strips; `app/tests/field_contract.json` when a template reads a different field (refreshed with `python3 app/tests/field_contract.py --write`) | + | `app/nullius/workspace.py`, `app/nullius/workspace_cli.py` | `.claude/rules/running.md` "Running the app"; `docs/how-it-works.md` "What the workspace keeps"; `docs/cli/read-jobs.md` | + | `app/nullius/redact.py` | `.claude/rules/running.md` (logs are redacted) | + | `app/web/`, `app/templates/`, `app/static/` | README "What it does", for the page that changed; `docs/how-it-works.md` "Page by page"; `.claude/rules/traces.md` for the trial page's strips; `app/tests/field_contract.json` when a template reads a different field (refreshed with `python3 app/tests/field_contract.py --write`) | | `app/tests/`, `app/ui_tests/` | a *new module* is named in AGENTS Commands only if it is run differently | | `.github/workflows/`, `app/requirements.txt` | AGENTS "Commands"; README "Quickstart" and "Documentation"; `.claude/rules/running.md` "Running the app" | | `docs/` | `docs/README.md` — the gate checks its folders, you check the one-line descriptions; `docs/cli/` against each command's `--help` | @@ -64,9 +64,6 @@ or name the merge commit and diff its first parent. | a document itself (`README.md`, `AGENTS.md`, `docs/field-guide.md`, a rule, a topic page) | the changed paragraphs against the code they describe, and every other document in this table that says the same thing | | anything that closes or opens an issue | the issue's body and Development link; the README or rule sentence that cites it by number | - A changed path with no row is itself a finding: say which document should - describe it. - When the change removes or renames something - a route, a page, a module, a function, a flag - also `git grep` the old names across the whole tree. What still names them is drift no row routes: a docstring or a comment, a @@ -79,8 +76,7 @@ or name the merge commit and diff its first parent. 3. **Then the surfaces everyone forgets**, whatever the scope: - README.md "Quickstart" and "Documentation"; - AGENTS.md "Where code lives", "Commands" and "Read first"; - - `.claude/rules/running.md` — its commands still run as written - (`nullius …`, `uv run …`, the `PYTHONPATH=app python3 -m nullius.…` forms, `--no-debug`); + - `.claude/rules/running.md` — its commands still run as written; - `docs/how-it-works.md` "The pieces" — the backend list; - `docs/cli/pages.md` — the covered rows still run, and a command that gained a flag has it in the table. @@ -105,5 +101,4 @@ or name the merge commit and diff its first parent. ## What this is not Not a rewrite pass: leave prose that is still true alone, even when it could -be shorter. Not the place to add a document — if a change has no home in the -table, the missing row is the finding. +be shorter. Not the place to add a document. diff --git a/.agents/skills/file-issue/SKILL.md b/.agents/skills/file-issue/SKILL.md index 775c0045..486847a7 100644 --- a/.agents/skills/file-issue/SKILL.md +++ b/.agents/skills/file-issue/SKILL.md @@ -39,8 +39,8 @@ diff. gh issue create --title "" \ --label --label --body-file issue.md -- The label `P0` to `P3` as `gh label list` describes it. Undecided: the lowest - defensible, and say under Priority that it is a placeholder. +- Priority: `P0` to `P3` as the form describes them, in the body and as the label. + Undecided: the lowest defensible, and say that it is a placeholder. - `--assignee aitianshi` where that is the real owner, else nobody. - Reuse labels. Set the native type (`Bug`, `Feature`) too; where `gh` lacks it, the GraphQL mutation `updateIssue` takes `issueTypeId`. @@ -50,9 +50,9 @@ diff. The body is `.github/pull_request_template.md`; its comment is the example. The title's types and scopes are in AGENTS.md. A visible change has an image pair per -place that changed, of one width, under `## Before and after`; otherwise drop the -section. `gh` cannot upload images: add them in the browser. "Not checked" is a -valid line. +place that changed, of one width, under `## Before and after`. Otherwise drop the +section, or write "Nothing visible changes." when templates or static files did. +`gh` cannot upload images: add them in the browser. "Not checked" is a valid line. gh pr create --draft --title "fix(web): ..." --body-file pr.md diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index 190f5420..4c9e8d80 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -11,8 +11,11 @@ body: id: priority attributes: label: Priority - description: How deep it reaches. low, docs and pages · medium, web layer or catalogue · high, backend · extreme, what runs and proves - options: [low, medium, high, extreme] + options: + - "P0 · Fix now: unsafe, loses money or data, or nothing runs" + - "P1 · Next: a wrong result or a broken path, with no way around it" + - "P2 · Planned: limited in scope, has a way around it, or a missing feature" + - "P3 · When convenient: wording, layout, tests" validations: required: true - type: textarea diff --git a/.github/ISSUE_TEMPLATE/enhancement.yml b/.github/ISSUE_TEMPLATE/enhancement.yml index e2529bea..c21550ad 100644 --- a/.github/ISSUE_TEMPLATE/enhancement.yml +++ b/.github/ISSUE_TEMPLATE/enhancement.yml @@ -11,8 +11,11 @@ body: id: priority attributes: label: Priority - description: How deep it reaches. low, docs and pages · medium, web layer or catalogue · high, backend · extreme, what runs and proves - options: [low, medium, high, extreme] + options: + - "P0 · Fix now: unsafe, loses money or data, or nothing runs" + - "P1 · Next: a wrong result or a broken path, with no way around it" + - "P2 · Planned: limited in scope, has a way around it, or a missing feature" + - "P3 · When convenient: wording, layout, tests" validations: required: true - type: textarea diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 4e9bcef3..1d55354e 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -34,7 +34,8 @@ Closes # ## Before and after - + | Before | After | | --- | --- | diff --git a/.github/scripts/judge_pr.py b/.github/scripts/judge_pr.py index 55343940..fbea4712 100644 --- a/.github/scripts/judge_pr.py +++ b/.github/scripts/judge_pr.py @@ -67,7 +67,7 @@ URL = "https://api.typesafe.ai/v1/systemone" MODEL = "jev-latest" PROVIDER = "typesafe.ai" -QUESTIONS_VERSION = "judgement.questions.pr.v3" +QUESTIONS_VERSION = "judgement.questions.pr.v2" PRICE_PER_MTOK = 0.042 # USD per million input tokens (docs.typesafe.ai/models) CHARS_PER_TOKEN = 4 FILE_LIMIT = 12_000 # characters of one file's diff kept (--file-limit) @@ -92,7 +92,7 @@ "criterion_met": { "type": "noul", "instructions": "The pull request shows this acceptance criterion done.", - "criteria": {"true": "What the criterion asks for is visible in the diff", + "criteria": {"true": "What the criterion asks for is visible in the diff or the tests it adds", "false": "It is not visible, or the change is about something else"}, }, "issue_same": { @@ -104,9 +104,9 @@ }, "description_matches": { "type": "choice", - "instructions": "Does the pull request description name the change the diff makes and claim nothing the diff does not do? A short description is right: details are left to the diff.", - "criteria": {"yes": "What the description says the change does, the diff does, and each main change is named, a changed default, permission or file on disk included, in however few words", - "partly": "The description never names one of the main changes, or overstates a detail", + "instructions": "Does the pull request description describe the change the diff makes, claiming nothing the diff does not do and leaving out nothing the diff does?", + "criteria": {"yes": "What the description says the change does, the diff does, and nothing material is left unsaid", + "partly": "The description is right as far as it goes but leaves out a material part of the diff, or overstates a detail", "no": "The description claims a change the diff does not make, or describes a different change"}, }, "scope": { @@ -119,7 +119,7 @@ "risk_named": { "type": "choice", "instructions": "Does the description name what could break if this change is wrong and how it would be undone (a revert, a rebuild, a migration): deleted tests, changed defaults, data on disk, keys?", - "criteria": {"yes": "The description names what could break and how it is undone, and it matches the diff; or the change plainly carries no risk", + "criteria": {"yes": "The description's Risk section names what could break and how it is undone, and it matches the diff", "partly": "It names a risk but misses one the diff plainly carries, or says nothing about undoing it", "no": "No risk is named, or the one named is not the diff's"}, }, @@ -294,7 +294,7 @@ def criteria_of(body: str) -> tuple: TRAILER = re.compile(r"^\s*(?:Co-Authored-By|Co-authored-by):\s*(?:claude|anthropic|chatgpt|openai|gpt|copilot|gemini|codex|cursor|devin|assistant)\b" r"|^\s*(?:Claude-Session|Generated-by|Generated by|Signed-off-by: Claude)", re.I | re.M) ALLOWED_ROOTS = ("app/", "docs/", ".github/", ".agents/", ".claude/") -ALLOWED_ROOT_FILES = ("README.md", "AGENTS.md", "CONTRIBUTING.md", "SECURITY.md", "pyproject.toml", ".gitignore", ".gitattributes", "LICENSE", "LICENCE") +ALLOWED_ROOT_FILES = ("README.md", "AGENTS.md", ".gitignore", ".gitattributes", "LICENSE", "LICENCE") VISIBLE = ("app/templates/", "app/static/", "docs/field-guide.md", "docs/assets/", "docs/diagrams/", "app/site/assets/", "app/site/overrides/") PRIORITY_PATHS = [ # the first match decides; deepest first ("extreme", ("app/nullius/standard/", "app/nullius/execution.py", "app/nullius/hosts.py", "app/nullius/secrets.py", ".github/workflows/", ".github/scripts/")), @@ -357,9 +357,10 @@ def signals_of(diff: str, pr: dict) -> dict: flask = [p for p, lines in added.items() if p.startswith("app/nullius/") and p.endswith(".py") and any(re.match(r"\s*(?:import flask|from flask\b)", l) for l in lines)] trailers = [m.group(0).strip() for text in [pr.get("body") or ""] + list(pr.get("commit_messages") or []) for m in TRAILER.finditer(text)] - visible = [p for p in paths if p.startswith(VISIBLE)] - shots = section(pr.get("body") or "", "Before and after") - images = len(IMAGE.findall(shots or "")) + shots = re.sub(r"", "", section(pr.get("body") or "", "Before and after") or "", flags=re.S) + images = len(IMAGE.findall(shots)) + said = not images and re.search(r"\bnothing visible\b", shots, re.I) # "Nothing visible changes." + visible = [] if said else [p for p in paths if p.startswith(VISIBLE)] floor, why = None, "" if secrets: floor, why = "severe", f"a key-shaped string in {secrets[0]}" @@ -378,7 +379,7 @@ def signals_of(diff: str, pr: dict) -> dict: {"name": "No Flask import under the backend package", "ok": not flask, "detail": ", ".join(flask[:3])}, {"name": "No key-shaped string in the diff", "ok": not secrets, "detail": ", ".join(secrets[:3])}, ] - return {"paths": paths, "files": len(files), "deleted_tests": deleted_tests, + return {"paths": paths, "files": len(files), "tests_in_diff": [p for p in paths if is_test_path(p)], "deleted_tests": deleted_tests, "visible": visible, "images": images, "priority": priority, "priority_by": by, "risk_floor": floor, "risk_floor_why": why, "checks": checks} @@ -386,6 +387,7 @@ def signals_of(diff: str, pr: dict) -> dict: def signals_block(sig: dict) -> str: """The signals as the judge sees them, after the diff.""" lines = [f"PATHS ({sig['files']}): " + ", ".join(sig["paths"][:60]) + (" …" if sig["files"] > 60 else ""), + f"TESTS IN DIFF: {', '.join(sig['tests_in_diff']) or 'none'}", f"DELETED TESTS: {', '.join(sig['deleted_tests']) or 'none'}", f"VISIBLE PATHS: {', '.join(sig['visible']) or 'none'}; images under 'Before and after': {sig['images']}", f"PRIORITY FROM PATHS: {sig['priority']}" + (f" ({sig['priority_by']})" if sig["priority_by"] else "")] @@ -396,12 +398,12 @@ def signals_block(sig: dict) -> str: def diff_block(diff: str, budget: int, file_limit: int = None) -> tuple: - """The diff as the judge sees it: test files last, each file cut at + """The diff as the judge sees it: test files first, each file cut at FILE_LIMIT, the whole cut at `budget`; files that did not fit are named. Returns (text, truncated).""" file_limit = FILE_LIMIT if file_limit is None else file_limit files = split_diff(diff) - files.sort(key=lambda f: is_test_path(f[0])) + files.sort(key=lambda f: (0 if is_test_path(f[0]) else 1)) parts, used, truncated, left = [], 0, False, [] for path, text in files: if len(text) > file_limit: @@ -415,12 +417,12 @@ def diff_block(diff: str, budget: int, file_limit: int = None) -> tuple: if left: truncated = True parts.append(f"[diff omitted for {len(left)} more file(s): " + ", ".join(left) + "]") - head = f"DIFF ({len(files)} files, tests last{', cut' if truncated else ''}):\n" + head = f"DIFF ({len(files)} files, tests first{', cut' if truncated else ''}):\n" return head + "\n".join(parts), truncated def description_block(pr: dict) -> tuple: - body = re.sub(r"", "", pr.get("body") or "", flags=re.S).strip() or "(no description)" # the template's hints, hidden on GitHub + body = (pr.get("body") or "").strip() or "(no description)" truncated = len(body) > DESCRIPTION_LIMIT if truncated: body = body[:DESCRIPTION_LIMIT] + f"\n[… {len(body) - DESCRIPTION_LIMIT} more characters]" @@ -575,7 +577,7 @@ def short(text: str, n: int = 90) -> str: ROWS = [ # (question id or script row, the text of the row) ("criteria", "Changes do what the issue asks"), ("issue_same", "Issue and pull request describe the same change"), - ("description_matches", "Description matches the diff"), + ("description_matches", "Description matches the diff, no more, no less"), ("scope", "Diff stays in scope"), ("risk_named", "Risk named in the description"), ("before_after", "Before and after shown"), diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3625ec11..05393dc7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -59,16 +59,8 @@ python3 app/tests/parallel.py uv run --no-project --with-requirements app/requirements.txt python app/tests/parallel.py app/ui_tests ``` -Two pins are refreshed by hand after a deliberate change, and the suite fails -while they are stale: - -```bash -# after changing a class the templates render -python3 app/tests/field_contract.py --write - -# after changing a definition under app/nullius/catalogue -python3 app/tests/catalogue_docs.py --write -``` +Some files are refreshed by hand after a deliberate change, and the suite fails +while they are stale: [AGENTS.md](AGENTS.md), "Commands", lists them. A change to the interface also gets a look in a browser: the pages it touches, in both themes, at the widths it affects. The owner's rules for every page are diff --git a/README.md b/README.md index fb90fdb8..c6d8647c 100644 --- a/README.md +++ b/README.md @@ -158,7 +158,7 @@ uv run --no-project --with-requirements app/requirements.txt \ ``` The [tests workflow](https://github.com/thinkflowlab/nullius/actions/workflows/tests.yml) -runs both suites on pull requests. +runs both suites on pull requests that are not drafts. ## License diff --git a/app/packaging/README.md b/app/packaging/README.md index edb4f81b..c39d53c2 100644 --- a/app/packaging/README.md +++ b/app/packaging/README.md @@ -7,9 +7,6 @@ a source distribution and `SHA256SUMS`. It does not publish the release or upload to PyPI. A separate manual `publish to PyPI` workflow uploads reviewed GitHub release assets. -The repository stays private; publication to PyPI makes the uploaded package -and its included source public, independently of GitHub access. - `pyproject.toml` owns the package version. The release tag is that version prefixed with `v`. Release notes live in `docs/releases/.md`. diff --git a/app/tests/test_judge.py b/app/tests/test_judge.py index 31f7eeb3..bea6af96 100644 --- a/app/tests/test_judge.py +++ b/app/tests/test_judge.py @@ -741,6 +741,8 @@ def test_the_floors_the_checks_and_the_before_and_after_count(self): self.assertEqual([c["ok"] for c in sig["checks"]], [False, False, False, False]) self.assertEqual(sig["images"], 1) self.assertEqual(sig["visible"], ["app/static/style.css"]) + for body, seen in (("Nothing visible changes.", []), ("", ["app/static/style.css"])): + self.assertEqual(J.signals_of(diff, {"body": "## Before and after\n" + body, "commit_messages": []})["visible"], seen) clean = J.signals_of("diff --git a/docs/a.md b/docs/a.md\n--- a/docs/a.md\n+++ b/docs/a.md\n@@ -1 +1,2 @@\n+x\n", {"body": "", "commit_messages": []}) self.assertIsNone(clean["risk_floor"]) self.assertTrue(all(c["ok"] for c in clean["checks"])) From 5fc65b6c35fc83c303c3914e5f33d87b3fe3311b Mon Sep 17 00:00:00 2001 From: Etienne Filhol Date: Wed, 25 Nov 2026 01:25:37 +0100 Subject: [PATCH 6/8] docs(catalogue): say each version is Official or Experiment, the official one first --- .agents/skills/import-agent/SKILL.md | 5 ++++- .agents/skills/import-benchmark/SKILL.md | 12 +++++++----- .agents/skills/import-standard/SKILL.md | 7 ++++--- AGENTS.md | 12 ++++++------ 4 files changed, 21 insertions(+), 15 deletions(-) diff --git a/.agents/skills/import-agent/SKILL.md b/.agents/skills/import-agent/SKILL.md index c53676fb..84137c98 100644 --- a/.agents/skills/import-agent/SKILL.md +++ b/.agents/skills/import-agent/SKILL.md @@ -86,7 +86,10 @@ on npm or PyPI, a Hugging Face page, a website) and a description. From the link and the agent's own docs, find, in this order: 1. **Already here?** `cli list` reads bundled and user entries together. An - agent already in the catalogue gets a version, not a second folder (step 5). + agent already in the catalogue gets a version, not a second folder (step 5): + **Official**, a tag, branch or commit of its official source, or + **Experiment**, another source or someone's fixes. Say which when reporting. + With no entry yet, strongly recommend an official version first. 2. **ACP.** Does the agent speak ACP itself (an `acp` subcommand or flag)? Else is there a maintained adapter - the vendor's own, then one the ACP project lists? Note its package, latest release and date, and whether it diff --git a/.agents/skills/import-benchmark/SKILL.md b/.agents/skills/import-benchmark/SKILL.md index 45239db8..3677f84e 100644 --- a/.agents/skills/import-benchmark/SKILL.md +++ b/.agents/skills/import-benchmark/SKILL.md @@ -108,9 +108,11 @@ Leave out a route that cannot carry it, and say why in one line. If the user already named one (the prompt or the conversation), do not ask again: say which you took. Both can sit on one entry, so "both" is an answer too. -A user's own repository - a fork they fixed or extended - is a version of the -benchmark's one entry on the standard (`import-standard`, "the user's own -source"), never a second entry. +A benchmark has one entry, and each version of it is **Official** (a tag, branch or +commit of the official source) or **Experiment** (another source, or someone's +fixes: a user's own repository or fork, `import-standard`, "the user's own +source"). Say which when reporting. With no entry yet, strongly recommend an +official version first, the experiment after it. ## Citation: the benchmark's papers only @@ -139,8 +141,8 @@ When they do, write it locally: or `community`, adapted by the community), its `scoring` in two or three words (the card's tag: `Tests`, `Lean compiler`), and its `datasets` nested in it, one by registry or Hub name (or local path) with its task count, `official` link, - and `verifier` - and its `citation` and `citation_source`. The builder takes a benchmark's first dataset as its default, so a - second version is a benchmark entry of its own. + and `verifier` - and its `citation` and `citation_source`. The builder takes a benchmark's first dataset as its default: a second + version is another dataset of the same entry, after the official default. - **What reads its trials.** The `source` a trial records (the registry name, the Hub's `org/name`, or a `-p` folder's name) must reach the benchmark's report block - its `sources` in `benchmark.json`, matched exactly; a diff --git a/.agents/skills/import-standard/SKILL.md b/.agents/skills/import-standard/SKILL.md index bec6a44c..0c5f6476 100644 --- a/.agents/skills/import-standard/SKILL.md +++ b/.agents/skills/import-standard/SKILL.md @@ -277,11 +277,12 @@ prints the writable folder under the active user catalogue. Work there, then: (`docs/standard.md`, "A driver that holds the conversation"); - keep one integration per benchmark. Add reading, retrieval and execution choices as options; update the existing driver and invalidate affected proofs rather than - creating numbered development revisions. Reserve versions for explicit upstream - releases or user-requested forks; never copy proofs from a different implementation; + creating numbered development revisions. A version is Official (a tag, branch or + commit of the official source) or Experiment (another source, or someone's fixes), + the official one first; never copy proofs from a different implementation; - **the user's own source** - a fork with a fix, at a tag, a branch or a commit, any repository (a private one is fetched with this machine's git - credentials) - is a version too, never a second folder and never a patch + credentials) - is an Experiment version, never a second folder and never a patch of ours: `cli new version KEY NAME`, then `versions.NAME.upstream` = `{repository, tag?, tested}` (a branch pinned by its commit). Fetch it into the scratchpad, diff it against the pinned upstream (`git diff diff --git a/AGENTS.md b/AGENTS.md index dbb3f2da..a8cfd435 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -58,7 +58,7 @@ is: `grep -m1 '"""' app/nullius/*.py app/nullius/runs/*.py`. | `app/templates/`, `app/static/` | The interface, under the same names | | `app/tests/`, `app/ui_tests/` | Backend and route suites; fixtures are small and hand-made | | `app/site/`, `docs/` | The website; the documentation it publishes | -| `.agents/skills/` | Skills, written `/name` here; `.claude/skills` is a link to it | +| `.agents/skills/` | Skills, `/name` here; `.claude/skills` links to it | ## Commands @@ -118,15 +118,17 @@ Add neither by default. ## Catalogue -- One entry per benchmark; what it supports is an option. A version is an - upstream release or a requested fork, never a change of our driver. +- One entry per benchmark or agent; what it supports is an option. Each version is + **Official**, a tag, branch or commit of the official source, or **Experiment**, + another source or someone's fixes; never a change of our driver. Bring an + official version first. - Definitions hold configuration. Proof runs write only `proofs.json`: a bundled entry's in a user copy, which then hides the bundled one. Read both through `contract/definitions.py`; never infer proven ports from raw JSON. ## Issues and pull requests -The `file-issue` skill files both. The templates hold the shape and an example. +The `file-issue` skill files both. The templates hold an example. - Search issues and pull requests first, here and where the cause lives. - A pull request opens as a draft, with `Closes #n` when it finishes its issue, @@ -151,8 +153,6 @@ Short and plain: issues, pull requests, their comments, docs. ## Read first -The row, before changing that area. - | Working on | Read | | --- | --- | | What runs, reading a result | `.claude/rules/running.md` | From 481e4326e02a59c6ee387a5f2e6b0d13b10b70ca Mon Sep 17 00:00:00 2001 From: Etienne Filhol Date: Wed, 25 Nov 2026 01:40:16 +0100 Subject: [PATCH 7/8] ci: have the PR judge pass short descriptions, read code before tests and skip hidden comments Validated by the owner, with no risk as an answer, Depth for its path rating, the root files it may see and two row fixes. The app starts without a jobs folder in running.md and launch.json. --- .claude/launch.json | 1 - .claude/rules/running.md | 2 +- .github/scripts/judge_pr.py | 38 ++++++++++++++++++------------------- app/tests/test_judge.py | 10 ++++++++-- 4 files changed, 28 insertions(+), 23 deletions(-) diff --git a/.claude/launch.json b/.claude/launch.json index addd4641..7e291d92 100644 --- a/.claude/launch.json +++ b/.claude/launch.json @@ -9,7 +9,6 @@ "--with-requirements", "app/requirements.txt", "app/app.py", - "jobs", "--no-debug" ], "port": 5057 diff --git a/.claude/rules/running.md b/.claude/rules/running.md index 461cfdd1..a1c0187c 100644 --- a/.claude/rules/running.md +++ b/.claude/rules/running.md @@ -22,7 +22,7 @@ setup. nullius serve # or from the repository root -uv run --no-project --with-requirements app/requirements.txt app/app.py jobs +uv run --no-project --with-requirements app/requirements.txt app/app.py ``` Port and host come from saved user settings or the diff --git a/.github/scripts/judge_pr.py b/.github/scripts/judge_pr.py index fbea4712..7c0e3c57 100644 --- a/.github/scripts/judge_pr.py +++ b/.github/scripts/judge_pr.py @@ -11,7 +11,7 @@ script's own signals, and floored by the script: a deleted test, a key-shaped string or a workflow change is severe at least; a change under the standard, execution, hosts or secrets is major at least. -- **Priority** (low, medium, high, extreme): how deep the diff reaches, +- **Depth** (low, medium, high, extreme): how deep the diff reaches, computed from its paths alone (`priority_of`). - The questions, each asked k times (default 3) over one state of issue, description and diff: the acceptance criteria of the linked issue, one row @@ -67,7 +67,7 @@ URL = "https://api.typesafe.ai/v1/systemone" MODEL = "jev-latest" PROVIDER = "typesafe.ai" -QUESTIONS_VERSION = "judgement.questions.pr.v2" +QUESTIONS_VERSION = "judgement.questions.pr.v3" PRICE_PER_MTOK = 0.042 # USD per million input tokens (docs.typesafe.ai/models) CHARS_PER_TOKEN = 4 FILE_LIMIT = 12_000 # characters of one file's diff kept (--file-limit) @@ -92,7 +92,7 @@ "criterion_met": { "type": "noul", "instructions": "The pull request shows this acceptance criterion done.", - "criteria": {"true": "What the criterion asks for is visible in the diff or the tests it adds", + "criteria": {"true": "What the criterion asks for is visible in the diff", "false": "It is not visible, or the change is about something else"}, }, "issue_same": { @@ -104,9 +104,9 @@ }, "description_matches": { "type": "choice", - "instructions": "Does the pull request description describe the change the diff makes, claiming nothing the diff does not do and leaving out nothing the diff does?", - "criteria": {"yes": "What the description says the change does, the diff does, and nothing material is left unsaid", - "partly": "The description is right as far as it goes but leaves out a material part of the diff, or overstates a detail", + "instructions": "Does the pull request description name the change the diff makes and claim nothing the diff does not do? A short description is right: details are left to the diff.", + "criteria": {"yes": "What the description says the change does, the diff does, and each main change is named, a changed default, permission or file on disk included, in however few words", + "partly": "The description never names one of the main changes, or overstates a detail", "no": "The description claims a change the diff does not make, or describes a different change"}, }, "scope": { @@ -119,7 +119,7 @@ "risk_named": { "type": "choice", "instructions": "Does the description name what could break if this change is wrong and how it would be undone (a revert, a rebuild, a migration): deleted tests, changed defaults, data on disk, keys?", - "criteria": {"yes": "The description's Risk section names what could break and how it is undone, and it matches the diff", + "criteria": {"yes": "The description names what could break and how it is undone, and it matches the diff; or the change plainly carries no risk", "partly": "It names a risk but misses one the diff plainly carries, or says nothing about undoing it", "no": "No risk is named, or the one named is not the diff's"}, }, @@ -233,7 +233,8 @@ def _list_items(lines: list) -> list: for line in lines: b = BULLET.match(line) if b: - items.append(b.group(1)) + if not re.fullmatch(r"\[[ xX]?\]", b.group(1)): # a box left empty is no criterion + items.append(b.group(1)) elif items and CONTINUATION.match(line): items[-1] += " " + line.strip() elif items and not line.strip(): @@ -294,7 +295,7 @@ def criteria_of(body: str) -> tuple: TRAILER = re.compile(r"^\s*(?:Co-Authored-By|Co-authored-by):\s*(?:claude|anthropic|chatgpt|openai|gpt|copilot|gemini|codex|cursor|devin|assistant)\b" r"|^\s*(?:Claude-Session|Generated-by|Generated by|Signed-off-by: Claude)", re.I | re.M) ALLOWED_ROOTS = ("app/", "docs/", ".github/", ".agents/", ".claude/") -ALLOWED_ROOT_FILES = ("README.md", "AGENTS.md", ".gitignore", ".gitattributes", "LICENSE", "LICENCE") +ALLOWED_ROOT_FILES = ("README.md", "AGENTS.md", "CONTRIBUTING.md", "SECURITY.md", "pyproject.toml", ".gitignore", ".gitattributes", "LICENSE", "LICENCE") VISIBLE = ("app/templates/", "app/static/", "docs/field-guide.md", "docs/assets/", "docs/diagrams/", "app/site/assets/", "app/site/overrides/") PRIORITY_PATHS = [ # the first match decides; deepest first ("extreme", ("app/nullius/standard/", "app/nullius/execution.py", "app/nullius/hosts.py", "app/nullius/secrets.py", ".github/workflows/", ".github/scripts/")), @@ -379,7 +380,7 @@ def signals_of(diff: str, pr: dict) -> dict: {"name": "No Flask import under the backend package", "ok": not flask, "detail": ", ".join(flask[:3])}, {"name": "No key-shaped string in the diff", "ok": not secrets, "detail": ", ".join(secrets[:3])}, ] - return {"paths": paths, "files": len(files), "tests_in_diff": [p for p in paths if is_test_path(p)], "deleted_tests": deleted_tests, + return {"paths": paths, "files": len(files), "deleted_tests": deleted_tests, "visible": visible, "images": images, "priority": priority, "priority_by": by, "risk_floor": floor, "risk_floor_why": why, "checks": checks} @@ -387,10 +388,9 @@ def signals_of(diff: str, pr: dict) -> dict: def signals_block(sig: dict) -> str: """The signals as the judge sees them, after the diff.""" lines = [f"PATHS ({sig['files']}): " + ", ".join(sig["paths"][:60]) + (" …" if sig["files"] > 60 else ""), - f"TESTS IN DIFF: {', '.join(sig['tests_in_diff']) or 'none'}", f"DELETED TESTS: {', '.join(sig['deleted_tests']) or 'none'}", f"VISIBLE PATHS: {', '.join(sig['visible']) or 'none'}; images under 'Before and after': {sig['images']}", - f"PRIORITY FROM PATHS: {sig['priority']}" + (f" ({sig['priority_by']})" if sig["priority_by"] else "")] + f"DEPTH FROM PATHS: {sig['priority']}" + (f" ({sig['priority_by']})" if sig["priority_by"] else "")] if sig["risk_floor"]: lines.append(f"MERGE RISK FLOOR: {sig['risk_floor']}: {sig['risk_floor_why']}") return "SIGNALS:\n" + "\n".join(lines) @@ -398,12 +398,12 @@ def signals_block(sig: dict) -> str: def diff_block(diff: str, budget: int, file_limit: int = None) -> tuple: - """The diff as the judge sees it: test files first, each file cut at + """The diff as the judge sees it: test files last, each file cut at FILE_LIMIT, the whole cut at `budget`; files that did not fit are named. Returns (text, truncated).""" file_limit = FILE_LIMIT if file_limit is None else file_limit files = split_diff(diff) - files.sort(key=lambda f: (0 if is_test_path(f[0]) else 1)) + files.sort(key=lambda f: is_test_path(f[0])) parts, used, truncated, left = [], 0, False, [] for path, text in files: if len(text) > file_limit: @@ -417,12 +417,12 @@ def diff_block(diff: str, budget: int, file_limit: int = None) -> tuple: if left: truncated = True parts.append(f"[diff omitted for {len(left)} more file(s): " + ", ".join(left) + "]") - head = f"DIFF ({len(files)} files, tests first{', cut' if truncated else ''}):\n" + head = f"DIFF ({len(files)} files, tests last{', cut' if truncated else ''}):\n" return head + "\n".join(parts), truncated def description_block(pr: dict) -> tuple: - body = (pr.get("body") or "").strip() or "(no description)" + body = re.sub(r"", "", pr.get("body") or "", flags=re.S).strip() or "(no description)" # the template's hints, hidden on GitHub truncated = len(body) > DESCRIPTION_LIMIT if truncated: body = body[:DESCRIPTION_LIMIT] + f"\n[… {len(body) - DESCRIPTION_LIMIT} more characters]" @@ -577,7 +577,7 @@ def short(text: str, n: int = 90) -> str: ROWS = [ # (question id or script row, the text of the row) ("criteria", "Changes do what the issue asks"), ("issue_same", "Issue and pull request describe the same change"), - ("description_matches", "Description matches the diff, no more, no less"), + ("description_matches", "Description matches the diff"), ("scope", "Diff stays in scope"), ("risk_named", "Risk named in the description"), ("before_after", "Before and after shown"), @@ -643,7 +643,7 @@ def summary_md(rec: dict) -> str: risk, prio, sig = rec["merge_risk"], rec["priority"], rec["signals"] lines += ["| | | |", "| --- | --- | --- |", f"| **Merge risk** | {RISK_MARK.get(risk['level'], '❔')} **{risk['level'].upper()}** | {risk['why']} |", - f"| **Priority** | {PRIORITY_MARK.get(prio['level'], '❔')} **{prio['level'].upper()}** | {prio['why']} |", ""] + f"| **Depth** | {PRIORITY_MARK.get(prio['level'], '❔')} **{prio['level'].upper()}** | {prio['why']} |", ""] lines += ["| Question | Verdict |", "| --- | :---: |"] for text, v, note in rows: lines.append(f"| {text}{' · ' + note if note else ''} | {VERDICT.get(v, v)} |") @@ -655,7 +655,7 @@ def summary_md(rec: dict) -> str: lines += ["
", f"{title}", "", "| # | Criterion | Verdict |", "| ---: | --- | :---: |"] for r in crit: v = verdict_of(r["decision"]) - lines.append(f"| {r['n']} | {short(r['text'], 120)} | {VERDICT[v]}{' (cut)' if r['truncated'] else ''} |") + lines.append(f"| {r['n']} | {short(r['text'], 120).replace('|', chr(92) + '|')} | {VERDICT[v]}{' (cut)' if r['truncated'] else ''} |") if rec["criteria_source"] == "whole issue": lines += ["", "The issue has no `## Acceptance` list, so it was judged whole."] lines += ["", "
", ""] diff --git a/app/tests/test_judge.py b/app/tests/test_judge.py index bea6af96..543ff55c 100644 --- a/app/tests/test_judge.py +++ b/app/tests/test_judge.py @@ -668,7 +668,7 @@ def _dry(self, tmp, with_issue): "diff --git a/app/ui_tests/test_run.py b/app/ui_tests/test_run.py\n--- /dev/null\n+++ b/app/ui_tests/test_run.py\n@@ -0,0 +1 @@\n+def test_run_button(): pass\n", encoding="utf-8") args = [sys.executable, str(self.SCRIPT), "--pr-file", str(tmp / "pr.md"), "--diff-file", str(tmp / "pr.diff"), "--dry", "--out-json", str(tmp / "j.json")] if with_issue: - (tmp / "issue.md").write_text("Run from Review\n\n## Acceptance\n- [ ] A Run button on the Review step\n- [ ] A test clicks it\n", encoding="utf-8") + (tmp / "issue.md").write_text("Run from Review\n\n## Acceptance\n- [ ] A Run button on the Review step\n- [ ] `--run now|later` starts it\n", encoding="utf-8") args += ["--issue-file", str(tmp / "issue.md")] done = subprocess.run(args, capture_output=True, text=True, cwd=str(tmp), env={"PATH": "/usr/bin:/bin"}) self.assertEqual(done.returncode, 0, done.stderr) @@ -678,11 +678,12 @@ def test_a_dry_run_with_an_issue_has_one_row_per_acceptance_box_and_asks_nothing tmp = Path(tempfile.mkdtemp(prefix="nullius-judge-pr-")); self.addCleanup(shutil.rmtree, tmp, True) rec, out = self._dry(tmp, with_issue=True) self.assertEqual(rec["criteria_source"], "acceptance heading") - self.assertEqual([r["text"] for r in rec["criteria"]], ["A Run button on the Review step", "A test clicks it"]) + self.assertEqual([r["text"] for r in rec["criteria"]], ["A Run button on the Review step", "`--run now|later` starts it"]) self.assertEqual(rec["usage"]["calls"], 0) self.assertEqual(rec["estimate"]["calls"], 9) # (2 criteria + the description) × k=3 self.assertIn("dry run", out) self.assertIn("Acceptance criteria, 2", out) + self.assertIn("`--run now\\|later` starts it |", out) # a bar would split the row self.assertTrue(all(r["state_chars"] > 0 and not r["truncated"] for r in rec["criteria"])) # the states were built; the record keeps their size, not their text def test_a_pull_request_without_an_issue_is_judged_on_its_description_alone(self): @@ -748,6 +749,11 @@ def test_the_floors_the_checks_and_the_before_and_after_count(self): self.assertTrue(all(c["ok"] for c in clean["checks"])) self.assertEqual(clean["visible"], []) + self.assertNotIn("a hint", J.description_block({"body": "\n## What\nthe change"})[0]) + block, _ = J.diff_block(diff, 10_000) + self.assertLess(block.index("a/app/static/style.css"), block.index("a/app/tests/test_x.py")) # code before tests + self.assertEqual(J.criteria_of("### Acceptance\n\n- [ ]\n- [ ] A box\n")[0], ["A box"]) + body = "Closes #1\n\n## What\nthe change\n\n## Verified\nnot verified\n\n## Risk\nnone" self.assertEqual(J.section(body, "verified"), "not verified") self.assertEqual(J.section(body, "Risk"), "none") From 91fbe93ff77472301b8eba5468e0304006192bff Mon Sep 17 00:00:00 2001 From: Etienne Filhol Date: Wed, 25 Nov 2026 08:50:03 +0100 Subject: [PATCH 8/8] docs(web): say a page and its command change together, and that pages share one look --- .claude/rules/ui.md | 31 ++++++++++++++++++++ AGENTS.md | 69 +++++++++++++++++++++++---------------------- 2 files changed, 67 insertions(+), 33 deletions(-) diff --git a/.claude/rules/ui.md b/.claude/rules/ui.md index 403f9450..fc8fa6c5 100644 --- a/.claude/rules/ui.md +++ b/.claude/rules/ui.md @@ -1,3 +1,34 @@ +## One look, and its command + +- What a page gains, its command gains, or the pull request says why not: + `docs/cli/pages.md` pairs them. +- The same thing looks the same on every page. Use these, as other pages do, in the + builder too: its `nb-` classes are old copies. None fits: say so and ask the owner. + + | For | Use | + | --- | --- | + | A page's title and buttons | `page_head` | + | A section's title; a group's | `h2`; `h3`, unstyled | + | A list | `table` or `cards`, with their controls | + | A button | `.btn`, never `nb-button`; beside the main one `ghost`; in a row of controls `sm`; one that deletes `danger` | + | An icon alone; an action in a sentence | `.icon-btn`; `.linkish` | + | One of a few views; a filter | `.seg-toggle`; the controls' pills and menus | + | One of a list; a model | a `select`, which `controls.js` draws; `model-picker.js` | + | A dialog; a message | `dialog.std-how`, never `nb-dialog`; `nulliusNotify`, never `nb-toast` | + | More on demand | `details` | + | Quieter text; smaller; ids, code, commands | `.muted`; `.small`; `.mono` | + | Larger text, a figure | none yet: ask the owner | + + `danger` and `std-how` are in `app/static/catalogue/catalogue.css`. + +- New CSS only places them (grid, gap, margin, width). It sets no font, draws no + button, takes colors from the tokens, and has no rule on a shared class, `button` + or `h2` under a page's id. Before reporting, this prints nothing: + + ```bash + git diff -U0 --merge-base origin/main -- app/static app/templates | grep -E '^\+.*font(-[a-z]+)?:' + ``` + ## The interface, as its owner wants it For routine interface changes, run the relevant unit and route tests and make diff --git a/AGENTS.md b/AGENTS.md index a8cfd435..7ecc8e4f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -4,30 +4,39 @@ Nullius runs AI evaluations and opens every score into its evidence, to tell an agent's failure from a benchmark's. - Runs through the Nullius standard (`docs/standard.md`) or Harbor, only when - asked. Also reads Harbor, ATIF and OpenTelemetry results. + asked. Reads Harbor, ATIF and OpenTelemetry results. - `app/nullius/` is the backend: standard library only, except code that runs in an upstream's own environment. `app/web/` is Flask, the web framework and the only runtime dependency. -The user's instructions come first, then this file, then `.claude/rules/`. Rules -for every contributor and assistant: no file catalogue, no history. +The user's instructions come first, then this file, then `.claude/rules/`. No file +list, no history. ## How we work - **Small diffs.** No refactoring on the way. A defect found in passing becomes - an issue, not a wider change. -- **Nearby code over assumptions.** Describe what is. Remove the code and comments - your change makes obsolete. + an issue. +- **Nearby code over assumptions.** Remove the code and comments your change makes + obsolete. - **Facilitator, not re-implementer.** A benchmark, agent or capability runs its - upstream's own code at a pin, in its own environment. Ask before writing more + upstream's code at a pin, in its own environment. Ask before writing more than glue. -- **Reuse before adding**, for example `ondisk`, `redact`, `paths`, `providers`; on - a page `_tables.html`, `_cards.html`, `model-picker.js`, `_icons.svg`. +- **Reuse before adding**, for example `ondisk`, `redact`, `paths`, `providers`. - **No machine attribution** in a commit or a pull request: no assistant - `Co-Authored-By`, session link or generated-by line. Human co-authors stay. - Existing commits are not rewritten for it. + `Co-Authored-By`, session link or generated-by line. Human co-authors + and existing commits stay. - **Nothing merges without the owner's word.** +## Pages and commands + +- **Page and command agree.** Never change one alone, whichever was asked for. Read + the other side first (`docs/cli/pages.md` pairs them): same options, words, order, + defaults and numbers, computed once, in `app/nullius/`. The pull request names a + side left alone, and why. +- **One look.** A thing looks the same on every page: reuse its macro and class, from + the table in `.claude/rules/ui.md`. New CSS sets no font, size or weight and draws + no button. None fits: ask the owner. + ## Three rules, each with a test 1. No file in `app/nullius/` imports Flask, so it runs without the web app: on @@ -50,11 +59,11 @@ 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/catalogue/` | A folder per entry under `benchmarks/`, `agents/`, `capabilities/`: its definition and its own code | +| `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 | -| `app/nullius/standard/` | The standard: `contract/`, `requirements/`, `protocols/`, `calls/`, `backends/`, `runner/`, `proofs/`, `pages/`, whose imports never loop (`test_layering`), and the conformance `kits/` | -| `app/web/` | One module per area; `core` is the application, `shared` what pages share. Write `shared.STATE`, never `from .shared import STATE`, so one patch reaches all | +| `app/nullius/standard/` | The standard: `contract/`, `requirements/`, `protocols/`, `calls/`, `backends/`, `runner/`, `proofs/`, `pages/`, whose imports never loop, and the conformance `kits/` | +| `app/web/` | One module per area; `core` is the application, `shared` what pages share. Write `shared.STATE`, so one patch reaches all | | `app/templates/`, `app/static/` | The interface, under the same names | | `app/tests/`, `app/ui_tests/` | Backend and route suites; fixtures are small and hand-made | | `app/site/`, `docs/` | The website; the documentation it publishes | @@ -62,10 +71,8 @@ is: `grep -m1 '"""' app/nullius/*.py app/nullius/runs/*.py`. ## Commands -From the repository root: - ```bash -# backend suite; --docker adds the tests that run containers +# backend suite, needs git and uv; --docker adds the container tests python3 app/tests/parallel.py # route suite @@ -80,15 +87,14 @@ NULLIUS_HOME=$(mktemp -d) uv run --no-project --with-requirements app/requiremen app/app.py --debug --port 8791 PYTHONPATH=app NULLIUS_HOME=$(mktemp -d) python3 -m nullius --help -# the documentation's links and paths +# the docs' links and paths python3 .agents/skills/docs-drift/scripts/check_docs.py ``` -- Always a profile of your own (`NULLIUS_HOME`). The user's server follows their - runs: never start on their profile, never stop it. -- The backend suite needs git and uv. Without Node, tests of page scripts skip. -- A draft gets no CI: run the suites you touch. Ready, it gets the tests and the PR - judge, which never gates; `/judge` in a comment asks it on a draft. +- Always a profile of your own (`NULLIUS_HOME`). Never stop the user's server: it + follows their runs. +- A draft gets no CI: run the suites you touch. `/judge` in a comment asks the + judge, which never gates. | Changed | Refresh | | --- | --- | @@ -107,10 +113,8 @@ Add neither by default. - **A test** when no existing one would catch this breaking: behavior, a contract, a failure mode. Not wording, structure or catalogue contents. Extend a nearby case first. -- **Removing one:** name the assertions that still protect its behavior; keep its - edge cases. -- **Docs** when what they say became wrong, or a reader needs them to choose or - act. The code already says how it works. +- **Removing one:** name what still protects its behavior and edge cases. +- **Docs** when what they say became wrong, or a reader needs them to choose or act. - **In `docs/`:** keep guarantees, requirements, refusals and their fix; drop mechanism, narration, history and what the builder already checks. One fact, one page. A table cell is a line. No validations, captures or rendered reports. @@ -128,7 +132,7 @@ Add neither by default. ## Issues and pull requests -The `file-issue` skill files both. The templates hold an example. +The `file-issue` skill files both. - Search issues and pull requests first, here and where the cause lives. - A pull request opens as a draft, with `Closes #n` when it finishes its issue, @@ -139,8 +143,7 @@ The `file-issue` skill files both. The templates hold an example. - Scopes: `standard` `catalogue` `runs` `traces` `compare` `judge` `builder` `web` `execution` `settings` `docs` `site` `ci` `release` - No key, email address, personal message or private link. -- A security problem goes to Nullius's contact address, - `nullius.thinkflowlab@proton.me`, never to an issue (`SECURITY.md`). +- A security problem goes to the address in `SECURITY.md`, never to an issue. ## Writing @@ -160,11 +163,11 @@ Short and plain: issues, pull requests, their comments, docs. | Any page | `.claude/rules/ui.md`; `/ui-sweep` only when asked | | Vocabulary | `docs/concepts.md` | | The standard, its ports and kits | `docs/standard.md` | -| Adding an entry | `/import-benchmark`, `/import-standard`, `/import-agent`, `/import-capability`; by hand, `add-manually.md` under `docs/benchmarks/`, `docs/agents/` or `docs/capabilities/` | +| Adding an entry | `/import-benchmark`, `/import-standard`, `/import-agent`, `/import-capability`; by hand, `add-manually.md` under its `docs/` folder | | Removing an entry | `/remove-integration` | | The run builder | `docs/builder.md`; `app/nullius/recipes/launch.py`; `app/static/builder/command-builder-core.js` | -| A module | Its docstring. Whole designs: `execution.py`, `catalogue/catalog.py`, `harbor/source.py`, `runs/live.py` | -| A command; a metric | `docs/cli/README.md`; `docs/field-guide.md` | +| A whole design | Docstrings of `execution.py`, `catalogue/catalog.py`, `harbor/source.py`, `runs/live.py` | +| A command | `docs/cli/README.md` | | Settings and storage | `docs/settings/README.md`; `app/nullius/settings.py` | | Judgement; the PR judge | `docs/judgement.md`; docstring of `.github/scripts/judge_pr.py` | | A run that looks wrong, comparing runs | `/run-analysis` |