Skip to content

Commit 91141e4

Browse files
Merge finalize into main autoresearch skill as the final phase of the loop
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
1 parent 0589781 commit 91141e4

2 files changed

Lines changed: 87 additions & 133 deletions

File tree

plugins/autoresearch/skills/autoresearch-finalize/SKILL.md

Lines changed: 0 additions & 132 deletions
This file was deleted.

plugins/autoresearch/skills/autoresearch/SKILL.md

Lines changed: 87 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,92 @@ Droid sessions have finite context. To handle this gracefully:
310310
- **Think longer when stuck.** Re-read source files, study the data, reason about what's actually happening. The best ideas come from deep understanding.
311311
- **Resuming:** read autoresearch.md + git log, continue looping.
312312

313+
## Finalization
314+
315+
When the experiment loop ends (termination condition met, user interrupts, or context exhausted), finalize the results into clean, reviewable branches. This is the last phase of an autoresearch session.
316+
317+
### Step 1: Summarize Results
318+
319+
```bash
320+
python3 autoresearch_helper.py summary --jsonl autoresearch.jsonl
321+
```
322+
323+
Review the git log for actual commits:
324+
325+
```bash
326+
git log --oneline --stat $(git merge-base HEAD main)..HEAD
327+
```
328+
329+
### Step 2: Group Changes
330+
331+
Group kept experiments into **logical changesets**. Each group should:
332+
- Represent a single coherent optimization or change
333+
- Not share modified files with other groups (so branches can merge independently)
334+
- Have a clear description of what it achieves and the metric improvement
335+
336+
Present the proposed grouping to the user for approval:
337+
338+
```
339+
Group 1: "Reduce model depth from 8 to 6"
340+
Files: train.py (DEPTH, HEAD_DIM, N_EMBED)
341+
Metric improvement: val_bpb 1.15 -> 1.08 (-6.1%)
342+
Experiments: #3, #7, #12
343+
344+
Group 2: "Switch to cosine LR schedule"
345+
Files: train.py (lr_schedule, warmup_steps)
346+
Metric improvement: val_bpb 1.08 -> 1.05 (-2.8%)
347+
Experiments: #15, #18
348+
```
349+
350+
Wait for user confirmation before proceeding.
351+
352+
### Step 3: Resolve File Conflicts
353+
354+
If groups share files, resolve before creating branches:
355+
- Merge the groups into one (if changes are related)
356+
- Split the file changes more carefully (if they're truly independent modifications to different parts)
357+
- Ask the user which group gets priority
358+
359+
Groups **must not share files** — each branch must be independently mergeable. If all changes touch the same file and can't be separated, create a single finalized branch with all improvements combined.
360+
361+
### Step 4: Create Clean Branches
362+
363+
For each group:
364+
365+
```bash
366+
merge_base=$(git merge-base HEAD main)
367+
git checkout -b autoresearch/finalize/<group-name> $merge_base
368+
git checkout autoresearch/<session-branch> -- <file1> <file2> ...
369+
git commit -m "<group description>
370+
371+
Autoresearch results:
372+
- Metric: <name> improved from <baseline> to <best> (<delta>%)
373+
- Confidence: <score>x noise floor
374+
- Experiments: <count> total, <kept> kept"
375+
```
376+
377+
### Step 5: Verify and Report
378+
379+
For each finalized branch, run the benchmark to confirm the improvement holds, run any checks if applicable, and verify it merges cleanly with main.
380+
381+
Present a summary to the user:
382+
383+
```
384+
Created 2 clean branches from 20 experiments:
385+
386+
autoresearch/finalize/reduce-depth
387+
val_bpb: 1.15 -> 1.08 (-6.1%)
388+
Ready for review
389+
390+
autoresearch/finalize/cosine-schedule
391+
val_bpb: 1.08 -> 1.05 (-2.8%)
392+
Ready for review
393+
394+
Original experiment branch preserved: autoresearch/<session-branch>
395+
```
396+
397+
The original experiment branch is always preserved — finalization creates new branches.
398+
313399
## Mission Worker Mode
314400

315-
When running as a mission worker, the feature description specifies the optimization goal, termination condition, files in scope, and constraints. Read it carefully, follow the same loop procedure above, and respect the termination condition. When the condition is met, stop and report results in the handoff.
401+
When running as a mission worker, the feature description specifies the optimization goal, termination condition, files in scope, and constraints. Read it carefully, follow the same loop procedure above, and respect the termination condition. When the condition is met, run finalization and report results in the handoff.

0 commit comments

Comments
 (0)