Repository navigation
docs: index the runnable bench modules and pin the page to the tree (#1239) - #1250
Conversation
…1239) Fixes #1239. One page listing every bench module that has its own __main__: what it measures, the command it takes, whether it runs offline or needs a provider key, and the committed artefact when one exists. tests/test_bench_index.py pins the set both ways, so a new module without a row fails the suite.
|
draft → ready: Re-ran the body's checks at that head, in this worktree:
Before the flip: one body edit — the Labels |
|
Pre-report for one body edit on this now-ready PR, per the standing flip rule: next edit appends exactly one line recording the flip ( |
|
Pre-report for one body edit after a new commit, per the standing rule: The commit fixes a wrong pointer I shipped. Re-run at
No re-flip: the PR was already ready before this commit. |
|
Pre-report for one body edit: the "What changed" bullet still names |
|
@Birfy: review request for |
The "Which key" note pointed a reader at `agentdescent/backends.py` for `ANTHROPIC_API_KEY`, but that file never names the claude provider — its `claude` matches are `claude_code()` and `.claude/skills`. The adapter is `claude()` at `agentdescent/agents.py:737`, and the environment name comes from `anthropic_compatible(api_key_env="ANTHROPIC_API_KEY")` at `:1126-1127`; `bench/candidate_methods.py:187` and `bench/openevolve_agentdescent.py:296` are the callers behind `--provider claude`. Only the citation changes; no table row, nav line, test or changelog text. Refs #1239.
|
@Birfy: review request for Branch updated to the live main |
|
Review (Birfy) Tip SHA: 1f1d7db
|
|
Pre-report for one append-only body edit on this ready PR. The tip does not move: the edit adds one section at the end recording that the branch was updated to main, because the |
|
Review (Birfy) Tip SHA: aac952f
|
|
@Birfy: review request for Main moved to |
The bench index told operators on a read-only `$HOME` box to point `HOME` at a scratch directory. That repair moves the Python user site as well, so it can hide the interpreter's installed packages, while the cache root the fix now resolves can be moved on its own with `AGENTDESCENT_CACHE` (or `XDG_CACHE_HOME`). Replace that instruction and name the resolved root next to the three flat `~/.cache/agentdescent/` lines; extend the existing fragment with the operator clause. This merge brings main 441ac2b in so `docs/bench-index.md` from #1250 is in the tree; nothing outside the docs and the fragment changes. Written-by: AgentDescent Dev-3
Fixes #1252. ## What changed `plan`'s `next:` and `--json.next` now name the smallest of the structural bound, the spec's declared cap (#1219) and the call cap the run will actually enforce, so a 2-call `AGENTDESCENT_MAX_CALLS` ceiling no longer produces `--max-calls 11` with `warnings: []`; when the ceiling lowers the advice, `warnings` says so (`AGENTDESCENT_MAX_CALLS=2 caps this run at 2 calls; the plan estimates 11`), and a malformed ceiling is the config answer `evolve` would raise instead of a traceback. The MCP face: a spent Ticket makes `Tools.plan` refuse in `start`'s exact sentence and bytes, instead of answering `ok: true` with `max_calls: 0`. Reporting only — `estimate.agent_calls_upper_bound`, `call_limit`'s numbers, enforcement and every stop reason are untouched, and an uncapped plan's text and JSON do not change. Not a goal: `algorithms run`'s own `next:` (the issue names the `plan` surface) and any change to what is enforced. Draft: `#1238` and `#1250` are the two ready PRs in the owner-click queue. ## Verification at the tip Tip SHA: 7917e76 Ran: - red first at `22ea7528915a761c579dc4c7f47d8444c159cd8a`: new `tests/test_plan_advice_ceiling.py` → 5 failed, 3 controls passed (`assert 'agentdescent…--max-calls 11' == 'agentdescent…--max-calls 2'`) - `tests/test_plan_advice_ceiling.py` → pass (8 passed; 14 passed with the #1219 rows) - plan/CLI family (`test_plan_next_respects_spec_cap`, `test_plan_text_output`, `test_plan_probe`, `test_plan_headroom_shape`, `test_first_run_caps`, `test_cli_algorithms_run`, `test_demo`) → pass (136 passed) - Ticket/cap family (`test_mcp_ticket_cap`, `test_mcp_call_limit`, `test_mcp_ticket_remainder_label`, `test_operator_run_cap`, `test_mcp`) with `test_changelog_fragments` and `test_api_reference` → pass (164 passed) - `python -m tools.changelog_fragments check` → 33 changelog fragment(s) OK - `python -m tools.gen_api_docs --check` → docs/api.md is up to date - `pytest -q` (full suite at this tip) → `21 failed, 8085 passed, 51 skipped, 526 warnings in 2005.70s (0:33:25)`; the 21 are the four known environment files only (`test_sandbox_container.py` 12, `test_era_srbench.py` 6, `test_genesis_example.py` 2, `test_wheel_smoke.py` 1), the same set the base run produces, and none of them touch `cli.py`, `mcp.py` or the new test file Not run: - `mkdocs build --strict` → not applicable (no docs change) - wheel smoke / real-model check → not needed for a reporting-only change ## Correction (appended; tip unchanged) The plan/CLI family bullet above names seven files and reports `136 passed`; those seven files alone are `128`. The `136` was the same run with the new file's `8` rows added, so the bullet counted `tests/test_plan_advice_ceiling.py` a second time. Seven-file figure: `128 passed`. Every other number in the evidence block measures as written. Correction, closing the stale sha (append-only; nothing above changes): the `Tip SHA:` line above is not the reviewed head — review request `7129820256` named the live head `29b2a1ec3e9fb9f07da0f68f02606ee624898ba9`. The plan/CLI family bullet's `136` is those seven files' `128` plus the new file's `8`; `--collect-only` gives 128 at both `7917e762` and `29b2a1ec`. Every other number and section stands as written.
…1267) Fixes #1261 ## What changed The dataset cache root is resolved when it is used, not at import: `cache_path` now calls `_cache_root()` — `AGENTDESCENT_CACHE` when set, else `$XDG_CACHE_HOME/agentdescent`, else today's `~/.cache/agentdescent` (`CACHE_ROOT`, unchanged). `cache_path(subdir, filename)` keeps its signature and its `makedirs`, and nothing about what is fetched, cached or keyed moves. A host whose home is read-only — a container or CI sandbox — can now run dataset-backed ports and benches instead of dying with `OSError: [Errno 30] Read-only file system` under `~/.cache`, and an existing cache is still found by default. One bullet in `docs/testing-guide.md`'s failure modes, `changelog.d/1261-cache-root-env.md`, and four tests in `tests/test_dataloader_cache_root.py` (each variable, precedence, and the no-variable default). **Named risk:** `tests/conftest.py` gains an autouse fixture that deletes `AGENTDESCENT_CACHE` and `XDG_CACHE_HOME` for every test. It is needed because the root now reads the environment at call time: with the guard removed and either variable exported, 30 existing cache tests fail (measured below). The fixture is suite-wide, so a future test that wants either variable must set it after the fixture, as the new file does. ## Verification Tip SHA: 789fb32 Measured at the previous head `dd45cd43d3443d2e62b4f69eb20fa90903082496`; the `789fb32b` numbers are in the section below. Ran: - new test file only, at base `441ac2bd` (red, my run): 4 failed — three `E OSError: [Errno 30] Read-only file system: '/home/xuke/.cache/agentdescent'` from `cache_path`, one `E AttributeError: module 'agentdescent.dataloader' has no attribute '_cache_root'` - `pytest tests/test_dataloader_cache_root.py tests/test_dataloader.py tests/test_dataloader_cache_names.py tests/test_packaging.py tests/test_changelog_fragments.py` → `113 passed in 4.37s` - same cache files under a leaking shell (`XDG_CACHE_HOME=/tmp/leak-xdg AGENTDESCENT_CACHE=/tmp/leak-cache`), guard on → `55 passed in 2.56s`; with the guard cut by hand → `30 failed, 21 passed in 4.01s` - `python3 -m tools.changelog_fragments check` → `38 changelog fragment(s) OK` Not run: - full `pytest -q` — collection needs `markdown` for `tests/test_docs_links.py` (not installed, and site-packages is read-only on this host); the run with that file ignored was still executing when this PR opened, so the CI `test` legs are the suite run - `mkdocs build --strict` — mkdocs is not installed on this host; the docs change is one bullet on an existing page, no nav change ## Verification at 789fb32 Docs commit in this tip: `docs/bench-index.md`'s writable-`$HOME` bullet now points operators at `AGENTDESCENT_CACHE` (or `XDG_CACHE_HOME`) instead of moving `HOME`, which also moves the Python user site; the flat `~/.cache/agentdescent/` lines in `docs/dataloader.md` and `docs/self-evolution-examples.md` now name `$XDG_CACHE_HOME/agentdescent`, the `~/.cache/agentdescent` default, and the `AGENTDESCENT_CACHE` override. This tip merges `main 441ac2b` in — so the `docs/bench-index.md` added by #1250 is in the tree — and adds one docs commit on top; nothing outside the docs and the fragment changed. Acceptance on this host, whose `~/.cache` is read-only and whose `HOME` is untouched: - `AGENTDESCENT_CACHE=<fresh dir> AGENTDESCENT_GSM8K_SAMPLE=1 python3 -m bench.candidate_methods --dry-run` → exit 0; `algorithms=14, modes=3, repeats=1, reserved candidates=84, reserved proposal calls=108, workers=2`; the dataset was cached under `<fresh dir>/gsmhard/gsmhardv2.jsonl`. The same command with `AGENTDESCENT_CACHE` unset fails on this host with `OSError: [Errno 30] Read-only file system: '/home/xuke/.cache/agentdescent'` (measured at `dd45cd43`). - `pytest tests/test_dataloader_cache_root.py tests/test_dataloader.py tests/test_dataloader_cache_names.py tests/test_packaging.py tests/test_changelog_fragments.py tests/test_bench_index.py` → `116 passed in 4.20s` - `python3 -m tools.changelog_fragments check` → `39 changelog fragment(s) OK` (38 at `dd45cd43` plus `changelog.d/1239-bench-index.md`, brought in by the merge) Full `pytest -q` and `mkdocs build --strict` remain not run here for the reasons above; the CI `test` legs are the suite run.
Closes #1239.
What changed
Four files, docs plus the test that pins them:
docs/bench-index.md(new) — one table for the sixteenbench/*.pymodulesthat carry
if __name__ == "__main__", split into the eight that run offlineand the eight that make live model calls. Every row gives what the module
measures, its command, and the committed artefact under
bench/results/whenone exists (
—where the module writes a file you name yourself).key rather than gesturing at one:
--provider openaiand--provider glmread
OPENAI_API_KEY,--provider claudereadsANTHROPIC_API_KEY(
agentdescent/agents.py:737), and themetasearch_*pair is offline under--dry-run, so it needs no key at all. That distinction is the part a readeracts on, so it is in the page and repeated in the PR body.
mkdocs.yml— one nav line,Benchmarks you can run — the index: bench-index.md, inside Examples and results, immediately above the twobench pages it indexes.
tests/test_bench_index.py(new) — the page ↔ tree pin: the set ofbench/*.pywith a top-levelif __name__ == "__main__"(read from the AST,not by grepping) must equal the set of modules the page gives a
python -m bench.<module>command for, checked in both directions.changelog.d/1239-bench-index.md— categoryAdded.Nothing else moved: no
bench/change, noagentdescent/change, no resultsfile, no page besides the new one.
Red first
The new test is red on today's tree by construction, since the page does not
exist. Measured at this PR's base
b4647375in a fresh worktree with only the newtest file copied in:
With the page in place:
3 passed in 0.50s.Acceptance loop
Sixteen
--helpinvocations, noFAILline:bench/is byte-identical betweend6c59ed9and this PR's baseb4647375(
git diff --stat d6c59ed9 b4647375 -- bench/is empty), so the sixteen--helpreads and the flag check below were re-run once and still hold at thebase.
That loop needs two environment facts, both written into the page and both
reproduced here rather than hidden:
HOMEmust be writable.agentdescent/dataloader.py:40hardcodes~/.cache/agentdescent, so on a box with a read-only$HOMEthe twocandidate_methods*modules die at import withOSError: [Errno 30] Read-only file system: '/home/xuke/.cache/agentdescent'.The loop above ran with
HOMEpointed at a scratch directory.bench/candidate_methods.pyandbench/candidate_methods_merge.pybuildtheir algorithm registry at import time from the GSM8K splits, so even
--helploads the dataset. With no network and nopyarrowthe loader's ownmessage names the way out:
AGENTDESCENT_GSM8K_SAMPLE=1(bundled 96-rowsample). The loop ran with it set; the other fourteen modules are unaffected
by it.
Other gates
--help: the sixteen rowswere extracted from the Markdown and each
--flagcompared againstpython3 -m bench.<module> --help—16 rows, 0 missing flags.python3 -m tools.changelog_fragments check→30 changelog fragment(s) OKpython3 -m tools.gen_api_docs --check→docs/api.md is up to datepytest tests/test_site_navigation.py tests/test_bench_index.py→6 passedTip SHA:
1f1d7db701740643a25fea6837084bf5f5fadaccNot run:
mkdocs build --strict— this box has nomkdocsand no network to installit (
pip download mkdocsproduces no wheel;import mkdocsraisesModuleNotFoundError), so the strict build cannot be produced locally. Thenav change is covered by
tests/test_site_navigation.py(readsmkdocs.ymland passes) and by the requiredbuildcheck in CI, which runsthe same strict build on the tip.
One correction to the card's measurement, no action needed:
bench/holds19
.pyfiles atb4647375, not 20 — the sixteen with__main__plusharness.py,rsi_bench.pyand__init__.py. The sixteen-module list in thecard is exactly right and is what the test and the page carry; the test derives
the set from the tree either way, so the count in prose cannot rot.
Forward-merge to the live main
#1243(de3624fab6df) and#1244(eb9acd5e8e41) landed, so this branch wasforward-merged with
git merge origin/main(no rebase, no force-push) ontoeb9acd5e8e417241cec2a60517c7f89272b0d5be. Nothing in this PR conflicted and nofile of this PR changed: the merge brought
agentdescent/,tests/test_apply_non_regular_leaf.py,tests/test_mcp_ticket_remainder_label.pyand two changelog fragments.Re-measured at the merge head
ab75f2e8062ca3bb8c70d91faded244b222df850:pytest tests/test_bench_index.py tests/test_site_navigation.py→6 passed in 0.68s--helploop (HOMEwritable,AGENTDESCENT_GSM8K_SAMPLE=1) →fails=016 rows, 0 missing flagspython3 -m tools.changelog_fragments check→32 changelog fragment(s) OK(30 at the old base, plus
changelog.d/1225-non-regular-leaf.mdandchangelog.d/1241-ticket-remainder-label.mdfrom the merge)python3 -m tools.gen_api_docs --check→docs/api.md is up to dateThe red-first block above was measured at the old base
b4647375and stays asthat record;
docs/bench-index.mdandtests/test_bench_index.pyarebyte-identical before and after the merge.
Citation fix at
1f1d7db701740643a25fea6837084bf5f5fadacc: theclaudekeynow cites
agentdescent/agents.py:737, notagentdescent/backends.py, whichnever names that provider. Re-measured at that head:
6 passed in 0.85s,16 rows, 0 missing flags.ready at ab75f2e (flip: ready_for_review 2026-11-24T04:43:26Z)
Correction (appended; branch updated to main)
aac952f73ef923f02eda0b0f1b2b395a3ab1ac4722ea7528915a761c579dc4c7f47d8444c159cd8amain; the diff is unchanged(
4 files, +156/−0). It supersedes1f1d7db7…as the tip this PR isjudged at; the
Tip SHA:line above is left as written.