Skip to content

Add autoresearch plugin: autonomous experiment loop for optimization research#12

Merged
enoreyes merged 6 commits into
masterfrom
feat/autoresearch-plugin
Mar 28, 2026
Merged

Add autoresearch plugin: autonomous experiment loop for optimization research#12
enoreyes merged 6 commits into
masterfrom
feat/autoresearch-plugin

Conversation

@enoreyes

Copy link
Copy Markdown
Contributor

What

New plugin: autoresearch — an autonomous experiment loop for optimization research, inspired by karpathy/autoresearch and pi-autoresearch.

Try an idea, measure it, keep what works, discard what doesn't, repeat. Works for any optimization target: ML training loss, test speed, bundle size, build time, etc.

What's included

File Purpose
skills/autoresearch/SKILL.md Main skill — setup, experiment loop, and finalization
skills/autoresearch/autoresearch_helper.py Stdlib-only Python helper for JSONL state, MAD-based confidence scoring, and experiment evaluation

How it works

  1. Setup — gather optimization goal, create branch, write state files (autoresearch.md, autoresearch.sh, autoresearch.jsonl)
  2. Loop — edit files, run benchmark, parse METRIC name=value output, evaluate with MAD-based confidence scoring, keep or discard, repeat
  3. Finalize — group kept experiments into clean, independently-mergeable branches for review

Key features

  • Domain-agnostic — works for ML training, test speed, bundle size, or anything with a measurable metric
  • MAD-based confidence scoring — distinguishes real improvements from benchmark noise (>=2.0x = likely real, <1.0x = within noise)
  • Git-backed state — auto-commit on keep, auto-revert on discard, all state in files for session continuity
  • Backpressure checks — optional autoresearch.checks.sh for correctness validation (tests, types, lint)
  • ASI (Actionable Side Information) — structured diagnostics that survive reverts so future sessions don't re-discover dead ends
  • Mission-compatible — suggests /enter-mission for longer campaigns; works as a mission worker skill
  • Configurable termination — fixed experiment count, time budget, target metric, or run until interrupted

Install

droid plugin marketplace add https://github.com/Factory-AI/factory-plugins
droid plugin install autoresearch@factory-plugins

Then invoke via /autoresearch or let the model activate it when the user asks to optimize something.

enoreyes and others added 5 commits March 28, 2026 12:15
…research

New plugin with:
- autoresearch skill: setup + experiment loop with MAD-based confidence scoring
- autoresearch-finalize skill: extract clean branches from experiment history
- autoresearch-experimenter droid: mission worker for orchestrated optimization
- /autoresearch command: quick entry point
- autoresearch_helper.py: stdlib-only Python helper for JSONL state, scoring, evaluation

Inspired by karpathy/autoresearch and pi-autoresearch. Works for any optimization
target (ML training, test speed, bundle size, etc.) both standalone and as a
mission worker skill.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
…y slash commands

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
…ion guidance

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
… loop

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
factory-nizar
factory-nizar previously approved these changes Mar 28, 2026
SKILL.md:
- P0: Add init subcommand call in setup, include JSONL in initial commit
- P0: Reorder keep flow: log to JSONL before git commit (prevents entry loss)
- P0: Replace git clean -fd with backup/restore pattern for state files
- P1: Add concrete baseline commands in Step 4
- P1: Add --asi flag to all log invocation examples
- P1: Handle existing branch on resume (checkout || checkout -b)
- P2: Fix evaluate text (compare against best-kept, not baseline)
- P2: Skip user confirmation in mission worker finalization
- P2: Reference status subcommand in resume section
- P2: Show --metrics flag in log examples

autoresearch_helper.py:
- P0: Replace > 0 metric filter with status-based filter (supports zero/negative metrics)
- P1: Use find_baseline() consistently in compute_confidence
- P1: Add init-before-log guard (exit 1 if no config)

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@enoreyes
enoreyes merged commit f53c7ac into master Mar 28, 2026
@enoreyes
enoreyes deleted the feat/autoresearch-plugin branch March 28, 2026 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants