Autoresearch 会话审
- 作者仓库星标 3
- 作者仓库 FFT_nano
Finalize Autoresearch
Turn a noisy autoresearch branch into clean, independent branches — one per logical change, each starting from the merge-base.
Step 1 — Analyze and Propose Groups
- Read
autoresearch.jsonl. Filter to kept experiments only. - Read
autoresearch.mdfor context. - Expand all short commit hashes to full hashes:
git rev-parse <short_hash> - Get the merge-base:
git merge-base HEAD main - For each kept commit, get the diff stat (use
$BASE..<commit>for the first,<prev_kept>..<commit>for subsequent). - Group kept commits into logical changesets:
- Preserve application order. Group N comes before Group N+1.
- No two groups may touch the same file. Each branch is applied to merge-base independently — overlapping files would conflict. If two groups touch the same file, merge them into one group.
- Watch for cross-file dependencies. Each branch is independent, so if group 1 adds an API in
api.jsand group 2 calls it inparser.js, group 2's branch won't work in isolation. When proposing groups, flag dependencies: "group 2 depends on group 1 — review together." If the dependency is tight, merge the groups. - Keep each group small and focused. One idea, one theme per group.
- Don't hardcode a count. Could be 2, could be 15.
Present the proposed grouping to the user:
Proposed branches (each from merge-base, independent):
1. **Switch test runner to forks pool** (commits abc1234, def5678)
Files: vitest.config.ts, package.json
Metric: 42.3s → 38.1s (-9.9%)
2. **Tune worker count and timeouts** (commits ghi9012, jkl3456)
Files: test/setup.ts
Metric: 38.1s → 31.7s (-16.8%)
Wait for approval before proceeding.
Step 2 — Write groups.json and Run
Write groups.json:
{
"base": "<full merge-base hash>",
"trunk": "main",
"final_tree": "<full hash of current HEAD>",
"goal": "short-slug",
"groups": [
{
"title": "Switch to forks pool",
"body": "Why + what changed.\n\nExperiments: #3, #5\nMetric: total_time 42.3s → 38.1s (-9.9%)",
"last_commit": "<full hash of last kept commit in this group>",
"slug": "forks-pool"
}
]
}
Key rules:
last_commitmust be a full hash. Expand from jsonl short hashes withgit rev-parse.- No two groups may share a file. The script validates this and fails if violated.
Then run:
bash <SKILL_DIR>/finalize.sh /tmp/groups.json
The script creates one branch per group from the merge-base, verifies the union matches the original branch, and prints a summary with all branches, cleanup commands, and any ideas from autoresearch.ideas.md.
On creation failure: rolls back (deletes branches, restores original branch, pops stash). On verification failure: exits non-zero but leaves branches intact for inspection.
Step 3 — Report
After the script finishes, report to the user:
- Branches created and what each contains
- Overall metric improvement (baseline → best)
- Show the cleanup commands from the script's summary output
Edge Cases
- Only 1 kept experiment: One branch is fine — don't force splits.
- Overlapping files between groups: The script fails with an error naming the file. Merge the overlapping groups and retry.
- Non-experiment commits on the branch: Skip them — only process kept experiments from the jsonl.
- 流狐分类
- 工程开发
- 作者声明 Agent
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 作者 / 版本 / 许可
- @0-CYBERDYNE-SYSTEMS-0 · 未声明 license
- 流狐 Token 估算
- 低消耗
- 流狐接入估算
- 即装即用
- 是否需要外部 API Key
- 未发现要求
- 检测到的系统要求
- 未声明
- 底层运行要求
- 未声明
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 检测到的网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
作者没有在当前 SKILL.md 中定义固定输出样例。 Read autoresearch.jsonl. Filter to kept experiments only. Read autoresearch.md for context. Expand all short commit hashes to full hashes: git rev-parse <shorthash>
Write groups.json: Key rules: lastcommit must be a full hash. Expand from jsonl short hashes with git rev-parse.
After the script finishes, report to the user: Branches created and what each contains Overall metric improvement (baseline → best)
# Finalize Autoresearch
Turn a noisy autoresearch branch into clean, independent branches — one per logical change, each starting from the merge-base.
## Step 1 — Analyze and Propose Groups
1. Read `autoresearch.jsonl`. Filter to **kept** experiments only.
2. Read `autoresearch.md` for context.
3. Expand all short commit hashes to full hashes: `git rev-parse <short_hash>`
4. Get the merge-base: `git merge-base HEAD main`
5. For each kept commit, get the diff stat (use `$BASE..<commit>` for the first, `<prev_kept>..<commit>` for subsequent).
6. Group kept commits into logical changesets:
- **Preserve application order.** Group N comes before Group N+1.
- **No two groups may touch the same file.** Each branch is applied to merge-base independently — overlapping files would conflict. If two groups touch the same file, merge them into one group.
- **Watch for cross-file dependencies.** Each branch is independent, so if group 1 adds an API in `api.js` and group 2 calls it in `parser.js`, group 2's branch won't work in isolation. When proposing groups, flag dependencies: "group 2 depends on group 1 — review together." If the dependency is tight, merge the groups.
- **Keep each group small and focused.** One idea, one theme per group.
- **Don't hardcode a count.** Could be 2, could be 15.
Present the proposed grouping to the user:
```
Proposed branches (each from merge-base, independent):
1. **Switch test runner to forks pool** (commits abc1234, def5678)
Files: vitest.config.ts, package.json
Metric: 42.3s → 38.1s (-9.9%)
2. **Tune worker count and timeouts** (commits ghi9012, jkl3456)
Files: test/setup.ts
Metric: 38.1s → 31.7s (-16.8%)
```
**Wait for approval before proceeding.**
## Step 2 — Write groups.json and Run
Write `groups.json`:
… 作者原文负责流程事实;流狐只索引当前章节、要点、文件与命令。
章节 -> Step 1 — Analyze and Propose Groups → Step 2 — Write groups.json and Run → Step 3 — Report → Edge Cases
要点 -> kept · Preserve application order. · No two groups may touch the same file. · Watch for cross-file dependencies. · Keep each group small and focused. · Don't hardcode a count. · Switch test runner to forks pool · Tune worker count and timeouts
文件/命令 -> autoresearch.jsonl · autoresearch.md · git rev-parse <shorthash> · git merge-base HEAD main · $BASE..<commit> · <prevkept>..<commit> · api.js · parser.js
内容 SHA-256 -> 637e36d8d57a
方法与流程
适用与边界
原文中的明确线索
autoresearch.jsonl、autoresearch.md、git rev-parse <shorthash>、git merge-base HEAD main、$BASE..<commit>、<prevkept>..<commit>、api.js、parser.js