Autonomous Python optimizer that fuses Karpathy's autoresearch
pattern (metrikgetriebene
optimization loops) with the SIN-Code
verification-first + bounded-autonomy invariants.
AGENTS.md → hard invariants (DO NOT MODIFY)
program.md → current research goal + metric + budget
↓
autodev daemon ── mutation ──► verify_cmd ──► keep? revert? → log lesson
- ✅ Verification-First gates — every mutation must
pytest -qbefore it is kept (SIN-Code M3). - 🧠 Closed Learning Loop — failed experiments become SQLite lessons that surface in the LLM prompt next round (SIN-Code v3.4.0).
- ⏱ Bounded Autonomy — hard time and experiment caps (SIN-Code M4).
- 🛰 MCP server —
autodev-mcpexposes the same capabilities as Model-Context-Protocol tools (autodev_status,autodev_lessons,autodev_run_experiment,autodev_init) for use by the SIN-Code WebUI v2.
git clone https://github.com/OpenSIN-Code/autodev-cli.git
cd autodev-cli
pip install -e ".[dev]"
export OPENAI_API_KEY="sk-..." # required only when running the daemon# Bootstrap a project
mkdir my-project && cd my-project
cp ../autodev-cli/AGENTS.md .
cp ../autodev-cli/program.md .
edit my-project/program.md # set your objective + metric
autodev init . # creates .autodev/knowledge.db
autodev status --project-root . --json # single-source snapshot for MCP
autodev daemon \
--verify-cmd "pytest -q" \
--budget-minutes 30 --max-experiments 12# Run the MCP server (zero-config, stdio transport)
autodev-mcp
# → exposes 4 tools that the WebUI chat agent can call.Wire it into your SIN-Code WebUI v2 MCP client config:
autodev/
├── __init__.py
├── cli.py # Typer CLI (rich UI OR --json NDJSON)
├── cli_mcp.py # stdio MCP server (4 tools)
├── agent_loop.py # PLAN → ACT → VERIFY → DONE core
├── knowledge_base.py # SQLite lessons (closed-loop memory)
├── mutator.py # OpenAI-powered proposal
├── verifier.py # subprocess verification gate
├── budget.py # time + experiment watchdog (M4)
└── config.py # AGENTS.md + program.md parsers
tests/
├── conftest.py # temp_project, temp_db, sample_lessons fixtures
├── test_config.py # 8 tests (AGENTS.md / program.md parsing)
├── test_knowledge_base.py # 9 tests (SQLite lessons / experiments / goals)
├── test_verifier.py # 9 tests (subprocess + metric extraction)
├── test_mutator.py # 6 tests (OpenAI client mock)
├── test_budget.py # 9 tests (time + experiments)
├── test_agent_loop.py # 7 tests (_extract_lesson + sandbox)
├── test_agent_loop_run.py # 10 tests (full PLAN→ACT→VERIFY with fakes)
└── test_cli.py # 9 tests (Typer smoke)
ruff check . # 0 errors
pyright . # 0 errors
pytest tests/ # 67 passed| Doc | What it covers |
|---|---|
docs/ARCHITECTURE.md |
Systemdesign (PLAN→ACT→VERIFY→DONE), Komponenten-Übersicht, Datenfluss |
docs/LEARNING.md |
Closed Learning Loop: SQLite KB, Pattern-Klassifikation, Prompt-Injektion |
docs/SAFETY.md |
Bounded Autonomy: 3 harte Invarianten, AGENTS.md-Firewall, Threat Model |
docs/COOKBOOK.md |
Praxis-Rezepte: Hot Function, Coverage, Memory Leak, Latency |
docs/SWARM.md |
Multi-Agent Orchestration: Profile, First-Verified-Wins |
docs/SESSIONS.md |
Time-Travel Sessions: fork/snapshot/diff/merge von Lessons |
docs/MCP.md |
Externe Tools + autodev-mcp Bridge-Pattern |
docs/CONTRIBUTING.md |
Developer Guide, Conventional Commits, PR-Checklist |
docs/CHANGELOG.md |
Versionshistorie (Keep a Changelog) |
MIT — see LICENSE.
{ "mcpServers": { "autodev": { "command": "autodev-mcp", "env": {} } } }