|
| 1 | +# Quickstart — see the loop close in 30 seconds |
| 2 | + |
| 3 | +> **10-minute promise, actually 1.4 seconds. \$0. No API key.** |
| 4 | +
|
| 5 | +This example exists for one reason: prove that a stranger can clone the repo and watch a real `evolution/accepted` commit appear in under a minute. The mission is deliberately small — *drive ruff to zero violations on `src/messy.py`* — so the whole closed loop fits in one terminal scroll. |
| 6 | + |
| 7 | +There is **no LLM** in this example. The planner / executor / evaluator are 30-line Python scripts checked into the demo target itself. The point is to demonstrate the *runtime*: worktree sandboxing, scope enforcement, ledger writes, the `evolution/accepted` branch advancing — not LLM smarts. When you want LLM-driven evolution, see `examples/oss_fix_demo/` (separate example, requires `claude` CLI or an API key). |
| 8 | + |
| 9 | +## Run it |
| 10 | + |
| 11 | +From a fresh clone of `evolution-kernel`: |
| 12 | + |
| 13 | +```bash |
| 14 | +pip install -e . |
| 15 | +pip install ruff # only test dep beyond the runtime |
| 16 | +bash examples/quickstart/setup.sh |
| 17 | +evolution-kernel \ |
| 18 | + --config examples/quickstart/evolution.yml \ |
| 19 | + --repo /tmp/ek-quickstart-target \ |
| 20 | + --ledger /tmp/ek-quickstart-ledger \ |
| 21 | + --loop |
| 22 | +``` |
| 23 | + |
| 24 | +Expected output (last 8 lines): |
| 25 | + |
| 26 | +``` |
| 27 | +{ |
| 28 | + "accepted": true, |
| 29 | + "candidate_commit": "<sha>", |
| 30 | + "reason": "hard gates passed and evaluator recommended promotion", |
| 31 | + ... |
| 32 | +} |
| 33 | +``` |
| 34 | + |
| 35 | +## Measured (2026-05-17, this machine) |
| 36 | + |
| 37 | +| Step | Wall-clock | Cost | |
| 38 | +|---|---|---| |
| 39 | +| `setup.sh` | 57 ms | \$0 | |
| 40 | +| `evolution-kernel --loop` (2 rounds — 1 accept + 1 halt) | **1.4 s** | \$0 | |
| 41 | +| Total | **~1.5 s** | **\$0** | |
| 42 | + |
| 43 | +Compared to the "10 minutes" headline this is a 400× margin. The headline number is what we promise a stranger on a slow laptop with cold caches; the actual e2e is well inside it. |
| 44 | + |
| 45 | +## What the loop did |
| 46 | + |
| 47 | +`runs/0001/` contains the complete forensic record: |
| 48 | + |
| 49 | +- `plan.json` — canned plan: "run ruff check --fix, then ruff format on src/" |
| 50 | +- `executor_output.json` — exit codes and stdout tails from both ruff invocations |
| 51 | +- `patch.diff` — the actual diff ruff applied (removes unused imports, fixes `== None` → `is None`, fixes whitespace) |
| 52 | +- `evaluation.json` — `hard_gates_passed: true`, `ruff_output_tail: "All checks passed!"` |
| 53 | +- `decision.json` — `accepted: true`, with the candidate sha that landed on `evolution/accepted` |
| 54 | +- `reflection.json` — what the governor records about this run for the next planner call |
| 55 | + |
| 56 | +You can inspect the real commit: |
| 57 | + |
| 58 | +```bash |
| 59 | +git -C /tmp/ek-quickstart-target log --oneline evolution/accepted |
| 60 | +# 33a92a4 evolution experiment 0001 |
| 61 | +# 433ebdd quickstart target initial commit |
| 62 | +``` |
| 63 | + |
| 64 | +Round 2 (the `halt`) is the natural stopping signal: ruff is already clean, the executor has nothing to change, the governor records `executor produced no repo changes` and stops. |
| 65 | + |
| 66 | +## Want the LLM version? |
| 67 | + |
| 68 | +See `examples/oss_fix_demo/` — same shape, real OSS target, `claude` CLI as executor. |
0 commit comments