Loading...
Loading...
Compare original and translation side by side
┌─────────────────────────────────────────────────┐
│ orchestrator.sh │
│ │
│ for each iteration: │
│ 1. Count trailing discards in results.tsv │
│ 2. If >= plateau_threshold → search prompt │
│ 3. Spawn agent (claude -p or codex exec) │
│ 4. Agent reads program.md, edits file, evals │
│ 5. Agent updates results.tsv, keeps/reverts │
│ 6. Check stop conditions (iter/cost/plateau) │
│ 7. Loop │
└─────────────────────────────────────────────────┘┌─────────────────────────────────────────────────┐
│ orchestrator.sh │
│ │
│ for each iteration: │
│ 1. Count trailing discards in results.tsv │
│ 2. If >= plateau_threshold → search prompt │
│ 3. Spawn agent (claude -p or codex exec) │
│ 4. Agent reads program.md, edits file, evals │
│ 5. Agent updates results.tsv, keeps/reverts │
│ 6. Check stop conditions (iter/cost/plateau) │
│ 7. Loop │
└─────────────────────────────────────────────────┘$FLEET_ROOT/ # The problem directory
fleet.json # Fleet config
program.md # Agent instructions (you write this)
eval.py # Immutable eval harness (you write this)
solution.py # Mutable file (agent edits this)
results.tsv # Experiment log (agent updates, git-untracked)
orchestrator.sh # Generated by launch.sh
.orch-state.json # Iteration state
.paused # Sentinel (touch to pause)
logs/
session-iter-1.jsonl # Per-iteration session logs
session-iter-2.jsonl
...$FLEET_ROOT/ # 问题目录
fleet.json # 集群配置
program.md # Agent指令文件(用户编写)
eval.py # 不可变评估工具(用户编写)
solution.py # 可修改文件(Agent编辑)
results.tsv # 实验日志(Agent更新,Git不追踪)
orchestrator.sh # 由launch.sh生成
.orch-state.json # 迭代状态
.paused # 暂停标记文件(创建即可暂停)
logs/
session-iter-1.jsonl # 单迭代会话日志
session-iter-2.jsonl
...{
"fleet_name": "optimize-api-latency",
"type": "autoresearch",
"config": {
"model": "sonnet",
"fallback_model": "haiku",
"provider": "claude",
"budget_per_iter": 2.00,
"max_turns": 0
},
"problem": {
"workdir": "/home/user/my-project",
"eval_command": "make benchmark",
"metric_regex": "^p99_latency_ms:\\s*([0-9.]+)",
"metric_direction": "minimize",
"results_file": "results.tsv",
"program_md": "program.md"
},
"stop_when": {
"max_iterations": 30,
"cost_cap_usd": 15.0
},
"search": {
"enabled": true,
"plateau_threshold": 3
}
}{
"fleet_name": "optimize-api-latency",
"type": "autoresearch",
"config": {
"model": "sonnet",
"fallback_model": "haiku",
"provider": "claude",
"budget_per_iter": 2.00,
"max_turns": 0
},
"problem": {
"workdir": "/home/user/my-project",
"eval_command": "make benchmark",
"metric_regex": "^p99_latency_ms:\\s*([0-9.]+)",
"metric_direction": "minimize",
"results_file": "results.tsv",
"program_md": "program.md"
},
"stop_when": {
"max_iterations": 30,
"cost_cap_usd": 15.0
},
"search": {
"enabled": true,
"plateau_threshold": 3
}
}| Field | Default | Description |
|---|---|---|
| | Agent model |
| | Fallback model (must differ from model) |
| | |
| | Max USD per iteration |
| | Max agent turns (0 = unlimited) |
| fleet root | Working directory — the repo/dir the agent operates in. Fleet root stores config + logs only. |
| required | Command to run evaluation ( |
| (optional) | Regex to extract metric from eval output. Must have one capture group. Omit if eval prints a single number. |
| | |
| | TSV log file (in workdir) |
| | Agent instructions file (checked in workdir first, then fleet root) |
| | Hard iteration limit |
| | Total cost limit (0 = no limit) |
| | Enable plateau-triggered web search |
| | Consecutive discards before search |
| 字段 | 默认值 | 描述 |
|---|---|---|
| | Agent使用的模型 |
| | 备用模型(需与主模型不同) |
| | 模型提供商,可选 |
| | 单迭代最大预算(美元) |
| | Agent最大交互轮次(0表示无限制) |
| 集群根目录 | 工作目录 — Agent操作的代码仓库/目录。集群根目录仅存储配置和日志。 |
| 必填 | 运行评估的命令(如 |
| (可选) | 从评估输出中提取指标的正则表达式。必须包含一个捕获组。如果评估仅输出单个数值,可省略此字段。 |
| | 指标优化方向,可选 |
| | 存储实验结果的TSV文件(位于工作目录) |
| | Agent指令文件(优先从工作目录读取,其次是集群根目录) |
| | 最大迭代次数限制 |
| | 总预算限制(0表示无限制) |
| | 是否启用平台期触发的网页搜索 |
| | 触发搜索所需的连续丢弃次数 |
fleet.jsonproblem.workdireval_commandprogram.mdfleet-root/ ← fleet.json + program.md + logs
fleet.json
program.md
logs/ ← created automatically
your-repo/ ← workdir (agent operates here)
src/...
results.tsv ← created automaticallyfleet.jsonproblem.workdireval_commandprogram.mdfleet-root/ ← 包含fleet.json + program.md + logs
fleet.json
program.md
logs/ ← 自动创建
your-repo/ ← 工作目录(Agent在此操作)
src/...
results.tsv ← 自动创建Makefilemake benchmarkmake perfpackage.jsonnpm run benchyarn testpytestpytest -m benchmarkbench/eval_commandmetric_regexbench.shbench.pyeval_command#!/usr/bin/env bashMakefilemake benchmarkmake perfpackage.jsonnpm run benchyarn testpytestpytest -m benchmarkbench/eval_commandmetric_regexbench.shbench.pyeval_command#!/usr/bin/env bash
Then set `"eval_command": "bash bench.sh"` in fleet.json.
然后在fleet.json中设置`"eval_command": "bash bench.sh"`。fleet.jsonprogram.mdbench.shbash ${CLAUDE_SKILL_DIR}/scripts/launch.sh <fleet-root>bash ${CLAUDE_SKILL_DIR}/scripts/status.sh <fleet-root>fleet.jsonprogram.mdbash ${CLAUDE_SKILL_DIR}/scripts/launch.sh <fleet-root>bash ${CLAUDE_SKILL_DIR}/scripts/status.sh <fleet-root>| Script | Purpose |
|---|---|
| Generate orchestrator.sh, spawn in tmux with monitor |
| Show iteration, best metric, results.tsv, cost, plateau |
| View parsed session events for a specific iteration |
| Generate markdown summary after run completes |
| Pause at next iteration boundary |
| Resume paused fleet |
| Hard stop: kill tmux, sweep orphans |
| 脚本 | 用途 |
|---|---|
| 生成orchestrator.sh,在tmux中启动并监控 |
| 显示迭代次数、最优指标、results.tsv内容、成本和平台期状态 |
| 查看指定迭代的解析后会话事件 |
| 运行完成后生成Markdown格式的总结报告 |
| 在下次迭代边界处暂停运行 |
| 恢复暂停的集群 |
| 强制停止:终止tmux会话,清理残留进程 |
program.mdundefinedprogram.mdundefinedresults.tsv<eval_command>results.tsv<eval_command>git add -A && git commit -m "short description"<eval_command>commit metric status descriptiongit reset --hard HEAD~1undefinedgit add -A && git commit -m "简短描述"<eval_command>commit metric status descriptiongit reset --hard HEAD~1undefinedsearch.enabledsearch.plateau_thresholdsearch.enabledsearch.plateau_threshold| Agent says | Rebuttal |
|---|---|
| "The agent should search every iteration for best results" | Search-on-plateau beats always-search. Most early searches are redundant and add latency. Only search when stuck (3+ discards). |
| "I should manage git from the orchestrator" | The agent handles git. It can fix commit messages, handle edge cases, and revert intelligently. The orchestrator just loops. |
| "The eval harness can reuse the same inputs" | Reusing inputs is gameable. The agent will discover identity-based memoization and optimize for the benchmark, not the problem. Use fresh seeded inputs per timed run. |
| "I should use iterative-fleet for this" | Iterative-fleet has a reviewer. Autoresearch has no reviewer — the eval script IS the quality gate. Different pattern, different skill. |
| Agent提议 | 反驳理由 |
|---|---|
| "Agent应在每次迭代中搜索以获得最佳结果" | 平台期触发搜索优于每次都搜索。早期多数搜索是冗余的,还会增加延迟。仅在陷入停滞(3次以上连续丢弃)时才搜索。 |
| "我应该从编排器管理Git" | Git操作由Agent负责。它可以修复提交信息、处理边缘情况,并智能回退。编排器仅负责循环执行。 |
| "评估工具可以复用相同输入" | 复用输入容易被钻空子。Agent会发现基于身份的记忆优化,针对基准测试而非实际问题进行优化。每次计时运行应使用全新的种子输入。 |
| "我应该用iterative-fleet来处理这个问题" | Iterative-fleet包含审核环节。Autoresearch没有审核者——评估脚本就是质量关卡。这是两种不同的模式,对应不同的技能。 |