Agent 自动化操作手册
This guide is for AI coding agents that set up and run DynBench for a user, or contribute to this repository. Every command below is non-interactive and outputs structured JSON.
Set up and run for a user
Section titled “Set up and run for a user”- Install. From a checkout:
python -m pip install -e '.[data]'. From a wheel:pip install 'dynbench[data]'. Docker is required for code, terminal, Harbor, and SWE tasks. - Store keys safely. Write API keys to
.envasNAME=value(chmod 600 .env), or export them in the shell. Never pass a key on the command line and never print it. Config files only reference the variable name viakey_env. - Find benchmarks.
dynbench bench search <words>lists matching benchmarks withroles(such asjudge),model_needs(text,image,audio), andhost_needs(docker,x86_64,kvm,gpu). - Discover models.
dynbench models scan --url <base_url> --key-env NAME --write-config .local/models.tomlqueries/models, probes callable capabilities (text,image,tools), and writes a local model config. Limit scope with--modelsto control requests. Report any model returningupstream_policy_refusalorauth_errorto the user. - Preflight check.
dynbench setup --non-interactive --select <id> ... --url <base_url> --key-env NAME --judge <model>writes.local/dynbench-setup.jsonand reports per-benchmark readiness and blocking problems. - Pull data & environments on demand.
dynbench data pull --select <id>downloads pinned dataset slices into gitignoreddata/benchmarks/.dynbench env pull --select <id> ...pulls or builds required grader/task images and reports skipped or failed items cleanly. - Run evaluations.
dynbench bench run --select <id> ... --config .local/models.toml --models <config_id> --journal .local/run.jsonl- Pass
--role judge=<config_id>(or--judge) for benchmarks declaring ajudgerole. - Use
--jobs Nfor parallel execution (respectingrequests_per_minute),--resumeto skip completed rows and retry unscored ones, and--cache SALTto replay identical replies locally. - Use
--harness bundle.jsonto inject external agents into task containers or run stdiov2harnesses (seedocs/arch/harnesses.mdandexamples/harnesses/).
- Pass
- Inspect results. Rows are appended to the journal JSONL.
passed: nullmeansunscored(model, harness, or environment/grader error), never a model failure. Always report task sample size alongside pass counts. Use--attempts Nfor multi-attempt runs and--keep-answerswhen local answer auditing is required. - Screen SOTA-Fail & sync state.
dynbench sota panel --journal ... --panel <ids> --min-attempts N --output .local/panel.jsonfreezes panel protocol fingerprints and output budgets.dynbench sota screen --journal ... --frozen-panel .local/panel.jsonscreens unanimous failures with 95% Wilson intervals;sota verifyaudits false negatives.dynbench sota sync-state --journal ... --frozen-panel .local/panel.json [--export-hf-dir DIR]updates the sharded dynamic state machine and optionally stages Hugging Face Parquet tables.- Never approve
dynbench reviewor publish releases on your own; those require a human maintainer.
MCP server
Section titled “MCP server”dynbench serve exposes an MCP server over stdio with tools search_benchmarks, scan_models,
check_setup, start_run, run_status, and screen. dynbench serve --http PORT serves the
same tools on http://localhost:PORT/tools/<name>. Never pass literal API keys as tool arguments;
always pass the environment variable name.
Rules for agents
Section titled “Rules for agents”- Never commit
.env,.local/,data/benchmarks/, raw benchmark payloads, or any credential. - Never approve reviews, publish collections, or push releases; those are maintainer-only actions.
- Start small (
--limit 2) and state the expected request count before launching a large run. - x86_64-only task images (such as official SWE-bench images) run under amd64 emulation on ARM hosts;
rows record
emulated: trueand timeout budgets scale accordingly. Note this when reporting timing. - Desktop benchmarks require a compatible VM or container backend (see
docs/platform/desktop_platform.mdanddocs/arch/lite_environments.md). Ifsetupreports a missing desktop backend, report it clearly instead of improvising an unsupported hypervisor setup.
Working on the repository
Section titled “Working on the repository”- Tests & contracts:
python -m pytest -qandpython scripts/ci/check_contracts.py. After changing a dataclass insrc/dynbench/core/contracts.pyormodels.py, rundynbench schema export. - Developer skills (single source of truth): Canonical skills live under
skills/<name>/SKILL.md(add-benchmark,verify-benchmark,sota-fail-screen) and are mirrored to all 4 coding-agent roots (.claude/skills/,.codex/skills/,.agents/skills/,.cursor/skills/+.cursor/rules/dynbench.mdc). After editing any skill underskills/, runpython scripts/harness/sync_agent_skills.pyand verify parity withpython scripts/harness/sync_agent_skills.py --check. - Onboarding benchmarks: Use
dynbench bench queueto inspect ready work and follow theadd-benchmarkskill (skills/add-benchmark/SKILL.md) anddocs/arch/onboarding_sop.md. Each benchmark lives inconfigs/benchmarks/entries/<id>.jsonandbenchmarks/<id>/and must passdynbench bench certify <id>andpython scripts/ci/certify_changed.py --base dev. Do not editconfigs/benchmarks/catalog.json,configs/sources.json, or unrelated entries. - Documentation & i18n: Site text is Chinese-first. When adding or updating Chinese strings in
configs/inventory.jsonorconfigs/benchmarks/tracker.json, add matching English entries inconfigs/i18n/en.json(preserving{tokens}and`code`spans) and runpython scripts/site/site_sync.pyto confirm zero untranslated and zero unused strings.