Skip to content

OpenSIN-Code/autodev-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AutoDev-CLI

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

Features

  • Verification-First gates — every mutation must pytest -q before 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 serverautodev-mcp exposes 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.

Installation

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

Quick start

# 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

MCP integration (SIN-Code WebUI v2)

# 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:

{
  "mcpServers": {
    "autodev": {
      "command": "autodev-mcp",
      "env": {}
    }
  }
}

Architecture

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)

Quality gates

ruff check .                    # 0 errors
pyright .                       # 0 errors
pytest tests/                   # 67 passed

📚 Documentation

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)

License

MIT — see LICENSE.

About

Autonomous coding CLI: autoresearch metrics + SIN-Code verification (M1/M3/M4)

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages