You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+99-98Lines changed: 99 additions & 98 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,57 @@
1
1
# AutoHarness
2
2
3
-
A self-evolving coding agent in Rust — the smallest possible implementation that actually works. This README reflects the current evolution iteration of the agent.
3
+
<palign="center">
4
+
<strong>A self-evolving coding agent in Rust.</strong><br/>
5
+
Chat with it, let it reflect, and let it improve itself.
The agent has two modes: an interactive CLI where you give it tasks, and a self-evolution loop where it reads its own source, proposes improvements, verifies them, and repeats. The LLM is the judge — no numeric scoring.
D12 --> D13[log lint_result + test_result to traj]
41
83
```
42
84
43
-
### Chat mode
85
+
---
44
86
45
-
Interactive REPL. Stdin is read in a background thread and pushed to a queue so you can keep typing while the LLM is processing. Each reply is printed; everything else is logged to `.evo/sessions/<ts>/traj.jsonl`.
87
+
## 🔧 Modes
46
88
47
-
The LLM automatically groups your messages into tasks — if a new message starts a different topic, artifacts go into a new `outputs/<ts>/task_N` directory.
89
+
### Chat Mode (default)
90
+
- REPL with async stdin queue (`VecDeque`)
91
+
- LLM decides if each message starts a **new task** or **continues** the current one
92
+
- Artifacts are separated into `outputs/<ts>/task_N`
93
+
- Events are logged to `.evo/sessions/<ts>/traj.jsonl`
48
94
49
-
### Evolve mode
95
+
### Evolve Mode (`auto-harness evolve`)
96
+
1.**Reflect:** analyze unprocessed trajectories and produce one concrete improvement
97
+
2.**Evolve:** iterate up to `MAX_ITERS`, applying one LLM-proposed change per iteration
98
+
3.**Doc update:** rewrite `CLAUDE.md` and `README.md`
99
+
4.**Validate:** run `cargo clippy -- -D warnings` and `cargo test --release`
50
100
51
-
1.**Reflect** — reads chat session trajs newer than the last watermark, asks the LLM for one concrete improvement suggestion, logs it.
52
-
2.**Evolve** — up to `MAX_ITERS` iterations. Each iteration: show LLM current `src/main.rs` and `src/AGENTS.md` → propose one change → verify with `cargo build`. Stops on `SKIP` or `PATIENCE` consecutive non-improving iters.
53
-
3.**Doc update** — after the loop, the LLM rewrites `CLAUDE.md` and `README.md` to match the current implementation.
54
-
4.**Lint + test** — `cargo clippy -- -D warnings` then `cargo test --release`; results logged to traj; failures print a WARNING to stderr.
101
+
---
55
102
56
-
### What the agent can evolve
103
+
##🧩 Evolvable Artifacts
57
104
58
-
Beyond just its own source code, the agent can improve all of these via `write_file`:
59
-
60
-
| Artifact | Purpose |
105
+
| Artifact | How it evolves |
61
106
|---|---|
62
-
|`src/main.rs`| Core agent logic (atomic rewrite with build verification) |
63
-
|`src/AGENTS.md`| Agent orchestration best practices guide |
64
-
|`src/prompts/chat_system.txt`| Chat mode persona and rules |
The LLM emits plain-text XML-like tags — no framework, no function-calling schema:
118
+
## 🗂️ Project Layout
72
119
73
-
```
74
-
<tool name="shell">cargo test 2>&1</tool>
75
-
<tool name="write_self">...full new src/main.rs...</tool>
76
-
<tool name="write_file">path/to/file
77
-
...full content...</tool>
78
-
```
79
-
80
-
`write_self` is atomic: backup → write → `cargo build --release` → restore on failure, reporting the exact compiler error back to the LLM so it can self-correct.
81
-
82
-
### Progressive disclosure
83
-
84
-
Every LLM call site is bounded — no unbounded context growth:
85
-
86
-
-**Reflection**: traj stripped to metadata-only (no content blobs), capped at 8 000 chars
87
-
-**Task judge**: last 6 messages only
88
-
-**Chat history**: sliding window of 20 messages
89
-
-**Shell output**: capped at 2 000 chars
90
-
-**Build errors**: capped at 400 chars
91
-
92
-
## Installation
93
-
94
-
```bash
95
-
# Install Rust (if not already installed)
96
-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
0 commit comments